]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Remove ArmPlatformBootRemapping() function from the ArmPlatformLib
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Nov 2011 23:36:59 +0000 (23:36 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 1 Nov 2011 23:36:59 +0000 (23:36 +0000)
Memory map remapping is a platform specific feature only enabled by some platforms.
Instead of keeping this function empty for most platforms, the function has been
removed. This feature can easily fit in any other ArmPlatformLib function.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12632 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c
ArmPlatformPkg/Include/Library/ArmPlatformLib.h
ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
ArmPlatformPkg/Sec/Sec.c

index ba90e191199ec8a5318ba305730df1bce0086a08..cb92bf00a281fedd0f657f20088f78d80e583356 100644 (file)
@@ -47,22 +47,6 @@ ARM_CORE_INFO mRealViewEbMpCoreInfoTable[] = {
   }
 };
 
-/**
-  Remap the memory at 0x0
-
-  Some platform requires or gives the ability to remap the memory at the address 0x0.
-  This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID
-ArmPlatformBootRemapping (
-  VOID
-  )
-{
-  // Disable memory remapping and return to normal mapping
-  MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
-}
-
 /**
   Return the current Boot Mode
 
@@ -89,6 +73,9 @@ ArmPlatformNormalInitialize (
   VOID
   )
 {
+  // Disable memory remapping and return to normal mapping
+  MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
+
   // Configure periodic timer (TIMER0) for 1MHz operation
   MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_TIMCLK);
   // Configure 1MHz clock
index 67731ad4b49382d7d63e5f77068702d95645dcdf..f88779600518b021beb504daf239938bd4434ae1 100644 (file)
@@ -125,29 +125,6 @@ ArmPlatformGetBootMode (
   }
 }
 
-/**
-  Remap the memory at 0x0
-
-  Some platform requires or gives the ability to remap the memory at the address 0x0.
-  This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID
-ArmPlatformBootRemapping (
-  VOID
-  )
-{
-  UINT32 Value;
-
-  if (FeaturePcdGet(PcdNorFlashRemapping)) {
-    SerialPrint ("Secure ROM at 0x0\n\r");
-  } else {
-    Value = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1
-    // Remap the DRAM to 0x0
-    MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM);
-  }
-}
-
 /**
   Initialize controllers that must setup in the normal world
 
@@ -181,6 +158,17 @@ ArmPlatformInitializeSystemMemory (
   VOID
   )
 {
+  UINT32 Value;
+
+  // Memory Map remapping
+  if (FeaturePcdGet(PcdNorFlashRemapping)) {
+    SerialPrint ("Secure ROM at 0x0\n\r");
+  } else {
+    Value = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1
+    // Remap the DRAM to 0x0
+    MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (Value & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM);
+  }
+
   PL341DmcInit(ARM_VE_DMC_BASE, &DDRTimings);
   PL301AxiInit(ARM_VE_FAXI_BASE);
 }
index a8674acf7ce5d04977c71b6c39d67ec578a3370c..8aeedda92963aec63a2b975786cf597b3917dd96 100644 (file)
@@ -87,22 +87,6 @@ ArmPlatformGetBootMode (
   return BOOT_WITH_FULL_CONFIGURATION;
 }
 
-/**
-  Remap the memory at 0x0
-
-  Some platform requires or gives the ability to remap the memory at the address 0x0.
-  This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID
-ArmPlatformBootRemapping (
-  VOID
-  )
-{
-  // Disable memory remapping and return to normal mapping
-  MmioOr32 (SP810_CTRL_BASE, BIT8);
-}
-
 /**
   Initialize controllers that must setup in the normal world
 
@@ -115,7 +99,8 @@ ArmPlatformNormalInitialize (
   VOID
   )
 {
-  // Nothing to do here
+  // Disable memory remapping and return to normal mapping
+  MmioOr32 (SP810_CTRL_BASE, BIT8);
 }
 
 /**
index 4362760c7349ba6fc7f07beb485b5f8b2efa5a8d..44a9884b88d1910e331fb1a51b13c89c700f9a23 100644 (file)
@@ -131,18 +131,6 @@ ArmPlatformInitializeSystemMemory (
   VOID
   );
 
-/**
-  Remap the memory at 0x0
-
-  Some platform requires or gives the ability to remap the memory at the address 0x0.
-  This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID
-ArmPlatformBootRemapping (
-  VOID
-  );
-
 /**
   Initialize the Secure peripherals and memory regions
 
index 3467016e4af7d500e4b997b1d48af7731594bbd3..c3d72483a81a342356c1aaffe7d98e58e78a6187 100644 (file)
@@ -71,21 +71,6 @@ TimerConstructor (
   return EFI_SUCCESS;
 }
 
-/**
-  Remap the memory at 0x0
-
-  Some platform requires or gives the ability to remap the memory at the address 0x0.
-  This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID
-ArmPlatformBootRemapping (
-  VOID
-  )
-{
-  // Disable memory remapping and return to normal mapping
-}
-
 /**
   Return the current Boot Mode
 
index 241ad7cb16ff23451657a825318bab9e2d6ed8a6..a40f43683a7d9f22bf83a7097add2cac92c25e6d 100644 (file)
@@ -17,7 +17,6 @@
 #include <Library/PrintLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/SerialPortLib.h>
-#include <Library/ArmPlatformLib.h>
 #include <Library/ArmGicLib.h>
 #include <Library/ArmCpuLib.h>
 
@@ -97,9 +96,6 @@ CEntryPoint (
       // Initialize system memory (DRAM)
       ArmPlatformInitializeSystemMemory ();
     }
-
-    // Some platform can change their physical memory mapping
-    ArmPlatformBootRemapping ();
   }
 
   // Test if Trustzone is supported on this platform