aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/include/mach/tzc.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-07-27 09:11:25 -0400
committerTom Rini <trini@konsulko.com>2021-07-27 09:11:25 -0400
commit0d4823fbebae6ebbf558a9325d86b37c67d848d9 (patch)
tree46c84c5039fc1d2ce0ff441e32603de406976db5 /arch/arm/mach-stm32mp/include/mach/tzc.h
parentdf59b7d23be71db03275e4c1b243e67397b50f9a (diff)
parent65b3f56d42e5ddc9183843723cf735950f062410 (diff)
Merge tag 'u-boot-stm32-20210727' of https://source.denx.de/u-boot/custodians/u-boot-stm
- FIP Enable OP-TEE and TZC support in SPL for STM32MP15 SoC - Add stm32mp15 missing SPI clock support - Manage pull-up on gpio button STM32MP15 boards - Correct STM32MP15 boot when TAMPER registers are invalid - Fix EMMC pinmux on STM32MP15 Avenger96 board
Diffstat (limited to 'arch/arm/mach-stm32mp/include/mach/tzc.h')
-rw-r--r--arch/arm/mach-stm32mp/include/mach/tzc.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/include/mach/tzc.h b/arch/arm/mach-stm32mp/include/mach/tzc.h
new file mode 100644
index 0000000000..16db55c464
--- /dev/null
+++ b/arch/arm/mach-stm32mp/include/mach/tzc.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Simple API for configuring TrustZone memory regions
+ *
+ * The premise is that the desired TZC layout is known beforehand, and it can
+ * be configured in one step. tzc_configure() provides this functionality.
+ */
+#ifndef MACH_TZC_H
+#define MACH_TZC_H
+
+#include <linux/types.h>
+
+enum tzc_sec_mode {
+ TZC_ATTR_SEC_NONE = 0,
+ TZC_ATTR_SEC_R = 1,
+ TZC_ATTR_SEC_W = 2,
+ TZC_ATTR_SEC_RW = 3
+};
+
+struct tzc_region {
+ uintptr_t base;
+ uintptr_t top;
+ enum tzc_sec_mode sec_mode;
+ uint16_t nsec_id;
+ uint16_t filters_mask;
+};
+
+int tzc_configure(uintptr_t tzc, const struct tzc_region *cfg);
+int tzc_disable_filters(uintptr_t tzc, uint16_t filters_mask);
+int tzc_enable_filters(uintptr_t tzc, uint16_t filters_mask);
+void tzc_dump_config(uintptr_t tzc);
+
+#endif /* MACH_TZC_H */