]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Renamed and Invoked earlier ArmPlatformNormalInitialize()
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 2 May 2012 19:49:35 +0000 (19:49 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 2 May 2012 19:49:35 +0000 (19:49 +0000)
- ArmPlatformNormalInitialize() has been renamed into ArmPlatformInitialize()
- Make the function be called at the early stage of the PEI phase as some
  platforms require their interconnects or clocks to be initialize before any
  access to Timers or UARTs.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13245 6f19259b-4bc3-4df7-8a09-765794883524

15 files changed:
ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLib.inf
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c
ArmPlatformPkg/Include/Library/ArmPlatformLib.h
ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
ArmPlatformPkg/PlatformPei/PlatformPeiLib.c
ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
ArmPlatformPkg/PlatformPei/PlatformPeim.inf
ArmPlatformPkg/PrePeiCore/PrePeiCore.c
ArmPlatformPkg/PrePi/PrePi.c
BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoard.c

index cb92bf00a281fedd0f657f20088f78d80e583356..a5fb26a327afcff4cba0ba5866ec8a80a6205655 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 *  
 *  This program and the accompanying materials                          
 *  are licensed and made available under the terms and conditions of the BSD License         
@@ -13,6 +13,7 @@
 **/
 
 #include <Library/IoLib.h>
+#include <Library/ArmLib.h>
 #include <Library/ArmPlatformLib.h>
 #include <Library/DebugLib.h>
 #include <Library/PcdLib.h>
@@ -68,11 +69,15 @@ ArmPlatformGetBootMode (
   in the PEI phase.
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   )
 {
+  if (!IS_PRIMARY_CORE(MpId)) {
+    return RETURN_SUCCESS;
+  }
+
   // Disable memory remapping and return to normal mapping
   MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
 
@@ -84,6 +89,8 @@ ArmPlatformNormalInitialize (
   MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER2_EN, SP810_SYS_CTRL_TIMER2_TIMCLK);
   // Configure SP810 to use 1MHz clock and disable
   MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK);
+
+  return RETURN_SUCCESS;
 }
 
 /**
index 50dfff96ee5e0f24804f5ea85b9603eb67e194bb..6c45d35d80851258f922620ffd1fda21d7fb0d9a 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2012, 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
@@ -41,3 +41,6 @@
 [FixedPcd]\r
   gArmTokenSpaceGuid.PcdSystemMemoryBase\r
   gArmTokenSpaceGuid.PcdSystemMemorySize\r
+\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
index dcaf7f0c10fff54ac39ec14a18348996f7f66d95..f20db58d6a7b1f7bb868696d8336b1956751e4b5 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file
-#  Copyright (c) 2011, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 #  
 #  This program and the accompanying materials                          
 #  are licensed and made available under the terms and conditions of the BSD License         
@@ -50,3 +50,6 @@
   gArmTokenSpaceGuid.PcdSystemMemorySize
 
   gArmTokenSpaceGuid.PcdL2x0ControllerBase
+
+  gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+  gArmTokenSpaceGuid.PcdArmPrimaryCore
index b314f51b01ac87a6f8f1d4eb3c5b29b54cb4c4b4..b7e7b37000e4b492e11dcc321e2588d4e7d3129d 100644 (file)
@@ -131,11 +131,15 @@ ArmPlatformGetBootMode (
   in the PEI phase.
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   )
 {
+  if (!IS_PRIMARY_CORE(MpId)) {
+    return RETURN_SUCCESS;
+  }
+
   // Configure periodic timer (TIMER0) for 1MHz operation
   MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_TIMCLK);
   // Configure 1MHz clock
@@ -144,6 +148,8 @@ ArmPlatformNormalInitialize (
   MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER2_EN, SP810_SYS_CTRL_TIMER2_TIMCLK);
   // Configure SP810 to use 1MHz clock and disable
   MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK);
+
+  return RETURN_SUCCESS;
 }
 
 /**
index 5e1e4656300208902133358fc948bca39103aad1..e098c75bd066bfda4e34a6cc8b6e23a2abb9bfa1 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2012, 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
@@ -47,3 +47,6 @@
   gArmTokenSpaceGuid.PcdSystemMemoryBase\r
   gArmTokenSpaceGuid.PcdSystemMemorySize\r
   gArmTokenSpaceGuid.PcdFvBaseAddress\r
+\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
index 6cb5501ae7ebb9da1f28a244a82a9260860fafe3..69ffd45fdf772a7fb969d3db068a72f68b9845b4 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 *  
 *  This program and the accompanying materials                          
 *  are licensed and made available under the terms and conditions of the BSD License         
@@ -92,13 +92,19 @@ ArmPlatformGetBootMode (
   in the PEI phase.
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   )
 {
+  if (!IS_PRIMARY_CORE(MpId)) {
+    return RETURN_SUCCESS;
+  }
+
   // Disable memory remapping and return to normal mapping
   MmioOr32 (SP810_CTRL_BASE, BIT8);
+
+  return RETURN_SUCCESS;
 }
 
 /**
index 7dd39fef8c0889e943ab26abdc46e6b26ea01c7d..bb5778f59b08f60b44ba697fa3602fc8c50a64ef 100644 (file)
@@ -115,9 +115,9 @@ ArmPlatformSecExtraAction (
   in the PEI phase.
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   );
 
 /**
index c3d72483a81a342356c1aaffe7d98e58e78a6187..235eb673f7c7af12f4003473e7a15680bc08757d 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 *  
 *  This program and the accompanying materials                          
 *  are licensed and made available under the terms and conditions of the BSD License         
@@ -92,12 +92,18 @@ ArmPlatformGetBootMode (
   in the PEI phase.
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   )
 {
+  if (!IS_PRIMARY_CORE(MpId)) {
+    return RETURN_SUCCESS;
+  }
+
   //TODO: Implement me
+
+  return RETURN_SUCCESS;
 }
 
 /**
index 6038dd852b6e18f4970b5f33dc0db6715cf9cbe7..13c62a60c87e946c0111918acd850638ebae6db0 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2012, 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
@@ -36,3 +36,6 @@
 [FixedPcd]\r
   gArmTokenSpaceGuid.PcdSystemMemoryBase\r
   gArmTokenSpaceGuid.PcdSystemMemorySize\r
+\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
+  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
index 36a51137ec48ed8d9b7ee3945a941dc47bbe76c2..508b10dbd3b17e8f95c078d8e512262d310f7d1a 100755 (executable)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2012, 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
@@ -24,9 +24,6 @@ PlatformPeim (
   VOID\r
   )\r
 {\r
-  // Initialize the platform specific controllers\r
-  ArmPlatformNormalInitialize ();\r
-\r
   BuildFvHob (PcdGet32(PcdFvBaseAddress), PcdGet32(PcdFvSize));\r
 \r
   return EFI_SUCCESS;\r
index 3ea29f47ebcc8705c5b52e58561a9f3cc518c445..01f9359522c57c29139c718debef6c8378a8e0bb 100755 (executable)
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  Copyright (c) 2011, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 #  
 #  This program and the accompanying materials                          
 #  are licensed and made available under the terms and conditions of the BSD License         
index e8d3439217c1fff46552971aa531ae8f12741af0..5fcebf0551c30fe8ac616d3e6b1123581cc2b2ba 100755 (executable)
@@ -1,6 +1,6 @@
 #/** @file\r
 #\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2012, 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
index 3b44e4d5cff0d404139db7608184b207bb910a44..f1300e0e8c96dd33ae482a615b451ee84eb089bd 100644 (file)
@@ -100,6 +100,9 @@ CEntryPoint (
     InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
     SaveAndSetDebugTimerInterrupt (TRUE);\r
 \r
+    // Initialize the platform specific controllers\r
+    ArmPlatformInitialize (MpId);\r
+\r
     // Goto primary Main.\r
     PrimaryMain (PeiCoreEntryPoint);\r
   } else {\r
index b7b64293298e9758e19fe5696632bc62c645fcfc..f3cb3a121f90b657ccc452ab96c1a51dd944be5f 100755 (executable)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2012, 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
@@ -175,6 +175,9 @@ CEntryPoint (
 {\r
   UINT64   StartTimeStamp;\r
  \r
+  // Initialize the platform specific controllers\r
+  ArmPlatformInitialize (MpId);\r
+\r
   if (IS_PRIMARY_CORE(MpId) && PerformanceMeasurementEnabled ()) {\r
     // Initialize the Timer Library to setup the Timer HW controller\r
     TimerConstructor ();\r
index a806848ad5ae889396f7b23caaa3eb84488ada7b..f1235c5dafaba321c81861da02801a141b0e19ac 100755 (executable)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 *  
 *  This program and the accompanying materials                          
 *  are licensed and made available under the terms and conditions of the BSD License         
@@ -110,9 +110,9 @@ ArmPlatformGetBootMode (
   For example, some L2x0 requires to be initialized in Secure World
 
 **/
-VOID
-ArmPlatformNormalInitialize (
-  VOID
+RETURN_STATUS
+ArmPlatformInitialize (
+  IN  UINTN                     MpId
   )
 {
   BEAGLEBOARD_REVISION Revision;
@@ -132,6 +132,8 @@ ArmPlatformNormalInitialize (
   // Clear IRQs
   MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
   ArmDataSyncronizationBarrier ();
+
+  return RETURN_SUCCESS;
 }
 
 /**