]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Helper.asm
ArmPlatformPkg: Coding style (minor changes)
[mirror_edk2.git] / ArmPkg / Drivers / ArmCpuLib / ArmCortexA9Lib / ArmCortexA9Helper.asm
CommitLineData
3127615b 1//\r
2// Copyright (c) 2011, ARM Limited. All rights reserved.\r
3//\r
4// This program and the accompanying materials\r
5// are licensed and made available under the terms and conditions of the BSD License\r
6// which accompanies this distribution. The full text of the license may be found at\r
7// http://opensource.org/licenses/bsd-license.php\r
8//\r
9// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11//\r
12//\r
13\r
14#include <Library/ArmCpuLib.h>\r
15#include <Chipset/ArmCortexA9.h>\r
16\r
17 EXPORT ArmCpuSynchronizeWait\r
18 EXPORT ArmGetScuBaseAddress\r
19 IMPORT CArmCpuSynchronizeWait\r
20\r
21 PRESERVE8\r
22 AREA ArmCortexA9Helper, CODE, READONLY\r
23\r
24// VOID\r
25// ArmCpuSynchronizeWait (\r
26// IN ARM_CPU_SYNCHRONIZE_EVENT Event\r
27// );\r
28ArmCpuSynchronizeWait\r
29 cmp r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
30 // The SCU enabled is the event to tell us the Init Boot Memory is initialized\r
31 beq ArmWaitScuEnabled\r
32 b CArmCpuSynchronizeWait\r
33\r
34// IN None\r
35// OUT r0 = SCU Base Address\r
36ArmGetScuBaseAddress\r
37 // Read Configuration Base Address Register. ArmCBar cannot be called to get\r
38 // the Configuration BAR as a stack is not necessary setup. The SCU is at the\r
39 // offset 0x0000 from the Private Memory Region.\r
40 mrc p15, 4, r0, c15, c0, 0\r
41 bx lr\r
42\r
43ArmWaitScuEnabled\r
44 // Read Configuration Base Address Register. ArmCBar cannot be called to get\r
45 // the Configuration BAR as a stack is not necessary setup. The SCU is at the\r
46 // offset 0x0000 from the Private Memory Region.\r
47 mrc p15, 4, r0, c15, c0, 0\r
48 add r0, r0, #A9_SCU_CONTROL_OFFSET\r
49 ldr r0, [r0]\r
50 cmp r0, #1\r
51 bne ArmWaitScuEnabled\r
52 bx lr\r
53\r
54 END\r