imx: mx7: snvs: Add an SNVS init routine
[oweals/u-boot.git] / arch / arm / mach-imx / mx7 / snvs.c
1 /*
2  * Copyright 2018 Linaro
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <asm/io.h>
8 #include <asm/arch/imx-regs.h>
9 #include <linux/bitops.h>
10
11 #define SNVS_HPCOMR             0x04
12 #define SNVS_HPCOMR_NPSWA_EN    BIT(31)
13
14 void init_snvs(void)
15 {
16         u32 val;
17
18         /* Ensure SNVS HPCOMR sets NPSWA_EN to allow unpriv access to SNVS LP */
19         val = readl(SNVS_BASE_ADDR + SNVS_HPCOMR);
20         val |= SNVS_HPCOMR_NPSWA_EN;
21         writel(val, SNVS_BASE_ADDR + SNVS_HPCOMR);
22 }