misc: mxc_ocotp: check fuse word before programming on i.MX7ULP
authorPeng Fan <peng.fan@nxp.com>
Tue, 2 Jan 2018 07:51:20 +0000 (15:51 +0800)
committerStefano Babic <sbabic@denx.de>
Fri, 12 Jan 2018 13:28:04 +0000 (14:28 +0100)
commit8df42bee0e728707ef4f7e7d2b12b015a4a95200
treeb6c95fd6243915042eae8d307186675b72f513fe
parentfb8cac936615e6e75237ce95ccaa09d8b109cae3
misc: mxc_ocotp: check fuse word before programming on i.MX7ULP

On i.MX7ULP, the fuse words (except bank 0 and 1) only supports to
write once, because they use ECC mode. Multiple writes may damage
the ECC value and cause a wrong fuse value decoded when reading.
This patch adds a checking before the fuse word programming, only
can write when the word value is 0.

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