mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-01 16:13:16 +00:00

This patch adds snvs.c with a imx_snvs_init() function. imx_snvs_init() sets up permissions of the RTC via the SNVS HPCOMR. During previous work with OPTEE on the i.MX7 part we discovered that prior to switching from secure-world to normal-world it is required to apply more permissive permissions than are defaulted to in order for Linux to be able to access the RTC and CAAM functionality in general. This patch pertains to fixing the RTC permissions by way of the HPCOMR.NPSWA_EN bit. Once set non-privileged code aka Linux-kernel code has permissions to access the SNVS where the RTC resides. Perform that permissions fix in imx_snvs_init() now, with a later patch making the call from our platform setup code. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
21 lines
411 B
C
21 lines
411 B
C
/*
|
|
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <mmio.h>
|
|
#include <imx_regs.h>
|
|
#include <imx_snvs.h>
|
|
|
|
void imx_snvs_init(void)
|
|
{
|
|
struct snvs *snvs = (struct snvs *)SNVS_BASE;
|
|
uintptr_t addr;
|
|
uint32_t val;
|
|
|
|
addr = (uintptr_t)&snvs->hpcomr;
|
|
val = mmio_read_32(addr);
|
|
val |= HPCOMR_NPSWA_EN;
|
|
mmio_write_32(addr, val);
|
|
}
|