I need to read the values of some OTP registers early during kernel initialization.
I'm reading them at the end of the probe() function of the fsl_opt.c driver.
static int fsl_otp_probe(struct platform_device *pdev)
printk("MAC0: 0x%08x\n", reg);
When I do this, the system hangs.
I tracked it down to the point where the OTP clock is disabled in the fsl_otp_read() function:
If I comment the clk_disable_unprepare(), the kernel goes on normally.
The function is basically writing a b00 to CCM_CCGR2[CG6], thus disabling the OTP clock.
If I don't do the early access, everything works fine, and even the sysfs access to OTP registers works without problems.
A similar code on the i.MX6 works ok, but not on the i.MX6UL.
I don't understand why disabling the OTP clock causes the kernel to hang.
I'm using kernel version: 4.1.15
+CC Fabio Estevam