From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751299AbdJDWZ1 (ORCPT ); Wed, 4 Oct 2017 18:25:27 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:52553 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbdJDWZY (ORCPT ); Wed, 4 Oct 2017 18:25:24 -0400 X-Google-Smtp-Source: AOwi7QBngMmGicSNg3TlZC7FDLBz421RHIs9d7XsxCVGJw+IiTB/XqceixJ6upxEY1Q96GRpLViAzQ== From: "Bryan O'Donoghue" To: richard.leitner@skidata.com, srinivas.kandagatla@linaro.org, axel.lin@ingics.com, ping.bai@nxp.com, d.schultz@phytec.de, peng.fan@nxp.com, van.freenix@gmail.com, p.zabel@pengutronix.de Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, pure.logic@nexus-software.ie Subject: [RESEND][PATCH 1/7] nvmem: imx-ocotp: Restrict OTP write to IMX6 processors Date: Wed, 4 Oct 2017 23:25:15 +0100 Message-Id: <1507155921-824-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507155921-824-1-git-send-email-pure.logic@nexus-software.ie> References: <1507155921-824-1-git-send-email-pure.logic@nexus-software.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/nvmem/imx-ocotp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 193ca8f..17d160f 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -347,6 +347,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)) -- 2.7.4