imx: i.MX8MQ: clear ocotp error bit
PATCH 1/1 imx: i.MX8MQ: clear ocotp error bit
In case ocotp error bit is set, clear it.
--- arch/arm/mach-imx/imx8m/soc.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +7 -0
@@ -169,6 +169,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 sscg pll setting * will use it
@@ -180,6 +181,12 @@ int arch_cpu_init(void)imx_set_wdog_powerdown (false); } +if (is_imx8mq ()) { +clock_enable (CCGR_OCOTP ,1 ); +if (readl (&ocotp->ctrl) &0x200 ) +writel (0x200 , &ocotp->ctrl_clr); + } +return 0 ; }
Signature · 1 line
2.16.4
PATCH 1/2 mxc_ocotp: Update redundancy banks for mx7ulp B0
From: Ye Li <[email protected]>
On mx7ulp B0, beside bank 0 and 1, the fuse bank 9, 10, 28 are changed to Redundancy mode not ECC, so they can support to program different bits of a word in multiple times.
--- drivers/misc/mxc_ocotp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/misc/mxc_ocotp.c +11 -7
@@ -354,13 +354,17 @@ static int prepare_write(struct ocotp_regs **regs, u32 bank, u32 word,/* Only bank 0 and 1 are redundancy mode, others are ECC mode */ if (bank !=0 && bank !=1 ) { - ret =fuse_sense (bank, word, &val); -if (ret) -return ret; - -if (val !=0 ) { -printf ("mxc_ocotp: The word has been programmed, no more write\n" ); -return -EPERM ; +if ((soc_rev () <CHIP_REV_2_0 ) || + ((soc_rev () >=CHIP_REV_2_0 ) && + bank !=9 && bank !=10 && bank !=28 )) { + ret =fuse_sense (bank, word, &val); +if (ret) +return ret; + +if (val !=0 ) { +printf ("mxc_ocotp: The word has been programmed, no more write\n" ); +return -EPERM ; + } } }#endif
Signature · 1 line
2.16.4
PATCH 1/2 mxc_ocotp: Update redundancy banks for mx7ulp B0
Quoted 6 lines
From: Ye Li <[email protected]>
On mx7ulp B0, beside bank 0 and 1, the fuse bank 9, 10, 28 are changed to Redundancy mode not ECC, so they can support to program different bits of a word in multiple times.Signed-off-by Ye Li <[email protected]>Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 2/2 mxc_ocotp: Disable fuse sense for imx8mq B1
In reply to Peng FanFrom: Ye Li <[email protected]>
On iMX8MQ Rev B1, reading from fuse box is not allowed. The OCOTP_READ_FUSE_DATA register is tied to magic number 0xff0055aa for chip rev. So u-boot has to disable the fuse sense function for it.
--- drivers/misc/mxc_ocotp.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/misc/mxc_ocotp.c +5 -0
@@ -321,6 +321,11 @@ int fuse_sense(u32 bank, u32 word, u32 *val)struct ocotp_regs *regs;int ret; +if (is_imx8mq () &&is_soc_rev (CHIP_REV_2_1 )) { +printf ("mxc_ocotp %s(): fuse sense is disabled\n" , __func__); +return -EPERM ; + } + ret =prepare_read (®s, bank, word, val, __func__);if (ret)return ret;
Signature · 1 line
2.16.4
PATCH 2/2 mxc_ocotp: Disable fuse sense for imx8mq B1
Quoted 7 lines
From: Ye Li <[email protected]>
On iMX8MQ Rev B1, reading from fuse box is not allowed. TheOCOTP_READ_FUSE_DATAregister is tied to magic number0xff0055aafor chip rev. So u-boot has to disable the fuse sense function for it.Signed-off-by Ye Li <[email protected]>Tested-by Anson Huang <[email protected]>Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
Quoted 2 lines
In case ocotp error bit is set, clear it.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================