summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-11-28 12:32:21 +0800
committerPeng Fan <peng.fan@nxp.com>2018-11-28 13:46:21 +0800
commit654088cc211e021387b04a8c33420739da40ebbe (patch)
tree8195c5134de71cbb56178b2d739449e0480e16ab /arch
parentc630e0ad3bc87f962ba7ce6038a78d99b9d1ff5c (diff)
MLK-20479 imx8mq: clear ocotp error bit
In case ocotp error bit is set, clear it. This is a workaround to ocotp error bit. Signed-off-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 781f2d8febe954b2ef3e51b6a2eebcfbf24b08eb)
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 436b6cb3a1..9408105569 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -249,6 +249,7 @@ static void imx_set_wdog_powerdown(bool enable)
int arch_cpu_init(void)
{
+ struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
/*
* Init timer at very early state, because pll setting will use it,
* Rom Turnned off SCTR, enable it before timer_init
@@ -288,6 +289,12 @@ int arch_cpu_init(void)
writel(0x21, 0x30370038);
#endif
+ if (is_imx8mq()) {
+ clock_enable(CCGR_OCOTP, 1);
+ if (readl(&ocotp->ctrl) & 0x200)
+ writel(0x200, &ocotp->ctrl_clr);
+ }
+
return 0;
}