From patchwork Wed Oct 4 22:25:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 9985771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E5E046028E for ; Wed, 4 Oct 2017 22:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6C9A28C2B for ; Wed, 4 Oct 2017 22:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB79F28C35; Wed, 4 Oct 2017 22:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A660928C2B for ; Wed, 4 Oct 2017 22:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RdYzQuJv91E3ncg6lU+pbZMRGZIoBGjRZSkHDh1jMus=; b=ovjU1gWLpfwwfScfEPEIo4k9L4 8eAHP5PCcGl24htMA5doAQEmDtqOAtwEk0V5cXXtmuguoLddJWSxLZ6fSDH3m5zQTWcbhtyw5a4tj CEIe+gRbBAyVP74pig6/5/Jtj+MW6EF4jCAefYXdvJWxgl2zwr4F70JSMZQWf9qvWdiSinWcq9Qx8 PYu9H+K0jc4Ww6i6HVKrL4OR9Lgo/u62lgu+sHlaXBdyl216MdYOmJUjRzMpv+559NW7CjsITs6ed UUyFxm1d65Dd8JVM+Z3kUmMg6clmqMLl5d6nnfsL+bRO95/9l0ftoGzobq5KsPgHzWzhsUQ+uU443 FV5WnThA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dzs6z-0005gR-R3; Wed, 04 Oct 2017 22:25:54 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dzs6s-0005YC-Uy for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2017 22:25:49 +0000 Received: by mail-wm0-x230.google.com with SMTP id f4so17819212wme.0 for ; Wed, 04 Oct 2017 15:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i5IVwyf9ctDhRrMGZiU5fdCPKfR8yVhZDrb02ZNOrjE=; b=oO25gXUMeKjij2PiBgdX0MOo8uFK6Sk7yoHiWa154OcOl/8TwP7x2R6BQ1xP0uVagk hDDdCj6Hu1F5JPbyVEJwdikiQoAJUkWtvu23QgVjCHhmaH97unQg9uwZgAJhXPgLHkXR 6oH7w2oPRAEgwSNtRrLUWbYdnS0KFFaMTciPsOmNYM2aO917nYeICFtJsRSKmc+WrEMY Rse8buC3b3PRrNBDYPNJqctTLExHR5nZZyn6xHBk3w4sHNIDk6z7Gzcm/mUc9i3xDl4A M6FpeeeqOQJsSz2Esao6RCMRilC9wk9TSnABm06PDQrX6PW5j5KNUtHutXWwYFAvr2bO 1Biw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i5IVwyf9ctDhRrMGZiU5fdCPKfR8yVhZDrb02ZNOrjE=; b=D9iLTi+/7A6g5yhNapGyoOEr8JCV3Tc7umrnDgBQqKxtyzEJcoLZ0olSJP4RZk0y5D AVOWHzHFFeWjpon7A6pOKBU3bQakjjZ/Y5xQS2XZxV8msVZDJ5E3yfSmiSBEd5f/9gBG oXT8LsrqtGWpCTRiKE9OOBmB+UCdLrVwIwtIgl5BbnS3X4TTlzsoOHeM7zLJZGvBQjo6 fcjxCqgs7xU7GT6skgjy/kS2Lz0QXFGlOlxLDfoJt6GK/dQuqVNXRlNICUXXcOQRbTmZ 0/TJ61Q7e4DTLmd1iTFOyN9/+FTUhNObFFWDG9fIgD6aLGgvCISXd4UmPIGQEtL6MZsl DZoA== X-Gm-Message-State: AMCzsaWb/sIqDddDjCHZ8Bt/FLuYwb1PwqZJN2sydFuW5+N9vs2K1JGg C9j1R6bK4PSXidEMX5V9rSPShg== X-Google-Smtp-Source: AOwi7QBngMmGicSNg3TlZC7FDLBz421RHIs9d7XsxCVGJw+IiTB/XqceixJ6upxEY1Q96GRpLViAzQ== X-Received: by 10.80.181.61 with SMTP id y58mr6244438edd.150.1507155923601; Wed, 04 Oct 2017 15:25:23 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id i6sm12459022edk.3.2017.10.04.15.25.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Oct 2017 15:25:23 -0700 (PDT) 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171004_152547_218377_108B97CE X-CRM114-Status: GOOD ( 10.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pure.logic@nexus-software.ie, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Philipp Zabel --- 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))