mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-15 15:53:26 +08:00
92369844ec
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>
19 lines
411 B
C
19 lines
411 B
C
/*
|
|
* (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);
|
|
}
|