If the DRAM is remapped at 0x0 then we need to wake up the secondary cores from wfe
(waiting for the memory to be initialized) as the instruction is still in the remapped
flash region at 0x0 to make them jumping into the C-code which lives in the NOR1 at 0x44000000 before
the region 0x0 is remapped as DRAM.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14910
6f19259b-4bc3-4df7-8a09-
765794883524
MemoryAllocationLib\r
PL341DmcLib\r
PL301AxiLib\r
MemoryAllocationLib\r
PL341DmcLib\r
PL301AxiLib\r
- L2X0CacheLib\r
- SerialPortLib\r
\r
[Sources.common]\r
CTA9x4Helper.asm | RVCT\r
\r
[Sources.common]\r
CTA9x4Helper.asm | RVCT\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2013, 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
* \r
* This program and the accompanying materials \r
* are licensed and made available under the terms and conditions of the BSD License \r
#include <Library/ArmPlatformLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/ArmPlatformLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/PcdLib.h>\r
-#include <Library/SerialPortLib.h>\r
\r
#include <Drivers/PL341Dmc.h>\r
#include <Drivers/PL301Axi.h>\r
\r
#include <Drivers/PL341Dmc.h>\r
#include <Drivers/PL301Axi.h>\r
\r
#include <ArmPlatform.h>\r
\r
\r
#include <ArmPlatform.h>\r
\r
-#define SerialPrint(txt) SerialPortWrite ((UINT8*)(txt), AsciiStrLen(txt)+1);\r
-\r
ARM_CORE_INFO mVersatileExpressMpCoreInfoCTA9x4[] = {\r
{\r
// Cluster 0, Core 0\r
ARM_CORE_INFO mVersatileExpressMpCoreInfoCTA9x4[] = {\r
{\r
// Cluster 0, Core 0\r
- UINT32 Value;\r
-\r
- // Memory Map remapping\r
- if (FeaturePcdGet(PcdNorFlashRemapping)) {\r
- SerialPrint ("Secure ROM at 0x0\n\r");\r
- } else {\r
- Value = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1\r
- // Remap the DRAM to 0x0\r
- MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM);\r
- }\r
-\r
- PL341DmcInit(ARM_VE_DMC_BASE, &DDRTimings);\r
- PL301AxiInit(ARM_VE_FAXI_BASE);\r
+ PL341DmcInit (ARM_VE_DMC_BASE, &DDRTimings);\r
+ PL301AxiInit (ARM_VE_FAXI_BASE);\r
-# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2013, 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
# \r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
\r
[FeaturePcd]\r
gArmPlatformTokenSpaceGuid.PcdStandalone\r
\r
[FeaturePcd]\r
gArmPlatformTokenSpaceGuid.PcdStandalone\r
+ gArmPlatformTokenSpaceGuid.PcdNorFlashRemapping\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec\r
\r
[FixedPcd]\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec\r
\r
[FixedPcd]\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2013, 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
* \r
* This program and the accompanying materials \r
* are licensed and made available under the terms and conditions of the BSD License \r
#include <Library/DebugLib.h>\r
#include <Library/IoLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/IoLib.h>\r
#include <Library/PcdLib.h>\r
+#include <Library/SerialPortLib.h>\r
\r
#include <Drivers/ArmTrustzone.h>\r
#include <Drivers/PL310L2Cache.h>\r
\r
#include <ArmPlatform.h>\r
\r
\r
#include <Drivers/ArmTrustzone.h>\r
#include <Drivers/PL310L2Cache.h>\r
\r
#include <ArmPlatform.h>\r
\r
+#define SerialPrint(txt) SerialPortWrite ((UINT8*)(txt), AsciiStrLen(txt)+1)\r
+\r
/**\r
Initialize the Secure peripherals and memory regions\r
\r
/**\r
Initialize the Secure peripherals and memory regions\r
\r
+ UINT32 Value;\r
+\r
+ // If the DRAM is remapped at 0x0 then we need to wake up the secondary cores from wfe\r
+ // (waiting for the memory to be initialized) as the instruction is still in the remapped\r
+ // flash region at 0x0 to jump in the C-code which lives in the NOR1 at 0x44000000 before\r
+ // the region 0x0 is remapped as DRAM.\r
+ if (!FeaturePcdGet (PcdNorFlashRemapping)) {\r
+ if (!ArmPlatformIsPrimaryCore (MpId)) {\r
+ // Replaced ArmCallWFE () in ArmPlatformPkg/Sec/SecEntryPoint.(S|asm)\r
+ ArmCallWFE ();\r
+ } else {\r
+ // Wake up the secondary core from ArmCallWFE () in ArmPlatformPkg/Sec/SecEntryPoint.(S|asm)\r
+ ArmCallSEV ();\r
+ }\r
+ }\r
+\r
// If it is not the primary core then there is nothing to do\r
if (!ArmPlatformIsPrimaryCore (MpId)) {\r
return RETURN_SUCCESS;\r
// If it is not the primary core then there is nothing to do\r
if (!ArmPlatformIsPrimaryCore (MpId)) {\r
return RETURN_SUCCESS;\r
ArmPlatformInitializeSystemMemory ();\r
}\r
\r
ArmPlatformInitializeSystemMemory ();\r
}\r
\r
+ // Memory Map remapping\r
+ if (FeaturePcdGet (PcdNorFlashRemapping)) {\r
+ SerialPrint ("Secure ROM at 0x0\n\r");\r
+ } else {\r
+ Value = MmioRead32 (ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1\r
+ // Remap the DRAM to 0x0\r
+ MmioWrite32 (ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM);\r
+ }\r
+\r
return RETURN_SUCCESS;\r
}\r
return RETURN_SUCCESS;\r
}\r