diff options
author | Bryan O'Donoghue <pure.logic@nexus-software.ie> | 2017-10-24 10:54:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-08 14:19:05 +0100 |
commit | 9d6a8dab8d8b94975d7d78a7866053bd1c9444ca (patch) | |
tree | e6efc5baecaa62766436011f7a4a033e939ffa6f | |
parent | 71c5dd5002b11d240c9b0e4adc972903183000aa (diff) | |
download | linux-9d6a8dab8d8b94975d7d78a7866053bd1c9444ca.tar.bz2 |
nvmem: imx-ocotp: Restrict OTP write to IMX6 processors
i.MX7S/D have a different scheme for addressing the OTP registers inside
the OCOTP block. Currently it's possible to address the wrong OTP registers
given the disparity between IMX6 and IMX7 OTP addressing.
Since OTP programming is one-time destructive its important we restrict
this interface ASAP.
Fixes: 0642bac7da42 ("nvmem: imx-ocotp: add write support")
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/nvmem/imx-ocotp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index e57e2a57aa3f..653cff9d9927 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -346,6 +346,8 @@ static int imx_ocotp_probe(struct platform_device *pdev) imx_ocotp_nvmem_config.dev = dev; imx_ocotp_nvmem_config.priv = priv; priv->config = &imx_ocotp_nvmem_config; + if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-ocotp")) + imx_ocotp_nvmem_config.read_only = true; nvmem = nvmem_register(&imx_ocotp_nvmem_config); if (IS_ERR(nvmem)) |