imx: imx_snvs: Add an SNVS core functionality
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>
1 parent a60ca3b commit f7ea6d52234102b8f67d2d030a860b7a119d8450
@Bryan O'Donoghue Bryan O'Donoghue authored on 25 May 2018
Showing 1 changed file
View
plat/imx/common/imx_snvs.c 0 → 100644