]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S
ArmPlatformPkg/ArmPlatformLib: Introduce ArmPlatformSecBootAction function
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibCTA9x4 / CTA9x4Helper.S
1 //
2 // Copyright (c) 2011, ARM Limited. All rights reserved.
3 //
4 // This program and the accompanying materials
5 // are licensed and made available under the terms and conditions of the BSD License
6 // which accompanies this distribution. The full text of the license may be found at
7 // http://opensource.org/licenses/bsd-license.php
8 //
9 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 //
12 //
13
14 #include <AsmMacroIoLib.h>
15 #include <Base.h>
16 #include <Library/PcdLib.h>
17 #include <Library/ArmPlatformLib.h>
18 #include <ArmPlatform.h>
19 #include <AutoGen.h>
20
21 .text
22 .align 3
23
24 GCC_ASM_EXPORT(ArmPlatformIsMemoryInitialized)
25
26 /**
27 Called at the early stage of the Boot phase to know if the memory has already been initialized
28
29 Running the code from the reset vector does not mean we start from cold boot. In some case, we
30 can go through this code with the memory already initialized.
31 Because this function is called at the early stage, the implementation must not use the stack.
32 Its implementation must probably done in assembly to ensure this requirement.
33
34 @return Return the condition value into the 'Z' flag
35
36 **/
37 ASM_PFX(ArmPlatformIsMemoryInitialized):
38 // Check if the memory has been already mapped, if so skipped the memory initialization
39 LoadConstantToReg (ARM_VE_SYS_CFGRW1_REG ,r0)
40 ldr r0, [r0, #0]
41
42 // 0x40000000 = Value of Physical Configuration Switch SW[0]
43 and r0, r0, #0x40000000
44 tst r0, #0x40000000
45 bx lr
46