]>
git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c
3 Copyright (c) 2011-2012, ARM Limited. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/ArmLib.h>
17 #include <Library/ArmCpuLib.h>
18 #include <Library/ArmGenericTimerCounterLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PcdLib.h>
22 #include <Chipset/ArmCortexA15.h>
29 // Check if Architectural Timer frequency is valid number (should not be 0)
30 ASSERT (PcdGet32 (PcdArmArchTimerFreqInHz
));
31 ASSERT(ArmIsArchTimerImplemented () != 0);
33 // Enable SWP instructions
34 ArmEnableSWPInstruction ();
36 // Enable program flow prediction, if supported.
37 ArmEnableBranchPrediction ();
39 // Note: System Counter frequency can only be set in Secure privileged mode,
40 // if security extensions are implemented.
41 ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz
));
44 // Turn on SMP coherency
45 ArmSetAuxCrBit (A15_FEATURE_SMP
);
52 ArmCpuSetupSmpNonSecure (
56 /*// Make the SCU accessible in Non Secure world
57 if (ArmPlatformIsPrimaryCore (MpId)) {
58 ScuBase = ArmGetScuBaseAddress();
60 // Allow NS access to SCU register
61 MmioOr32 (ScuBase + A9_SCU_SACR_OFFSET, 0xf);
62 // Allow NS access to Private Peripherals
63 MmioOr32 (ScuBase + A9_SCU_SSACR_OFFSET, 0xfff);