linux-stable/drivers/nvmem
Bryan O'Donoghue 3fda892563 nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm
[ Upstream commit 159dbaf57b ]

The RELAX field of the OCOTP block is turning out as a zero on i.MX8MM.
This messes up the subsequent re-load of the fuse shadow registers.

After some discussion with people @ NXP its clear we have missed a trick
here in Linux.

The OCOTP fuse programming time has a physical minimum 'burn time' that is
not related to the ipg_clk.

We need to define the RELAX, STROBE_READ and STROBE_PROG fields in terms of
desired timings to allow for the burn-in to safely complete. Right now only
the RELAX field is calculated in terms of an absolute time and we are
ending up with a value of zero.

This patch inherits the u-boot timings for the OCOTP_TIMING calculation on
the i.MX6 and i.MX8. Those timings are known to work and critically specify
values such as STROBE_PROG as a minimum timing.

Fixes: 0642bac7da ("nvmem: imx-ocotp: add write support")

Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Suggested-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:50:58 +01:00
..
bcm-ocotp.c
core.c nvmem: core: return error code instead of NULL from nvmem_device_get 2019-11-20 18:46:31 +01:00
imx-iim.c
imx-ocotp.c nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm 2020-01-27 14:50:58 +01:00
Kconfig nvmem: Add Spreadtrum SC27XX efuse support 2018-07-15 14:03:05 +02:00
lpc18xx_eeprom.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
lpc18xx_otp.c
Makefile nvmem: Add Spreadtrum SC27XX efuse support 2018-07-15 14:03:05 +02:00
meson-efuse.c nvmem: meson-efuse: add write support 2018-05-14 16:20:48 +02:00
meson-mx-efuse.c
mtk-efuse.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
mxs-ocotp.c
qfprom.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
rave-sp-eeprom.c nvmem: rave-sp-eeprom: Remove VLA usage 2018-07-07 17:30:46 +02:00
rockchip-efuse.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sc27xx-efuse.c nvmem: Add Spreadtrum SC27XX efuse support 2018-07-15 14:03:05 +02:00
snvs_lpgpr.c
sunxi_sid.c nvmem: sunxi_sid: Support SID on A83T and H5 2019-06-15 11:54:07 +02:00
uniphier-efuse.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
vf610-ocotp.c