]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Replaced 'ArmPlatformTrustzoneSupported' by the fixed Pcd gArmTokenSp...
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Sep 2011 16:29:07 +0000 (16:29 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Sep 2011 16:29:07 +0000 (16:29 +0000)
This change does not make possible to disable Trustzone from the firmware.
The firmware has to be built for Trustzone support enabled or disabled.

The memory page table are now defined as 'Normal Memory' in any case.
Except for RTSM Device Memory which as to be Secure Device Memory due
to a RTSM bug.

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

12 files changed:
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Sec.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSM.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
ArmPlatformPkg/Include/Library/ArmPlatformLib.h
ArmPlatformPkg/Sec/Sec.c
ArmPlatformPkg/Sec/Sec.inf

index bc14660e361f2f0c5810b3f91efb82550f723aba..710e2151988f8d6db485a1f986b7e189b74ec6bc 100644 (file)
@@ -68,6 +68,8 @@
   gArmTokenSpaceGuid.PcdEfiUncachedMemoryToStronglyOrdered|FALSE|BOOLEAN|0x00000025\r
 \r
 [PcdsFixedAtBuild.common]\r
+  gArmTokenSpaceGuid.PcdTrustzoneSupport|FALSE|BOOLEAN|0x00000006\r
+\r
   # This PCD should be a FeaturePcd. But we used this PCD as an '#if' in an ASM file.\r
   # Using a FeaturePcd make a '(BOOLEAN) casting for its value which is not understood by the preprocessor.\r
   gArmTokenSpaceGuid.PcdVFPEnabled|0|UINT32|0x00000024\r
index 41c545bff68b5121d5d3488dcba20a26847dcaa2..ba90e191199ec8a5318ba305730df1bce0086a08 100644 (file)
@@ -47,26 +47,6 @@ ARM_CORE_INFO mRealViewEbMpCoreInfoTable[] = {
   }
 };
 
-/**
-  Return if Trustzone is supported by your platform
-
-  A non-zero value must be returned if you want to support a Secure World on your platform.
-  ArmPlatformTrustzoneInit() will later set up the secure regions.
-  This function can return 0 even if Trustzone is supported by your processor. In this case,
-  the platform will continue to run in Secure World.
-
-  @return   A non-zero value if Trustzone supported.
-
-**/
-UINTN
-ArmPlatformTrustzoneSupported (
-  VOID
-  )
-{
-  // There is no Trustzone controllers (TZPC & TZASC) and no Secure Memory on RTSM
-  return FALSE;
-}
-
 /**
   Remap the memory at 0x0
 
index 5ca9510a7f3cb8c82bd94a80f7afe426cfda2cc5..66b149c8e4c3000142ee84d175ebf7099f50a0ee 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,21 +42,20 @@ ArmPlatformGetVirtualMemoryMap (
   )\r
 {\r
   UINT32                        CacheAttributes;\r
-  BOOLEAN                       bTrustzoneSupport = FALSE;\r
   UINTN                         Index = 0;\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
 \r
   ASSERT(VirtualMemoryMap != NULL);\r
 \r
-  VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages(EFI_SIZE_TO_PAGES (sizeof(ARM_MEMORY_REGION_DESCRIPTOR) * MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS));\r
+  VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages (EFI_SIZE_TO_PAGES (sizeof(ARM_MEMORY_REGION_DESCRIPTOR) * MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS));\r
   if (VirtualMemoryTable == NULL) {\r
       return;\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
@@ -77,13 +74,13 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_EB_SMB_MB_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_EB_SMB_MB_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_EB_SMB_MB_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_EB_SMB_NOR_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_EB_SMB_NOR_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_EB_SMB_NOR_SZ + ARM_EB_SMB_DOC_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_EB_SMB_SRAM_BASE;\r
@@ -95,14 +92,14 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_EB_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_EB_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_EB_SMB_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
   // If a Logic Tile is connected to The ARM Versatile Express Motherboard\r
   if (MmioRead32(ARM_EB_SYS_PROCID1_REG) != 0) {\r
       VirtualMemoryTable[++Index].PhysicalBase = ARM_EB_LOGIC_TILE_BASE;\r
       VirtualMemoryTable[Index].VirtualBase  = ARM_EB_LOGIC_TILE_BASE;\r
       VirtualMemoryTable[Index].Length       = ARM_EB_LOGIC_TILE_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
index 6d6dd3899968138863abaccdc83e5af9a19079d0..9d9c237c294ac9a02263e9d487079bb63e73da0d 100644 (file)
@@ -49,4 +49,6 @@
   gArmPlatformTokenSpaceGuid.PcdNorFlashRemapping\r
 \r
 [FixedPcd]\r
+  gArmTokenSpaceGuid.PcdTrustzoneSupport\r
+\r
   gArmTokenSpaceGuid.PcdL2x0ControllerBase\r
index 2b6238bc76d45372ba3f7717e3a8b9b6c4c353f4..67731ad4b49382d7d63e5f77068702d95645dcdf 100644 (file)
@@ -105,25 +105,6 @@ PL341_DMC_CONFIG DDRTimings = {
   .ExtModeReg = DDR_EMR_RTT_50R | (DDR_EMR_ODS_VAL << DDR_EMR_ODS_MASK),
 };
 
-/**
-  Return if Trustzone is supported by your platform
-
-  A non-zero value must be returned if you want to support a Secure World on your platform.
-  ArmVExpressTrustzoneInit() will later set up the secure regions.
-  This function can return 0 even if Trustzone is supported by your processor. In this case,
-  the platform will continue to run in Secure World.
-
-  @return   A non-zero value if Trustzone supported.
-
-**/
-UINTN
-ArmPlatformTrustzoneSupported (
-  VOID
-  )
-{
-  return (MmioRead32(ARM_VE_SYS_CFGRW1_REG) & ARM_VE_CFGRW1_TZASC_EN_BIT_MASK);
-}
-
 /**
   Return the current Boot Mode
 
@@ -137,7 +118,11 @@ ArmPlatformGetBootMode (
   VOID
   )
 {
-  return BOOT_WITH_FULL_CONFIGURATION;
+  if (MmioRead32(ARM_VE_SYS_FLAGS_NV_REG) == 0) {
+    return BOOT_WITH_FULL_CONFIGURATION;
+  } else {
+    return BOOT_ON_S2_RESUME;
+  }
 }
 
 /**
index 7bfd679411d01c3bf9fba5dfe9631108d30a6e47..ef8fa4191a565dc6203649e8750f60fba5d1d355 100644 (file)
@@ -26,8 +26,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
@@ -45,7 +43,6 @@ ArmPlatformGetVirtualMemoryMap (
   )\r
 {\r
   ARM_MEMORY_REGION_ATTRIBUTES  CacheAttributes;\r
-  BOOLEAN                       bTrustzoneSupport;\r
   UINTN                         Index = 0;\r
   ARM_MEMORY_REGION_DESCRIPTOR  *VirtualMemoryTable;\r
 \r
@@ -56,34 +53,17 @@ 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
-  VirtualMemoryTable[Index].PhysicalBase = ARM_VE_REMAP_BASE;\r
-  VirtualMemoryTable[Index].VirtualBase  = ARM_VE_REMAP_BASE;\r
-  VirtualMemoryTable[Index].Length       = ARM_VE_REMAP_SZ;\r
-\r
-  if (FeaturePcdGet(PcdNorFlashRemapping)) {\r
-    // Map the NOR Flash as Secure Memory\r
-    if (FeaturePcdGet(PcdCacheEnable) == TRUE) {\r
-      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_SECURE_CACHED;\r
-    } else {\r
-      VirtualMemoryTable[Index].Attributes   = DDR_ATTRIBUTES_SECURE_UNCACHED;\r
-    }\r
-  } else {\r
-    // DRAM mapping\r
+  if (FeaturePcdGet(PcdNorFlashRemapping) == FALSE) {\r
+    // ReMap (Either NOR Flash or DRAM)\r
+    VirtualMemoryTable[Index].PhysicalBase = ARM_VE_REMAP_BASE;\r
+    VirtualMemoryTable[Index].VirtualBase  = ARM_VE_REMAP_BASE;\r
+    VirtualMemoryTable[Index].Length       = ARM_VE_REMAP_SZ;\r
     VirtualMemoryTable[Index].Attributes   = CacheAttributes;\r
   }\r
 \r
@@ -97,13 +77,13 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_MB_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_SMB_MB_ON_CHIP_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_VE_SMB_MB_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_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_DEVICE;\r
 \r
   // SMB CS2 - SRAM\r
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_SRAM_BASE;\r
@@ -115,14 +95,14 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[++Index].PhysicalBase = ARM_VE_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].VirtualBase  = ARM_VE_SMB_PERIPH_BASE;\r
   VirtualMemoryTable[Index].Length       = ARM_VE_SMB_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_DEVICE;\r
 \r
   // If a Logic Tile is connected to The ARM Versatile Express Motherboard\r
   if (MmioRead32(ARM_VE_SYS_PROCID1_REG) != 0) {\r
       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_DEVICE;\r
 \r
       ASSERT((Index + 1) == (MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS + 1));\r
   } else {\r
index 46ca8eaac487ad5896fbad9fbeaf66d79b364aba..3641017e9c1a084086a26f9c3f17f9a29fb6aab3 100644 (file)
@@ -39,6 +39,12 @@ ArmPlatformTrustzoneInit (
   // Setup TZ Protection Controller
   //
 
+  if (MmioRead32(ARM_VE_SYS_CFGRW1_REG) & ARM_VE_CFGRW1_TZASC_EN_BIT_MASK) {
+    ASSERT (PcdGetBool (PcdTrustzoneSupport) == TRUE);
+  } else {
+    ASSERT (PcdGetBool (PcdTrustzoneSupport) == FALSE);
+  }
+
   // Set Non Secure access for all devices
   TZPCSetDecProtBits(ARM_VE_TZPC_BASE, TZPC_DECPROT_0, 0xFFFFFFFF);
   TZPCSetDecProtBits(ARM_VE_TZPC_BASE, TZPC_DECPROT_1, 0xFFFFFFFF);
index 54b2388c27d61eeb025852e151dbe456d3d7291b..5741915b69c3c114b8b165885e623e468ef4b7bc 100644 (file)
 
 #include <ArmPlatform.h>
 
+UINTN
+ArmGetCpuCountPerCluster (
+  VOID
+  );
+
 ARM_CORE_INFO mVersatileExpressMpCoreInfoTable[] = {
   {
     // Cluster 0, Core 0
@@ -66,26 +71,6 @@ ARM_CORE_INFO mVersatileExpressMpCoreInfoTable[] = {
   }
 };
 
-/**
-  Return if Trustzone is supported by your platform
-
-  A non-zero value must be returned if you want to support a Secure World on your platform.
-  ArmVExpressTrustzoneInit() will later set up the secure regions.
-  This function can return 0 even if Trustzone is supported by your processor. In this case,
-  the platform will continue to run in Secure World.
-
-  @return   A non-zero value if Trustzone supported.
-
-**/
-UINTN
-ArmPlatformTrustzoneSupported (
-  VOID
-  )
-{
-  // Not supported yet but model does have Secure SRAM (but no TZPC/TZASC) so we could support it
-  return FALSE;
-}
-
 /**
   Return the current Boot Mode
 
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
index 864c2c7c921b207caf52807786cd84576b35c6a9..4362760c7349ba6fc7f07beb485b5f8b2efa5a8d 100644 (file)
@@ -143,22 +143,6 @@ ArmPlatformBootRemapping (
   VOID
   );
 
-/**
-  Return if Trustzone is supported by your platform
-
-  A non-zero value must be returned if you want to support a Secure World on your platform.
-  ArmPlatformTrustzoneInit() will later set up the secure regions.
-  This function can return 0 even if Trustzone is supported by your processor. In this case,
-  the platform will continue to run in Secure World.
-
-  @return   A non-zero value if Trustzone supported.
-
-**/
-UINTN
-ArmPlatformTrustzoneSupported (
-  VOID
-  );
-
 /**
   Initialize the Secure peripherals and memory regions
 
index 5853dfba3e974950ef6256c0d14ca79317f12a47..241ad7cb16ff23451657a825318bab9e2d6ed8a6 100644 (file)
@@ -103,7 +103,7 @@ CEntryPoint (
   }
 
   // Test if Trustzone is supported on this platform
-  if (ArmPlatformTrustzoneSupported ()) {
+  if (FixedPcdGetBool (PcdTrustzoneSupport)) {
     // Ensure the Monitor Stack Base & Size have been set
     ASSERT(PcdGet32(PcdCPUCoresSecMonStackBase) != 0);
     ASSERT(PcdGet32(PcdCPUCoreSecMonStackSize) != 0);
index 5079f29da553c12b2f03847643a37637618692ad..9980c6b951ed51ab0ca396caf69803d2480b986f 100644 (file)
@@ -51,6 +51,7 @@
   gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec\r
   \r
 [FixedPcd]\r
+  gArmTokenSpaceGuid.PcdTrustzoneSupport\r
   gArmTokenSpaceGuid.PcdVFPEnabled\r
   \r
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r