aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8m/soc.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-09-22 10:29:29 -0400
committerTom Rini <trini@konsulko.com>2022-09-22 10:29:29 -0400
commit435596d57f8beedf36b5dc858fe7ba9d6c03334b (patch)
treefab17be6ba8a30740508d6228d9d200a831acf61 /arch/arm/mach-imx/imx8m/soc.c
parent179a9320c0a258fba0736fe16fd90d1cee8fc223 (diff)
parent1d8f4c85e3c04f596b0464542221b3507af0014e (diff)
Merge tag 'u-boot-imx-20220922' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20220922 ------------------- Fixes for 2022.10 CI : https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/13548
Diffstat (limited to 'arch/arm/mach-imx/imx8m/soc.c')
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index d115b25a5b..5739546c02 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -544,6 +544,16 @@ static int imx8m_check_clock(void *ctx, struct event *event)
}
EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
+static void imx8m_setup_snvs(void)
+{
+ /* Enable SNVS clock */
+ clock_enable(CCGR_SNVS, 1);
+ /* Initialize glitch detect */
+ writel(SNVS_LPPGDR_INIT, SNVS_BASE_ADDR + SNVS_LPLVDR);
+ /* Clear interrupt status */
+ writel(0xffffffff, SNVS_BASE_ADDR + SNVS_LPSR);
+}
+
int arch_cpu_init(void)
{
struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
@@ -594,6 +604,8 @@ int arch_cpu_init(void)
writel(0x200, &ocotp->ctrl_clr);
}
+ imx8m_setup_snvs();
+
return 0;
}