From: Ye Li Date: Fri, 5 Jan 2018 02:55:03 +0000 (-0600) Subject: MLK-17345 mxc_ocotp: Update redundancy banks for mx7ulp B0 X-Git-Tag: rel_imx_4.9.88_2.0.0_ga~105 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=af901cae281a617063559f60761ad4e912fccd5f;p=u-boot.git MLK-17345 mxc_ocotp: Update redundancy banks for mx7ulp B0 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 --- diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c index 9adf0a804a..42f2d399c8 100644 --- a/drivers/misc/mxc_ocotp.c +++ b/drivers/misc/mxc_ocotp.c @@ -356,13 +356,16 @@ 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