Commit 654088cc211e021387b04a8c33420739da40ebbe

Authored by Peng Fan
1 parent c630e0ad3b

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)

Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff

arch/arm/mach-imx/imx8m/soc.c
... ... @@ -249,6 +249,7 @@
249 249  
250 250 int arch_cpu_init(void)
251 251 {
  252 + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
252 253 /*
253 254 * Init timer at very early state, because pll setting will use it,
254 255 * Rom Turnned off SCTR, enable it before timer_init
... ... @@ -287,6 +288,12 @@
287 288 /* Enable RTC */
288 289 writel(0x21, 0x30370038);
289 290 #endif
  291 +
  292 + if (is_imx8mq()) {
  293 + clock_enable(CCGR_OCOTP, 1);
  294 + if (readl(&ocotp->ctrl) & 0x200)
  295 + writel(0x200, &ocotp->ctrl_clr);
  296 + }
290 297  
291 298 return 0;
292 299 }