ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
ArmPkg/Library/ArmLib/Null/NullArmLib.inf
- ArmPkg/Library/ArmTrustZoneLib/ArmTrustZoneLib.inf
ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf
ArmPkg/Library/BaseMemoryLibVstm/BaseMemoryLibVstm.inf
ArmPkg/Library/BasePeCoffLib/BasePeCoffLib.inf
+++ /dev/null
-/** @file\r
-*\r
-* Copyright (c) 2011, 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
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
-*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-*\r
-**/\r
-\r
-#ifndef __ARM_TRUSTZONE_LIB_H__\r
-#define __ARM_TRUSTZONE_LIB_H__\r
-\r
-#include <Uefi.h>\r
-\r
-// Setup TZ Protection Controller\r
-#define TZPC_DECPROT_0 0\r
-#define TZPC_DECPROT_1 1\r
-#define TZPC_DECPROT_2 2\r
-#define TZPC_DECPROT_MAX 2\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZPCSetDecProtBits (\r
- IN UINTN TzpcBase,\r
- IN UINTN TzpcId,\r
- IN UINTN Bits\r
- );\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZPCClearDecProtBits (\r
- IN UINTN TzpcBase,\r
- IN UINTN TzpcId,\r
- IN UINTN Bits\r
- );\r
-\r
-// Setup TZ Address Space Controller\r
-#define TZASC_REGION_ENABLED 1\r
-#define TZASC_REGION_DISABLED 0\r
-#define TZASC_REGION_SIZE_32KB 0xE\r
-#define TZASC_REGION_SIZE_64KB 0xF\r
-#define TZASC_REGION_SIZE_128KB 0x10\r
-#define TZASC_REGION_SIZE_256KB 0x11\r
-#define TZASC_REGION_SIZE_512KB 0x12\r
-#define TZASC_REGION_SIZE_1MB 0x13\r
-#define TZASC_REGION_SIZE_2MB 0x14\r
-#define TZASC_REGION_SIZE_4MB 0x15\r
-#define TZASC_REGION_SIZE_8MB 0x16\r
-#define TZASC_REGION_SIZE_16MB 0x17\r
-#define TZASC_REGION_SIZE_32MB 0x18\r
-#define TZASC_REGION_SIZE_64MB 0x19\r
-#define TZASC_REGION_SIZE_128MB 0x1A\r
-#define TZASC_REGION_SIZE_256MB 0x1B\r
-#define TZASC_REGION_SIZE_512MB 0x1C\r
-#define TZASC_REGION_SIZE_1GB 0x1D\r
-#define TZASC_REGION_SIZE_2GB 0x1E\r
-#define TZASC_REGION_SIZE_4GB 0x1F\r
-#define TZASC_REGION_SECURITY_SR (1 << 3)\r
-#define TZASC_REGION_SECURITY_SW (1 << 2)\r
-#define TZASC_REGION_SECURITY_SRW (TZASC_REGION_SECURITY_SR|TZASC_REGION_SECURITY_SW)\r
-#define TZASC_REGION_SECURITY_NSR (1 << 1)\r
-#define TZASC_REGION_SECURITY_NSW 1\r
-#define TZASC_REGION_SECURITY_NSRW (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW)\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZASCSetRegion (\r
- IN INTN TzascBase,\r
- IN UINTN RegionId,\r
- IN UINTN Enabled,\r
- IN UINTN LowAddress,\r
- IN UINTN HighAddress,\r
- IN UINTN Size,\r
- IN UINTN Security\r
- );\r
-\r
-#endif\r
+++ /dev/null
-/** @file\r
-*\r
-* Copyright (c) 2011, 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
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
-*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-*\r
-**/\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/ArmTrustZoneLib.h>\r
-\r
-#define TZPC_DECPROT0_STATUS_REG 0x800\r
-#define TZPC_DECPROT0_SET_REG 0x804\r
-#define TZPC_DECPROT0_CLEAR_REG 0x808\r
-\r
-#define TZASC_CONFIGURATION_REG 0x000\r
-#define TZASC_REGIONS_REG 0x100\r
-#define TZASC_REGION0_LOW_ADDRESS_REG 0x100\r
-#define TZASC_REGION0_HIGH_ADDRESS_REG 0x104\r
-#define TZASC_REGION0_ATTRIBUTES 0x108\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZPCSetDecProtBits (\r
- IN UINTN TzpcBase,\r
- IN UINTN TzpcId,\r
- IN UINTN Bits\r
- )\r
-{\r
- if (TzpcId > TZPC_DECPROT_MAX) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
- MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_SET_REG + (TzpcId * 0x0C), Bits);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZPCClearDecProtBits (\r
- IN UINTN TzpcBase,\r
- IN UINTN TzpcId,\r
- IN UINTN Bits\r
- )\r
-{\r
- if (TzpcId> TZPC_DECPROT_MAX) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
- MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_CLEAR_REG + (TzpcId * 0x0C), Bits);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-UINT32\r
-TZASCGetNumRegions (\r
- IN UINTN TzascBase\r
- )\r
-{\r
- return (MmioRead32 ((UINTN)TzascBase + TZASC_CONFIGURATION_REG) & 0xF);\r
-}\r
-\r
-/**\r
- FIXME: Need documentation\r
-**/\r
-EFI_STATUS\r
-TZASCSetRegion (\r
- IN INTN TzascBase,\r
- IN UINTN RegionId,\r
- IN UINTN Enabled,\r
- IN UINTN LowAddress,\r
- IN UINTN HighAddress,\r
- IN UINTN Size,\r
- IN UINTN Security\r
- )\r
-{\r
- UINT32* Region;\r
-\r
- if (RegionId > TZASCGetNumRegions(TzascBase)) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
- Region = (UINT32*)((UINTN)TzascBase + TZASC_REGIONS_REG + (RegionId * 0x10));\r
-\r
- MmioWrite32((UINTN)(Region), LowAddress&0xFFFF8000);\r
- MmioWrite32((UINTN)(Region+1), HighAddress);\r
- MmioWrite32((UINTN)(Region+2), ((Security & 0xF) <<28) | ((Size & 0x3F) << 1) | (Enabled & 0x1));\r
-\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-#/* @file\r
-# Copyright (c) 2011, 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
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-#\r
-#*/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = ArmTrustZoneLib\r
- FILE_GUID = 5962d040-8b8a-11df-9a71-0002a5d5c51b\r
- MODULE_TYPE = BASE\r
- VERSION_STRING = 1.0\r
- LIBRARY_CLASS = ArmTrustZoneLib\r
-\r
-\r
-[Sources.common]\r
- ArmTrustZone.c\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- ArmPkg/ArmPkg.dec\r
-\r
-[LibraryClasses]\r
- BaseLib\r
- IoLib\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf\r
- ArmTrustZoneLib|ArmPkg/Library/ArmTrustZoneLib/ArmTrustZoneLib.inf\r
+ ArmTrustZoneLib|ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf\r
\r
# ARM PL310 L2 Cache Driver\r
L2X0CacheLib|ArmPlatformPkg/Drivers/PL310L2Cache/PL310L2CacheSec.inf\r
/** @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
**/
#include <Library/ArmPlatformLib.h>
-#include <Library/ArmTrustZoneLib.h>
#include <Library/ArmPlatformSysConfigLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PcdLib.h>
+#include <Drivers/ArmTrustzone.h>
#include <Drivers/PL310L2Cache.h>
#include <ArmPlatform.h>
--- /dev/null
+/** @file\r
+*\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
+* which accompanies this distribution. The full text of the license may be found at \r
+* http://opensource.org/licenses/bsd-license.php \r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+*\r
+**/\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/IoLib.h>\r
+\r
+#include <Drivers/ArmTrustzone.h>\r
+\r
+#define TZPC_DECPROT0_STATUS_REG 0x800\r
+#define TZPC_DECPROT0_SET_REG 0x804\r
+#define TZPC_DECPROT0_CLEAR_REG 0x808\r
+\r
+#define TZASC_CONFIGURATION_REG 0x000\r
+#define TZASC_REGIONS_REG 0x100\r
+#define TZASC_REGION0_LOW_ADDRESS_REG 0x100\r
+#define TZASC_REGION0_HIGH_ADDRESS_REG 0x104\r
+#define TZASC_REGION0_ATTRIBUTES 0x108\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZPCSetDecProtBits (\r
+ IN UINTN TzpcBase,\r
+ IN UINTN TzpcId,\r
+ IN UINTN Bits\r
+ )\r
+{\r
+ if (TzpcId > TZPC_DECPROT_MAX) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_SET_REG + (TzpcId * 0x0C), Bits);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZPCClearDecProtBits (\r
+ IN UINTN TzpcBase,\r
+ IN UINTN TzpcId,\r
+ IN UINTN Bits\r
+ )\r
+{\r
+ if (TzpcId> TZPC_DECPROT_MAX) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_CLEAR_REG + (TzpcId * 0x0C), Bits);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+UINT32\r
+TZASCGetNumRegions (\r
+ IN UINTN TzascBase\r
+ )\r
+{\r
+ return (MmioRead32 ((UINTN)TzascBase + TZASC_CONFIGURATION_REG) & 0xF);\r
+}\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZASCSetRegion (\r
+ IN INTN TzascBase,\r
+ IN UINTN RegionId,\r
+ IN UINTN Enabled,\r
+ IN UINTN LowAddress,\r
+ IN UINTN HighAddress,\r
+ IN UINTN Size,\r
+ IN UINTN Security\r
+ )\r
+{\r
+ UINT32* Region;\r
+\r
+ if (RegionId > TZASCGetNumRegions(TzascBase)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ Region = (UINT32*)((UINTN)TzascBase + TZASC_REGIONS_REG + (RegionId * 0x10));\r
+\r
+ MmioWrite32((UINTN)(Region), LowAddress&0xFFFF8000);\r
+ MmioWrite32((UINTN)(Region+1), HighAddress);\r
+ MmioWrite32((UINTN)(Region+2), ((Security & 0xF) <<28) | ((Size & 0x3F) << 1) | (Enabled & 0x1));\r
+\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+#/* @file\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
+# which accompanies this distribution. The full text of the license may be found at \r
+# http://opensource.org/licenses/bsd-license.php \r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+#\r
+#*/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = ArmTrustZoneLib\r
+ FILE_GUID = 5962d040-8b8a-11df-9a71-0002a5d5c51b\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = ArmTrustZoneLib\r
+\r
+\r
+[Sources.common]\r
+ ArmTrustZone.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ ArmPkg/ArmPkg.dec\r
+ ArmPlatformPkg/ArmPlatformPkg.dec\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+ IoLib\r
--- /dev/null
+/** @file\r
+*\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
+* which accompanies this distribution. The full text of the license may be found at \r
+* http://opensource.org/licenses/bsd-license.php \r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+*\r
+**/\r
+\r
+#ifndef __ARM_TRUSTZONE_H__\r
+#define __ARM_TRUSTZONE_H__\r
+\r
+#include <Uefi.h>\r
+\r
+// Setup TZ Protection Controller\r
+#define TZPC_DECPROT_0 0\r
+#define TZPC_DECPROT_1 1\r
+#define TZPC_DECPROT_2 2\r
+#define TZPC_DECPROT_MAX 2\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZPCSetDecProtBits (\r
+ IN UINTN TzpcBase,\r
+ IN UINTN TzpcId,\r
+ IN UINTN Bits\r
+ );\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZPCClearDecProtBits (\r
+ IN UINTN TzpcBase,\r
+ IN UINTN TzpcId,\r
+ IN UINTN Bits\r
+ );\r
+\r
+// Setup TZ Address Space Controller\r
+#define TZASC_REGION_ENABLED 1\r
+#define TZASC_REGION_DISABLED 0\r
+#define TZASC_REGION_SIZE_32KB 0xE\r
+#define TZASC_REGION_SIZE_64KB 0xF\r
+#define TZASC_REGION_SIZE_128KB 0x10\r
+#define TZASC_REGION_SIZE_256KB 0x11\r
+#define TZASC_REGION_SIZE_512KB 0x12\r
+#define TZASC_REGION_SIZE_1MB 0x13\r
+#define TZASC_REGION_SIZE_2MB 0x14\r
+#define TZASC_REGION_SIZE_4MB 0x15\r
+#define TZASC_REGION_SIZE_8MB 0x16\r
+#define TZASC_REGION_SIZE_16MB 0x17\r
+#define TZASC_REGION_SIZE_32MB 0x18\r
+#define TZASC_REGION_SIZE_64MB 0x19\r
+#define TZASC_REGION_SIZE_128MB 0x1A\r
+#define TZASC_REGION_SIZE_256MB 0x1B\r
+#define TZASC_REGION_SIZE_512MB 0x1C\r
+#define TZASC_REGION_SIZE_1GB 0x1D\r
+#define TZASC_REGION_SIZE_2GB 0x1E\r
+#define TZASC_REGION_SIZE_4GB 0x1F\r
+#define TZASC_REGION_SECURITY_SR (1 << 3)\r
+#define TZASC_REGION_SECURITY_SW (1 << 2)\r
+#define TZASC_REGION_SECURITY_SRW (TZASC_REGION_SECURITY_SR|TZASC_REGION_SECURITY_SW)\r
+#define TZASC_REGION_SECURITY_NSR (1 << 1)\r
+#define TZASC_REGION_SECURITY_NSW 1\r
+#define TZASC_REGION_SECURITY_NSRW (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW)\r
+\r
+/**\r
+ FIXME: Need documentation\r
+**/\r
+EFI_STATUS\r
+TZASCSetRegion (\r
+ IN INTN TzascBase,\r
+ IN UINTN RegionId,\r
+ IN UINTN Enabled,\r
+ IN UINTN LowAddress,\r
+ IN UINTN HighAddress,\r
+ IN UINTN Size,\r
+ IN UINTN Security\r
+ );\r
+\r
+#endif\r