//\r
// Copyright (c) 2011, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#include <AsmMacroIoLib.h>\r
#include <Base.h>\r
#include <Library/PcdLib.h>\r
+#include <Library/ArmPlatformLib.h>\r
#include <ArmPlatform.h>\r
-#include <Drivers/PL354Smc.h>\r
#include <AutoGen.h>\r
\r
INCLUDE AsmMacroIoLib.inc\r
- \r
- EXPORT ArmPlatformIsMemoryInitialized\r
+\r
EXPORT ArmPlatformInitializeBootMemory\r
- IMPORT SMCInitializeNOR\r
- IMPORT SMCInitializeSRAM\r
- IMPORT SMCInitializePeripherals\r
- IMPORT SMCInitializeVRAM\r
- \r
+\r
PRESERVE8\r
AREA CTA9x4Helper, CODE, READONLY\r
\r
tst r0, #0x40000000\r
bx lr\r
\r
-/**\r
- Initialize the memory where the initial stacks will reside\r
-\r
- This memory can contain the initial stacks (Secure and Secure Monitor stacks).\r
- In some platform, this region is already initialized and the implementation of this function can\r
- do nothing. This memory can also represent the Secure RAM.\r
- This function is called before the satck has been set up. Its implementation must ensure the stack\r
- pointer is not used (probably required to use assembly language)\r
-\r
-**/\r
-ArmPlatformInitializeBootMemory\r
- mov r5, lr\r
-\r
- //\r
- // Initialize PL354 SMC\r
- //\r
- LoadConstantToReg (ARM_VE_SMC_CTRL_BASE, r1)\r
-\r
- // NOR Flash 0\r
- mov r2, PL354_SMC_DIRECT_CMD_ADDR_CS(0,0)\r
- blx SMCInitializeNOR\r
-\r
- // NOR Flash 1\r
- mov r2, PL354_SMC_DIRECT_CMD_ADDR_CS(1,0)\r
- blx SMCInitializeNOR\r
-\r
- // Setup SRAM\r
- blx SMCInitializeSRAM\r
-\r
- // Memory Mapped Peripherals\r
- blx SMCInitializePeripherals\r
-\r
- // Initialize VRAM\r
- //TODO: Check if we really must inititialize Video SRAM in UEFI. Does Linux can do it ? Does the Video driver can do it ?\r
- // It will be faster (only initialize if required) and easier (remove assembly code because of a stack available) to move this initialization.\r
- LoadConstantToReg (VRAM_MOTHERBOARD_BASE, r2)\r
- blx SMCInitializeVRAM\r
-\r
- bx r5\r
-\r
- END\r