summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Include
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.linux@gmail.com>2017-01-20 17:10:45 +0530
committerLeif Lindholm <leif.lindholm@linaro.org>2017-01-26 14:31:37 +0000
commit465663e9f128428323e6c6e4431dd15ac287a24c (patch)
tree6c3d31fd6232a6f7be01d56dfce400fb37982ee4 /ArmPlatformPkg/Include
parentc1b0828b3ba8fa203033ede0c3329c0d5573719e (diff)
downloadedk2-465663e9f128428323e6c6e4431dd15ac287a24c.tar.gz
edk2-465663e9f128428323e6c6e4431dd15ac287a24c.tar.bz2
edk2-465663e9f128428323e6c6e4431dd15ac287a24c.zip
ArmPlatformPkg/TZASC: Allow specifying subregions to be disabled
ARM TZASC-380 IP provides a mechanism to split memory regions being protected via it into eight equal-sized sub-regions. A bit-setting allows the corresponding subregion to be disabled. Several NXP/FSL SoCs support the TZASC-380 IP block and allow the DDR connected via the TZASC to be partitioned into regions having different security settings and also allow subregions to be disabled. This patch enables this support and can be used for SoCs which support such a partition of DDR regions. Details of the 'subregion_disable' register can be viewed here: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0431c/CHDIGDCI.html Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bhupesh Sharma <bhupesh.sharma@nxp.com> [bhupesh.linux@gmail.com : Added gmail ID as NXP one is no longer valid] Signed-off-by: Bhupesh Sharma <bhupesh.linux@gmail.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Include')
-rw-r--r--ArmPlatformPkg/Include/Drivers/ArmTrustzone.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h b/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h
index 78e98aad53..827b5cd568 100644
--- a/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h
+++ b/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h
@@ -71,6 +71,22 @@ TZPCClearDecProtBits (
#define TZASC_REGION_SECURITY_NSW 1
#define TZASC_REGION_SECURITY_NSRW (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW)
+/* Some useful masks */
+#define TZASC_REGION_SETUP_LO_ADDR_MASK 0xFFFF8000
+
+#define TZASC_REGION_ATTR_SECURITY_MASK 0xF
+#define TZASC_REGION_ATTR_SUBREG_DIS_MASK 0xFF
+#define TZASC_REGION_ATTR_SIZE_MASK 0x3F
+#define TZASC_REGION_ATTR_EN_MASK 0x1
+
+#define TZASC_REGION_SETUP_LO_ADDR(x) ((x) & TZASC_REGION_SETUP_LO_ADDR_MASK)
+
+#define TZASC_REGION_ATTR_SECURITY(x) (((x) & TZASC_REGION_ATTR_SECURITY_MASK) << 28)
+#define TZASC_REGION_ATTR_SUBREG_DISABLE(x) \
+ (((x) & TZASC_REGION_ATTR_SUBREG_DIS_MASK) << 8)
+#define TZASC_REGION_ATTR_SIZE(x) (((x) & TZASC_REGION_ATTR_SIZE_MASK) << 1)
+#define TZASC_REGION_ATTR_ENABLE(x) ((x) & TZASC_REGION_ATTR_EN_MASK)
+
/**
FIXME: Need documentation
**/
@@ -82,7 +98,8 @@ TZASCSetRegion (
IN UINTN LowAddress,
IN UINTN HighAddress,
IN UINTN Size,
- IN UINTN Security
+ IN UINTN Security,
+ IN UINTN SubregionDisableMask
);
#endif