summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/sunxi/board.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2015-08-25 10:49:19 +0800
committerHans de Goede <hdegoede@redhat.com>2015-08-31 08:43:42 +0200
commit92369844ec7bf0e63de51e19b281fe3739e01397 (patch)
treeadd7a1f64102a55f53b06877c2fb9f547e045bc6 /arch/arm/cpu/armv7/sunxi/board.c
parent3537a0e8caa33ad4af354d5efc6be117b0728856 (diff)
downloadu-boot-92369844ec7bf0e63de51e19b281fe3739e01397.tar.gz
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/board.c')
-rw-r--r--arch/arm/cpu/armv7/sunxi/board.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index f01846ef9a..b40198b36e 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -23,6 +23,7 @@
#include <asm/arch/gpio.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/timer.h>
+#include <asm/arch/tzpc.h>
#include <asm/arch/mmc.h>
#include <linux/compiler.h>
@@ -115,6 +116,10 @@ void s_init(void)
"orr r0, r0, #1 << 6\n"
"mcr p15, 0, r0, c1, c0, 1\n");
#endif
+#if defined CONFIG_MACH_SUN6I
+ /* Enable non-secure access to the RTC */
+ tzpc_init();
+#endif
clock_init();
timer_init();