aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mxc_ocotp.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-04-30 23:21:27 -0400
committerTom Rini <trini@konsulko.com>2019-05-01 07:25:51 -0400
commitb4ee6daad7a2604ca9466b2ba48de86cc27d381f (patch)
treef28b8d6bfeface9e9f188ffc37322c89e9d1fe77 /drivers/misc/mxc_ocotp.c
parenta69120a0d7c8d4044cdaceea9eb03913ba4e49c7 (diff)
parent0d3912fcd41dc2a85891f78e8fc255a379323619 (diff)
Merge tag 'u-boot-imx-20190426' of git://git.denx.de/u-boot-imx
Porting to DM and i.MX8 ------------------------ - warp7 to DM - kp_imx53 to DM - Warnings in DT - MX8QM support - colibri-imx6ull to DM - imx7d-pico to DM - ocotp for MX8
Diffstat (limited to 'drivers/misc/mxc_ocotp.c')
-rw-r--r--drivers/misc/mxc_ocotp.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c
index f84fe88db1..1b945e9727 100644
--- a/drivers/misc/mxc_ocotp.c
+++ b/drivers/misc/mxc_ocotp.c
@@ -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(&regs, bank, word, val, __func__);
if (ret)
return ret;
@@ -354,13 +359,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