xref: /openbmc/u-boot/arch/arm/mach-imx/mx7/snvs.c (revision 83d290c5)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2723f8359SBryan O'Donoghue /*
3723f8359SBryan O'Donoghue  * Copyright 2018 Linaro
4723f8359SBryan O'Donoghue  */
5723f8359SBryan O'Donoghue 
6723f8359SBryan O'Donoghue #include <asm/io.h>
7723f8359SBryan O'Donoghue #include <asm/arch/imx-regs.h>
8723f8359SBryan O'Donoghue #include <linux/bitops.h>
9723f8359SBryan O'Donoghue 
10723f8359SBryan O'Donoghue #define SNVS_HPCOMR		0x04
11723f8359SBryan O'Donoghue #define SNVS_HPCOMR_NPSWA_EN	BIT(31)
12723f8359SBryan O'Donoghue 
13723f8359SBryan O'Donoghue void init_snvs(void)
14723f8359SBryan O'Donoghue {
15723f8359SBryan O'Donoghue 	u32 val;
16723f8359SBryan O'Donoghue 
17723f8359SBryan O'Donoghue 	/* Ensure SNVS HPCOMR sets NPSWA_EN to allow unpriv access to SNVS LP */
18723f8359SBryan O'Donoghue 	val = readl(SNVS_BASE_ADDR + SNVS_HPCOMR);
19723f8359SBryan O'Donoghue 	val |= SNVS_HPCOMR_NPSWA_EN;
20723f8359SBryan O'Donoghue 	writel(val, SNVS_BASE_ADDR + SNVS_HPCOMR);
21723f8359SBryan O'Donoghue }
22