From: Ye Li <ye...@nxp.com>

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 <ye...@nxp.com>
Signed-off-by: Peng Fan <peng....@nxp.com>
---
 drivers/misc/mxc_ocotp.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c
index f84fe88db1..33ea31135c 100644
--- a/drivers/misc/mxc_ocotp.c
+++ b/drivers/misc/mxc_ocotp.c
@@ -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
-- 
2.16.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to