mxc_ocotp: Disable fuse sense for imx8mq B1
authorYe Li <ye.li@nxp.com>
Wed, 17 Apr 2019 09:41:23 +0000 (09:41 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 25 Apr 2019 17:16:24 +0000 (19:16 +0200)
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.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/misc/mxc_ocotp.c

index 33ea31135c8bd3d3741e4badbd2b93e783d6083a..1b945e9727acf7d34546be35a8a21ccd845dd838 100644 (file)
@@ -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;