summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/sunxi/tzpc.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2015-08-25 02:49:19 (GMT)
committerHans de Goede <hdegoede@redhat.com>2015-08-31 06:43:42 (GMT)
commit92369844ec7bf0e63de51e19b281fe3739e01397 (patch)
treeadd7a1f64102a55f53b06877c2fb9f547e045bc6 /arch/arm/cpu/armv7/sunxi/tzpc.c
parent3537a0e8caa33ad4af354d5efc6be117b0728856 (diff)
downloadu-boot-fsl-qoriq-92369844ec7bf0e63de51e19b281fe3739e01397.tar.xz
sunxi: Enable non-secure access to RTC on sun6i (A31s)
On the A31s the RTC is by default secured. Thus when u-boot loads the kernel in non-secure world, the RTC is unavailable. The SoC has a TrustZone Protection Controller, which can be used to enable non-secure access to the RTC. On the A31 the TZPC doesn't seem to do anything, i.e. changes to its register contents do not affect access to the RTC. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'arch/arm/cpu/armv7/sunxi/tzpc.c')
-rw-r--r--arch/arm/cpu/armv7/sunxi/tzpc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/tzpc.c b/arch/arm/cpu/armv7/sunxi/tzpc.c
new file mode 100644
index 0000000..5c9c69b
--- /dev/null
+++ b/arch/arm/cpu/armv7/sunxi/tzpc.c
@@ -0,0 +1,18 @@
+/*
+ * (C) Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/io.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/tzpc.h>
+
+/* Configure Trust Zone Protection Controller */
+void tzpc_init(void)
+{
+ struct sunxi_tzpc *tzpc = (struct sunxi_tzpc *)SUNXI_TZPC_BASE;
+
+ /* Enable non-secure access to the RTC */
+ writel(SUNXI_TZPC_DECPORT0_RTC, &tzpc->decport0_set);
+}