]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CpuPei: Remove unused functions from the driver
authorRoy Franz <roy.franz@linaro.org>
Tue, 3 Sep 2013 10:14:02 +0000 (10:14 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 3 Sep 2013 10:14:02 +0000 (10:14 +0000)
The ConfigureMmu() function is unused - the only call to it
is commented out, and the functionality has been moved to
InitMmu() in MemoryInitPeiLib.c.
This change also removes the unused definitions from the file.

Change-Id: Ice795bfee25c403142d0c078533f8a46d04f82e9
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by:: Olivier Martin <olivier.martin@arm.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14621 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/CpuPei/CpuPei.c

index e984f5f1bf020040acd50aaca835b58fa9595102..e070c998c2162540cdc1b3514e94cb4d3a2e4494 100755 (executable)
@@ -43,114 +43,10 @@ Abstract:
 #include <Library/HobLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
-//\r
-// Module globals\r
-//\r
-\r
-#define DDR_ATTRIBUTES_CACHED                ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK\r
-#define DDR_ATTRIBUTES_UNCACHED              ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED\r
-\r
-EFI_STATUS\r
-FindMainMemory (\r
-  OUT UINT32    *PhysicalBase,\r
-  OUT UINT32    *Length\r
-  )\r
-{\r
-  EFI_PEI_HOB_POINTERS      NextHob;\r
-\r
-  // Look at the resource descriptor hobs, choose the first system memory one\r
-  NextHob.Raw = GetHobList ();\r
-  while ((NextHob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, NextHob.Raw)) != NULL) {\r
-    if(NextHob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY)\r
-    {\r
-      *PhysicalBase = (UINT32)NextHob.ResourceDescriptor->PhysicalStart;\r
-      *Length = (UINT32)NextHob.ResourceDescriptor->ResourceLength;\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    NextHob.Raw = GET_NEXT_HOB (NextHob);\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-VOID\r
-ConfigureMmu (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  UINTN                         Idx;\r
-  UINT32                        CacheAttributes;\r
-  UINT32                        SystemMemoryBase;\r
-  UINT32                        SystemMemoryLength;\r
-  UINT32                        SystemMemoryLastAddress;\r
-  ARM_MEMORY_REGION_DESCRIPTOR  MemoryTable[4];\r
-  VOID                          *TranslationTableBase;\r
-  UINTN                         TranslationTableSize;\r
-\r
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {\r
-    CacheAttributes = DDR_ATTRIBUTES_CACHED;\r
-  } else {\r
-    CacheAttributes = DDR_ATTRIBUTES_UNCACHED;\r
-  }\r
-\r
-  Idx = 0;\r
-  \r
-  // Main Memory\r
-  Status = FindMainMemory (&SystemMemoryBase, &SystemMemoryLength);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  SystemMemoryLastAddress = SystemMemoryBase + (SystemMemoryLength-1);\r
-\r
-  // If system memory does not begin at 0\r
-  if(SystemMemoryBase > 0) {\r
-    MemoryTable[Idx].PhysicalBase = 0;\r
-    MemoryTable[Idx].VirtualBase  = 0;\r
-    MemoryTable[Idx].Length       = SystemMemoryBase;\r
-    MemoryTable[Idx].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
-    Idx++;\r
-  }\r
-\r
-  MemoryTable[Idx].PhysicalBase = SystemMemoryBase;\r
-  MemoryTable[Idx].VirtualBase  = SystemMemoryBase;\r
-  MemoryTable[Idx].Length       = SystemMemoryLength;\r
-  MemoryTable[Idx].Attributes   = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes;\r
-  Idx++;\r
-\r
-  // If system memory does not go to the last address (0xFFFFFFFF)\r
-  if( SystemMemoryLastAddress < MAX_ADDRESS ) {\r
-    MemoryTable[Idx].PhysicalBase = SystemMemoryLastAddress + 1;\r
-    MemoryTable[Idx].VirtualBase  = MemoryTable[Idx].PhysicalBase;\r
-    MemoryTable[Idx].Length       = MAX_ADDRESS - MemoryTable[Idx].PhysicalBase + 1;\r
-    MemoryTable[Idx].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;\r
-    Idx++;\r
-  }\r
-\r
-  // End of Table\r
-  MemoryTable[Idx].PhysicalBase = 0;\r
-  MemoryTable[Idx].VirtualBase  = 0;\r
-  MemoryTable[Idx].Length       = 0;\r
-  MemoryTable[Idx].Attributes   = (ARM_MEMORY_REGION_ATTRIBUTES)0;\r
-   \r
-  DEBUG ((EFI_D_INFO, "Enabling MMU, setting 0x%08x + %d MB to %a\n",\r
-    SystemMemoryBase, SystemMemoryLength/1024/1024,\r
-    (CacheAttributes == DDR_ATTRIBUTES_CACHED) ? "cacheable" : "uncacheable"));\r
-\r
-  Status = ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "Error: Failed to enable MMU (error code: %r)\n", Status));\r
-  }\r
-  \r
-  BuildMemoryAllocationHob((EFI_PHYSICAL_ADDRESS)(UINTN)TranslationTableBase, TranslationTableSize, EfiBootServicesData);\r
-}\r
-\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  \r
-\r
 Arguments:\r
 \r
   FileHandle  - Handle of the file being invoked.\r
@@ -179,8 +75,6 @@ InitializeCpuPeim (
   // Publish the CPU memory and io spaces sizes\r
   BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
 \r
-  //ConfigureMmu();\r
-\r
   // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid\r
   Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);\r
   if (!EFI_ERROR(Status)) {\r