]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm
authorBryan O'Donoghue <pure.logic@nexus-software.ie>
Wed, 26 Jun 2019 10:27:30 +0000 (11:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Jun 2019 12:26:47 +0000 (20:26 +0800)
commit159dbaf57b2f4f67ecb59b2c87d071e45ed41d7e
tree07e82f11ca9cf91a0f00826038b481ba9fe73091
parent0493c4792b4eb260441e57f52cc11a9ded48b5a7
nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm

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: 0642bac7da42 ("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>
drivers/nvmem/imx-ocotp.c