summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-04-17 09:41:20 +0000
committerStefano Babic <sbabic@denx.de>2019-04-25 19:16:24 +0200
commit112ad600587655d17a95ecf1d9a10358528106ac (patch)
treead8960a4456d827f5f017452ff4e38bbb43857c9 /drivers/misc
parent702339bdf463a5af6f6839a3c495e003750ab309 (diff)
downloadu-boot-112ad600587655d17a95ecf1d9a10358528106ac.tar.gz
u-boot-112ad600587655d17a95ecf1d9a10358528106ac.tar.bz2
u-boot-112ad600587655d17a95ecf1d9a10358528106ac.zip
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 <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mxc_ocotp.c18
1 files 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