]>
Commit | Line | Data |
---|---|---|
1d5d0ae9 | 1 | //\r |
2 | // Copyright (c) 2011, ARM Limited. All rights reserved.\r | |
1d5d0ae9 | 3 | //\r |
c52e2dca | 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 | |
1d5d0ae9 | 11 | //\r |
12 | //\r | |
13 | \r | |
14 | #include <AsmMacroIoLib.h>\r | |
15 | #include <Base.h>\r | |
16 | #include <Library/PcdLib.h>\r | |
c52e2dca | 17 | #include <Library/ArmPlatformLib.h>\r |
1d5d0ae9 | 18 | #include <ArmPlatform.h>\r |
19 | #include <AutoGen.h>\r | |
20 | \r | |
21 | INCLUDE AsmMacroIoLib.inc\r | |
22 | \r | |
23 | EXPORT ArmPlatformIsMemoryInitialized\r | |
1d5d0ae9 | 24 | \r |
25 | PRESERVE8\r | |
26 | AREA ArmRealViewEbHelper, CODE, READONLY\r | |
27 | \r | |
28 | /**\r | |
29 | Called at the early stage of the Boot phase to know if the memory has already been initialized\r | |
30 | \r | |
31 | Running the code from the reset vector does not mean we start from cold boot. In some case, we\r | |
32 | can go through this code with the memory already initialized.\r | |
33 | Because this function is called at the early stage, the implementation must not use the stack.\r | |
34 | Its implementation must probably done in assembly to ensure this requirement.\r | |
35 | \r | |
36 | @return Return the condition value into the 'Z' flag\r | |
37 | \r | |
38 | **/\r | |
39 | ArmPlatformIsMemoryInitialized\r | |
40 | // Check if the memory has been already mapped, if so skipped the memory initialization\r | |
41 | LoadConstantToReg (ARM_EB_SYSCTRL, r0)\r | |
42 | ldr r0, [r0, #0]\r | |
43 | \r | |
44 | // 0x200 (BIT9): This read-only bit returns the remap status.\r | |
45 | and r0, r0, #0x200\r | |
46 | tst r0, #0x200\r | |
47 | bx lr\r | |
1d5d0ae9 | 48 | END\r |