@@ -11,6 +11,7 @@ obj-y += timer.o
obj-$(CONFIG_MACH_SUN6I) += tzpc.o
obj-$(CONFIG_MACH_SUN8I_H3) += tzpc.o
+obj-$(CONFIG_MACH_SUN8I_A83T) += tzpc.o
ifndef CONFIG_SPL_BUILD
ifdef CONFIG_ARMV7_PSCI
@@ -18,6 +18,16 @@ void tzpc_init(void)
writel(SUN6I_TZPC_DECPORT0_RTC, &tzpc->decport0_set);
#endif
+#ifdef SUN8I_A83T_TZPC_DECPORT0_ALL
+ /* Set secure RAM size to defined value */
+ writel(R0SIZE, &tzpc->r0size);
+
+ /* Enable non-secure access to all peripherals */
+ writel(SUN8I_A83T_TZPC_DECPORT0_ALL, &tzpc->decport0_set);
+ writel(SUN8I_A83T_TZPC_DECPORT1_ALL, &tzpc->decport1_set);
+ writel(SUN8I_A83T_TZPC_DECPORT2_ALL, &tzpc->decport2_set);
+#endif
+
#ifdef CONFIG_MACH_SUN8I_H3
/* Enable non-secure access to all peripherals */
writel(SUN8I_H3_TZPC_DECPORT0_ALL, &tzpc->decport0_set);
@@ -25,6 +25,16 @@ struct sunxi_tzpc {
#define SUN6I_TZPC_DECPORT0_RTC (1 << 1)
+#define SUN8I_A83T_TZPC_DECPORT0_ALL 0xbe
+#define SUN8I_A83T_TZPC_DECPORT1_ALL 0x7f
+#define SUN8I_A83T_TZPC_DECPORT2_ALL 0x10
+
+/*
+ * TZPC Register Value :
+ * R0SIZE: 0x10 : Size of secured ram (64Kib)
+ */
+#define R0SIZE 0x10
+
#define SUN8I_H3_TZPC_DECPORT0_ALL 0xbe
#define SUN8I_H3_TZPC_DECPORT1_ALL 0xff
#define SUN8I_H3_TZPC_DECPORT2_ALL 0x7f
@@ -183,7 +183,7 @@ void s_init(void)
"orr r0, r0, #1 << 6\n"
"mcr p15, 0, r0, c1, c0, 1\n");
#endif
-#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I_H3
+#if defined CONFIG_MACH_SUN6I || || defined CONFIG_MACH_SUN8I_A83T defined CONFIG_MACH_SUN8I_H3
/* Enable non-secure access to some peripherals */
tzpc_init();
#endif
This patch enables non-secure access to all system peripherals controlled by the STMA, and additionally sets the secure RAM range to 64k in line with other sunxi devices. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> --- arch/arm/cpu/armv7/sunxi/Makefile | 1 + arch/arm/cpu/armv7/sunxi/tzpc.c | 10 ++++++++++ arch/arm/include/asm/arch-sunxi/tzpc.h | 10 ++++++++++ arch/arm/mach-sunxi/board.c | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-)