]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
ArmPlatformPkg: Replaced 'ArmPlatformTrustzoneSupported' by the fixed Pcd gArmTokenSp...
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibRTSM / RTSMMem.c
index bb0ee84bb22c526999ce408f7fe2e2723bcb5ac5..4537a71456ba762ccb897071e0096dd3c51b2062 100644 (file)
@@ -25,8 +25,6 @@
 // DDR attributes\r
 #define DDR_ATTRIBUTES_CACHED           ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK\r
 #define DDR_ATTRIBUTES_UNCACHED         ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED\r
-#define DDR_ATTRIBUTES_SECURE_CACHED    ARM_MEMORY_REGION_ATTRIBUTE_SECURE_WRITE_BACK\r
-#define DDR_ATTRIBUTES_SECURE_UNCACHED  ARM_MEMORY_REGION_ATTRIBUTE_SECURE_UNCACHED_UNBUFFERED\r
 \r
 /**\r
   Return the Virtual Memory Map of your platform\r
@@ -44,7 +42,6 @@ ArmPlatformGetVirtualMemoryMap (
   )\r
 {\r
   ARM_MEMORY_REGION_ATTRIBUTES  CacheAttributes;\r
-  BOOLEAN                       bTrustzoneSupport;\r
   UINTN                         Index = 0;\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
 \r
@@ -55,18 +52,10 @@ ArmPlatformGetVirtualMemoryMap (
       return;\r
   }\r
 \r
-  // Check if SMC TZASC is enabled. If Trustzone not enabled then all the entries remain in Secure World.\r
-  // As this value can be changed in the Board Configuration file, the UEFI firmware needs to work for both case\r
-  if (ArmPlatformTrustzoneSupported ()) {\r
-    bTrustzoneSupport = TRUE;\r
-  } else {\r
-      bTrustzoneSupport = FALSE;\r
-  }\r
-\r
   if (FeaturePcdGet(PcdCacheEnable) == TRUE) {\r
-      CacheAttributes = (bTrustzoneSupport ? DDR_ATTRIBUTES_CACHED : DDR_ATTRIBUTES_SECURE_CACHED);\r
+      CacheAttributes = DDR_ATTRIBUTES_CACHED;\r
   } else {\r
-      CacheAttributes = (bTrustzoneSupport ? DDR_ATTRIBUTES_UNCACHED : DDR_ATTRIBUTES_SECURE_UNCACHED);\r
+      CacheAttributes = DDR_ATTRIBUTES_UNCACHED;\r
   }\r
 \r
   // ReMap (Either NOR Flash or DRAM)\r
@@ -74,12 +63,12 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_REMAP_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_VE_REMAP_SZ;\r
 \r
-  if (FeaturePcdGet(PcdNorFlashRemapping)) {\r
+  if (FeaturePcdGet(PcdNorFlashRemapping) == FALSE) {\r
     // Map the NOR Flash as Secure Memory\r
     if (FeaturePcdGet(PcdCacheEnable) == TRUE) {\r
-      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_SECURE_CACHED;\r
+      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_CACHED;\r
     } else {\r
-      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_SECURE_UNCACHED;\r
+      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_UNCACHED;\r
     }\r
   } else {\r
     // DRAM mapping\r
@@ -96,13 +85,13 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_VE_ON_CHIP_PERIPH_SZ;\r
-  VirtualMemoryTable[Index].Attributes   = (bTrustzoneSupport ? ARM_MEMORY_REGION_ATTRIBUTE_DEVICE : ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE);\r
+  VirtualMemoryTable[Index].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE;\r
 \r
   // SMB CS0-CS1 - NOR Flash 1 & 2\r
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_NOR0_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_SMB_NOR0_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_VE_SMB_NOR0_SZ + ARM_VE_SMB_NOR1_SZ;\r
-  VirtualMemoryTable[Index].Attributes   = (bTrustzoneSupport ? ARM_MEMORY_REGION_ATTRIBUTE_DEVICE : ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE);\r
+  VirtualMemoryTable[Index].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE;\r
 \r
   // SMB CS2 - SRAM\r
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_SRAM_BASE;\r
@@ -114,7 +103,7 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = 2 * ARM_VE_SMB_PERIPH_SZ;\r
-  VirtualMemoryTable[Index].Attributes   = (bTrustzoneSupport ? ARM_MEMORY_REGION_ATTRIBUTE_DEVICE : ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE);
+  VirtualMemoryTable[Index].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE;
 \r
 //TODO:This should be enabled for final release. Right now, ARM VE RTSM crashes.\r
 //  // If a Logic Tile is connected to The ARM Versatile Express Motherboard\r
@@ -122,7 +111,7 @@ ArmPlatformGetVirtualMemoryMap (
 //      VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_EXT_AXI_BASE;\r
 //      VirtualMemoryTable[Index].VirtualBase  = ARM_VE_EXT_AXI_BASE;\r
 //      VirtualMemoryTable[Index].Length       = ARM_VE_EXT_AXI_SZ;\r
-//      VirtualMemoryTable[Index].Attributes   = (bTrustzoneSupport ? ARM_MEMORY_REGION_ATTRIBUTE_DEVICE : ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE);\r
+//      VirtualMemoryTable[Index].Attributes   = ARM_MEMORY_REGION_ATTRIBUTE_SECURE_DEVICE;\r
 //\r
 //      ASSERT((Index + 1) == (MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS + 1));\r
 //  } else {\r