From patchwork Wed Jun 26 10:27:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167791 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760208ilk; Wed, 26 Jun 2019 03:28:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKF+OY3Vm7E9CwPq3bj4IPzHkI3T8d2bjz7S4yFt4Os+6R/bCJGY//mGS8PjZGeb2GUxDP X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr4458359plb.331.1561544887731; Wed, 26 Jun 2019 03:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544887; cv=none; d=google.com; s=arc-20160816; b=jBvIRry/1JZETi8Fbuebqff6up7XcchHINtz6gf6MY/g47EFK/klBzm9JkQ3LT6s3j QFiclytgW4Ni7MPfVnh8SVya65Il/aNwqwWPdG5usmkL/uHGITGeMb0LrzmriwzT5A77 J8nmipeB9b3y5ls3+b64EzbCdq4f/T7C0Sv/om8mxYYLm3AgvSoozKpDJTaPttB3ylDb tb7c2vMmz74brnC8Vpbj945ecgWTwKV0v3XvDA1gFQVr8PQEFJfy4RFhKaB3qAIBz7JM LYfBaNOl9FdisEejfqiPyFKsqCqYuS7Fzo3ahAc2nqQ7aJh35pBN+WZAl3Wcd155naad ZjUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p/mgZFZvtz5MXeK97S6RAma7XXrIP4D9tjHX9nEHACY=; b=vChI4AYVt4j6EGcyeXienmvHgngVb9f8XjU66aVFgBBx8tUA6jPVDRCb2F0WI5wFS3 16iLgL6COM+FG95Gsge7IpT5Jjz3Gw99uNoTQcx57DoW3ve+T8JIIMQR4cbri2V7skyE Zy2GcY7+XRxIpfsCqfr+/N2O7PWoot/mpgMKPqb/EedKrMmXN1OFMgv+Ae30kqSgHal1 ts/ozTuWifZNTwy6iJEufJYtykD6XSa1iCjL8UVO25D8QO7mklGCDNUwr3M2fhVT4eyj g5hHaXdHUPUmD0Qd8lTDJacnHJr5tKGOxrBzyKsaT7r6lFRRe3ImfN1wgKGu0jMvXwSz yFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h1JRpI0J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a89si3178895pla.60.2019.06.26.03.28.07; Wed, 26 Jun 2019 03:28:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h1JRpI0J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbfFZK2G (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:06 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41078 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfFZK2E (ORCPT ); Wed, 26 Jun 2019 06:28:04 -0400 Received: by mail-wr1-f65.google.com with SMTP id c2so2083834wrm.8 for ; Wed, 26 Jun 2019 03:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p/mgZFZvtz5MXeK97S6RAma7XXrIP4D9tjHX9nEHACY=; b=h1JRpI0JBRfQ+DluKeXamJpk4K1xEhaXO9qNejSpmI2TPx6pE6d0M/X0rx6rND0y5j QkCOjv+8SKTcJSBjx6qzWuyqzQWVDccPIQvjSmth3U45tdO5j9nV7qah3hOY8LrqGTIz CyZaCFdvCuKCUyIhaUgxSnW2QdZx42O5Cf59ZrNQlCgFBc2v0cOacMc4UmJFCxyoUDNf pNcS/G4MaJg3r/sRiC2fI2Ul+RQ2HzXudlA+TT62lbeltM4+rM3i3HGhLJlN5jdWEovs +tSmZUlUczr64N34sWFPtmpR5Vb1DwuIwzNnL+I1NEqcNEwM8WxU+rf2qxJInvbGmoZ6 MF0g== 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:mime-version:content-transfer-encoding; bh=p/mgZFZvtz5MXeK97S6RAma7XXrIP4D9tjHX9nEHACY=; b=KNsVHDQeZIsd/HAw69LcLzo7WTpcVFFPGY5WUjbYjJI8KuyTamMgoLObECl8BWIbuz QXcG5Ouswkr59/jZ9RrrAS24neQwmOhG9O8pPr7MNofHnPSUDFkWEyc+1lB+kzxe5GKI L8dogKaAsmAtfNLX4jEkmnVF7AYdNymOKwgLbuJx/ebRXq0hKdmOqLR7MsyHiwDhETH6 3nHU+/cMZovCq5ehi0HHkH5/MiM09wDY208oJASZ3XDca8qn7WAvRW+JikCI2CIO1m0j 3JSlAnpyBM62SuleLMI28OUGLejenjZUg8NcO96EFsbWnxA1LLaQupx5l/m1MF4i+IMO jd8w== X-Gm-Message-State: APjAAAXtShpQ2DgiBN++QWAnjYe6r5sfMhlBoyepXlvVUKLSr0s36K77 UTM3hMSTq1DN4PMlfejYHH5LfQ== X-Received: by 2002:adf:e40f:: with SMTP id g15mr2944999wrm.174.1561544881765; Wed, 26 Jun 2019 03:28:01 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:01 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue , Leonard Crestez , Srinivas Kandagatla Subject: [PATCH 1/6] nvmem: imx-ocotp: Elongate OCOTP_CTRL ADDR field to eight bits Date: Wed, 26 Jun 2019 11:27:28 +0100 Message-Id: <20190626102733.11708-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue i.MX6 defines OCOTP_CTRLn:ADDR as seven bit address-field with a one bit RSVD0 field, i.MX7 defines OCOTP_CTRLn:ADDR as a four bit address-field with a four bit RSVD0 field. i.MX8 defines the OCOTP_CTRLn:ADDR bit-field as a full range eight bits. i.MX6 and i.MX7 should return zero for their respective RSVD0 bits and ignore a write-back of zero where i.MX8 will make use of the full range. This patch expands the bit-field definition for all users to eight bits, which is safe due to RSVD0 being a no-op for the i.MX6 and i.MX7. Signed-off-by: Bryan O'Donoghue Reviewed-by: Leonard Crestez Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index bd016b928589..14c2bff2cd96 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -39,7 +39,7 @@ #define IMX_OCOTP_ADDR_DATA2 0x0040 #define IMX_OCOTP_ADDR_DATA3 0x0050 -#define IMX_OCOTP_BM_CTRL_ADDR 0x0000007F +#define IMX_OCOTP_BM_CTRL_ADDR 0x000000FF #define IMX_OCOTP_BM_CTRL_BUSY 0x00000100 #define IMX_OCOTP_BM_CTRL_ERROR 0x00000200 #define IMX_OCOTP_BM_CTRL_REL_SHADOWS 0x00000400 From patchwork Wed Jun 26 10:27:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167796 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760492ilk; Wed, 26 Jun 2019 03:28:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/br1GcslqwCHvNdftAlJWqAPXUWwRPKA9iEUwU+OW/h2WiMGwpB2T293yt9zilRhlZ665 X-Received: by 2002:a63:455c:: with SMTP id u28mr2323495pgk.416.1561544906525; Wed, 26 Jun 2019 03:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544906; cv=none; d=google.com; s=arc-20160816; b=cQkILknQJx3nJ9svOYQyyFrbGD9rJQbQMNIpzLdPTxRXQKqDaEsX29Fog681xaCN4I g5wrCmYbLA2z6RiXsQtlj3dlzE1I+/3MZQLUFTLjY/8A7BQQcVXFV7r4xwt/T1gNJCQI 7vFcWIe4NMmEep3C96BWipWgZ/6BQJxkpJNxeUYvTCjev36wF3wUVQ30P4ov5KUIA2H4 bDZfwjQAEhPXq/UDV/Q8LbJZl4jom+jBlEtxaFtICQJv1vwbH8nDj0JeHYL0z5eRzvuY TIPza4jSpgflu2kTwUWPZye4v6nuIc6Muk+R4niTOmf2/yTwMtjqnzqvQ4SZu14B8Qum sqAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YkWgLbuNvvSsHDT8z49IMbijdNbjadafDfpCu7BT3J4=; b=wu473RvFEzSkOEfg7AhZ4LzTSi6SJCviOGyG34z1GBk+LopDMv+LRFxRBXBkJZ7czx J0kNATDuCGXcgEHbtoPxZhcKa3velhmX4VgBQcH5KD1WpD8BAjXGzYizByvRM7rNhutD yaFUnGbYfsyQfxSIy649L3A5FyuTkUrg+onAamz1WplADDeAkvzQ5yFTfZPySslWz1We co7GaGcgClZK/7m4lxbljo8QWj04ysuuciTV+xluUGRYy7sRZfQnVwKCQYil/PXud5IS GsXBEIuIPq4Dga1hhz/B/Va/gct30SyiswJBDeQ35YStZF0TNmcbFU0lxHzZqSMtXlDq 06BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZlQtchA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32si1757363pje.70.2019.06.26.03.28.26; Wed, 26 Jun 2019 03:28:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZlQtchA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbfFZK2Y (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:24 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53334 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfFZK2F (ORCPT ); Wed, 26 Jun 2019 06:28:05 -0400 Received: by mail-wm1-f67.google.com with SMTP id x15so1519129wmj.3 for ; Wed, 26 Jun 2019 03:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YkWgLbuNvvSsHDT8z49IMbijdNbjadafDfpCu7BT3J4=; b=IZlQtchA8tyGkV6MypPeDsYD7GgL+RAXRgSwohzYZ7aL3OFSpkLqHTESsBLlDFsdC+ PL78y4k0DEkuD5Y1Jp7EDdcLshCHlLOMDs+jJWmxe4E5wqfqsV3P0XS5bvG5fGimUBNt e5gm4KYH7twrUhQSRa6Xe/IfwZOJWcGlJ4oVE8iWTUdRELvnHQPLoAFYwnY0g2dZghB+ t/q7yjFbjwydx34vGUCfp5sdO9itDjxYmEU2//f9K2+JFVnjvblxa59G0pH2UErs9QMv E/9DIaAe6aANUmXlQ4s6SN5sTdQSMv4KOH6CzlK6zmNTUbpppUvkGPzdIAU7xKUvBXRE RcKw== 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:mime-version:content-transfer-encoding; bh=YkWgLbuNvvSsHDT8z49IMbijdNbjadafDfpCu7BT3J4=; b=gjFSgA24fycQgKJyQ1oPLFHxtrtkRuhAOvwakgXWuRDaK8I5qMQght0Be4TwS88xxP /8alRSXByAErDKeAvGOAV1ODu+87XCHrCYdsYFimuHKWcKapAT2wVtdtVfzw0ECWWzPh BQs7wvGwj0mHNElZq62qXZ6wL4p2z336O4d2DWeWi1ozAEJ6QhUypBBifYGoZxVapEKM +xvKhu5I7AzN0RhC1b8vVlUaIBWYIXSgTLAEhVbzObT1+HnUO5zb1z83BaBWU123vGEc SUynAFTZKglFPNmcq/S0WYZ2ybaj7h5V0LRHV/cCu1xGOj6ztOZTcYTOjbb2BYkHbxui 1kZw== X-Gm-Message-State: APjAAAVSWD5dsNJuqyrmCXp55h6jye8p5pPhfdhNdqxbDYRMPV8AahsD NAeaNtdDl1t2XVboAxsBR46Mcw== X-Received: by 2002:a1c:d10c:: with SMTP id i12mr2253393wmg.152.1561544882838; Wed, 26 Jun 2019 03:28:02 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:02 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue , Leonard Crestez , Srinivas Kandagatla Subject: [PATCH 2/6] nvmem: imx-ocotp: Ensure WAIT bits are preserved when setting timing Date: Wed, 26 Jun 2019 11:27:29 +0100 Message-Id: <20190626102733.11708-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue The i.MX6 and i.MX8 both have a bit-field spanning bits 27:22 called the WAIT field. The WAIT field according to the documentation for both parts "specifies time interval between auto read and write access in one time program. It is given in number of ipg_clk periods." This patch ensures that the relevant field is read and written back to the timing register. Fixes: 0642bac7da42 ("nvmem: imx-ocotp: add write support") Signed-off-by: Bryan O'Donoghue Reviewed-by: Leonard Crestez Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 14c2bff2cd96..f4e117bbf2c3 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -183,7 +183,8 @@ static void imx_ocotp_set_imx6_timing(struct ocotp_priv *priv) strobe_prog = clk_rate / (1000000000 / 10000) + 2 * (DEF_RELAX + 1) - 1; strobe_read = clk_rate / (1000000000 / 40) + 2 * (DEF_RELAX + 1) - 1; - timing = strobe_prog & 0x00000FFF; + timing = readl(priv->base + IMX_OCOTP_ADDR_TIMING) & 0x0FC00000; + timing |= strobe_prog & 0x00000FFF; timing |= (relax << 12) & 0x0000F000; timing |= (strobe_read << 16) & 0x003F0000; From patchwork Wed Jun 26 10:27:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167793 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760317ilk; Wed, 26 Jun 2019 03:28:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfigf8MhM7o9a87H8pNuy08IIA1Iv4wtdWAfB69kVYeduBcnSJEkZOL2E6iNGIa4/X8m7Z X-Received: by 2002:a63:fe13:: with SMTP id p19mr2265491pgh.359.1561544893942; Wed, 26 Jun 2019 03:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544893; cv=none; d=google.com; s=arc-20160816; b=Qnw3mNFayrp2YT8lg9AbfRYtIDqSAfuqK2eQQEdWgpGx5CSEOTn9+WN4HRJ3eCjO51 OD9JsG3L43nATO4kuAqChEYAT54uZiyA+afARzDQy1teA98/ptlZJMkif1DsBpshPgXI mqmmPPHP5G+bLu9CwB0nX74zGK7yfMPIL8fM4o1r9ioXcMNSz7i8jcTOsfnPeYGZkxvL 0O4yhmDlUdbqW9XHJKUxdHKj1kciyHkCrXaer95SWjQcYVZmuOirSN2/WP1OnxL81auW 4GC9/o8yYNKLF25XsZmQNajCisF72iBxgSrMeIyxtRDVzvotTMsCLafymEoMbYF0ki4I 1Fvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q2uYpOpXs+pbPux8Et5aQ4qoOceeJiTpOWIeON9aqJw=; b=yOwumfHdphLqeBZ53aGLP6KTcjjzu4pzNR+CNGn/zUJiIcz27Vvr/tcycWle1bUpa0 dbSw8Qrm4z6PKDoyzDE1SMsw+dWs+3M91uWguPgygCj/Cz39gMf3f+9u2gP8sKSgp8Gp Xs/yBXdoipVY0wwWC0ZLgzHj47a+HtIs2oD1k0IZh8NqdaaT6uFdfFiiYRHpFzTGj3co QJ+6aNi62br97QzBxcJKPSSPobxlBXiJnxbJNOYgKzS9zLnCrZ3/+rBNMrZMNfEt4hgA oUkqWBuQ4tk6Qvl/9JwqN0+MAmqVf9DAKp+LaquTUpkOTeTyCbcO5xjdGwVMAyNh7Y6c oCpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKbBdaaG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si3068839plb.407.2019.06.26.03.28.13; Wed, 26 Jun 2019 03:28:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKbBdaaG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbfFZK2I (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:08 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34110 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727127AbfFZK2G (ORCPT ); Wed, 26 Jun 2019 06:28:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id k11so2126784wrl.1 for ; Wed, 26 Jun 2019 03:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q2uYpOpXs+pbPux8Et5aQ4qoOceeJiTpOWIeON9aqJw=; b=TKbBdaaGYBpQghXpwDdVwuYb2eCWIDnI0Lq2bX+5Ha7ssWcmvOzVFnhTmq7RY7F16j 3i7coj0QCT3zQ3ystfb83L4SINRepuK4shd6GTXtBWTQ3M81th5gOmuB1aces34W8oqi XrpOYvnk6LNfhvIwp44XXW8jCEy6FLEt0J/KQBAIhGBLt0xL5JQR3fKTxMUjomnxVfPx VBdOjiimLfLkrbfAObkmp8FdRuZ+y7cqEKd7UQHhieS7xDaBotVrBkFIL1zfQ1bkV2pQ eIUIfb7Nm85ZDgU5lkZZWG64qigVpgceTPCphe/S4LtxEaWbqQrvZpnlvzlnyTICxriQ LSYg== 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:mime-version:content-transfer-encoding; bh=Q2uYpOpXs+pbPux8Et5aQ4qoOceeJiTpOWIeON9aqJw=; b=VHfYvc4k4wbUTgT12pRfRcVcaQqWYOg5Ifski1zrwP8U7pDpfjDmV4v98o3EvaLoW7 KSAa7C6aOa+mZa/9AjThQzY+ampkCEHuzoRAU8YCKLk2XQ4N5nCEafwsM7TQTD3CZVSc gfD1IS3jOlJ3ElR2vYOov/aNambpzXsmw3O0kDN58T6Yk9/DSmoklC7k909H0bi3DlnS cudMp7MSgxReEeQHQ887xwDLJ25m04J0mqqtgFBueCKdGSu8qAYK24ZQikiQSNGqNIlc ZXWjrS6YLLAObN6iR+qbJgAiLB4SmsV4MH97Rup/nwe7OGe7mRP5ctCSlZq3n+m7Zf4B ryJA== X-Gm-Message-State: APjAAAV21XquVePq4+DsPf1AJg70QfpcmqsA3yGOypB9dn84v74nBT8o XX73mFWJOz+Q/Iu+Ail6oKMXGg== X-Received: by 2002:adf:e490:: with SMTP id i16mr3068418wrm.280.1561544883691; Wed, 26 Jun 2019 03:28:03 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:03 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue , Leonard Crestez , Srinivas Kandagatla Subject: [PATCH 3/6] nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm Date: Wed, 26 Jun 2019 11:27:30 +0100 Message-Id: <20190626102733.11708-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue 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 Suggested-by: Leonard Crestez Reviewed-by: Leonard Crestez Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index f4e117bbf2c3..b7dacf53c715 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -44,7 +44,9 @@ #define IMX_OCOTP_BM_CTRL_ERROR 0x00000200 #define IMX_OCOTP_BM_CTRL_REL_SHADOWS 0x00000400 -#define DEF_RELAX 20 /* > 16.5ns */ +#define TIMING_STROBE_PROG_US 10 /* Min time to blow a fuse */ +#define TIMING_STROBE_READ_NS 37 /* Min time before read */ +#define TIMING_RELAX_NS 17 #define DEF_FSOURCE 1001 /* > 1000 ns */ #define DEF_STROBE_PROG 10000 /* IPG clocks */ #define IMX_OCOTP_WR_UNLOCK 0x3E770000 @@ -176,12 +178,38 @@ static void imx_ocotp_set_imx6_timing(struct ocotp_priv *priv) * fields with timing values to match the current frequency of the * ipg_clk. OTP writes will work at maximum bus frequencies as long * as the HW_OCOTP_TIMING parameters are set correctly. + * + * Note: there are minimum timings required to ensure an OTP fuse burns + * correctly that are independent of the ipg_clk. Those values are not + * formally documented anywhere however, working from the minimum + * timings given in u-boot we can say: + * + * - Minimum STROBE_PROG time is 10 microseconds. Intuitively 10 + * microseconds feels about right as representative of a minimum time + * to physically burn out a fuse. + * + * - Minimum STROBE_READ i.e. the time to wait post OTP fuse burn before + * performing another read is 37 nanoseconds + * + * - Minimum RELAX timing is 17 nanoseconds. This final RELAX minimum + * timing is not entirely clear the documentation says "This + * count value specifies the time to add to all default timing + * parameters other than the Tpgm and Trd. It is given in number + * of ipg_clk periods." where Tpgm and Trd refer to STROBE_PROG + * and STROBE_READ respectively. What the other timing parameters + * are though, is not specified. Experience shows a zero RELAX + * value will mess up a re-load of the shadow registers post OTP + * burn. */ clk_rate = clk_get_rate(priv->clk); - relax = clk_rate / (1000000000 / DEF_RELAX) - 1; - strobe_prog = clk_rate / (1000000000 / 10000) + 2 * (DEF_RELAX + 1) - 1; - strobe_read = clk_rate / (1000000000 / 40) + 2 * (DEF_RELAX + 1) - 1; + relax = DIV_ROUND_UP(clk_rate * TIMING_RELAX_NS, 1000000000) - 1; + strobe_read = DIV_ROUND_UP(clk_rate * TIMING_STROBE_READ_NS, + 1000000000); + strobe_read += 2 * (relax + 1) - 1; + strobe_prog = DIV_ROUND_CLOSEST(clk_rate * TIMING_STROBE_PROG_US, + 1000000); + strobe_prog += 2 * (relax + 1) - 1; timing = readl(priv->base + IMX_OCOTP_ADDR_TIMING) & 0x0FC00000; timing |= strobe_prog & 0x00000FFF; From patchwork Wed Jun 26 10:27:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167795 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760410ilk; Wed, 26 Jun 2019 03:28:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0nnE3stsIF/vvaKbUe87NUGJqA+WK5s4EykJHa36E+f7yLRS1fdYNA7MU5Xe/fgzRppdF X-Received: by 2002:a17:90a:bd8c:: with SMTP id z12mr3895322pjr.60.1561544901006; Wed, 26 Jun 2019 03:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544900; cv=none; d=google.com; s=arc-20160816; b=eCSY1rGJ+vKHA7zehqWJma5vXKw6n4OkzSMISNUaLTQ4YCfMWqvr9o8QOBA4SPuBAu XuYwqOb+dgjt886Q0GLXeHbc9FlGMQOVsX9/JLVS1fX31Y4oon2xyoMq3rP3tgOnAEwI GNDn9BNpygSOrPjacORkIIxnvQO652cl3u4/laNviQnHuS6gSWDOqRkHQx3ey2k0JqNc 3+koeyBYwumMyuN2ELaLAF5H4RTiKhBHyvqbsSwjP6eIUUx6RJItqrhCcHg3fmzLqHB5 P/z656dv5hXnTtCLO8BLju5Vr7jDiDECnk2+2m5GLyGuudtUhT7FLZi4pR0Mn/bTD1Yh khsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mvSt9hJ9riivcaZUoiXx5QKwOryBX80+CmAuVklqVuY=; b=LpfMggYO0KRZEn5JCLl3BuEdh+vGAVHZ464EVNGArf9Q4apqNnyF27MNI0moAai9mu 4DfEeBK4kiuZh0xPNabk8wkA7+faNm0/oK0/XuSKNGrVMk+OCni0RoVrZcJSMBIXk55W lAXMsx6nL0OjjYgzUqf25lXXUGI4NLumOQWc9p67K51nbyezAPOsFh1wewQRQrrs4J5F j/LlueLGZ14HH532lr3gtG2DOTeAfa5oeGi+u4laYNWZhkD07xSrl3AkaFYi4OxX5Q7G ximz7nUE5FJavP9GnUO9zfvOP/YF/loZX+zsV/MmTHOCpnXkfNzGFPglzoTNZwTJADGq J3TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R5NXGadO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32si1757363pje.70.2019.06.26.03.28.20; Wed, 26 Jun 2019 03:28:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R5NXGadO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727221AbfFZK2T (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:19 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43942 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727147AbfFZK2G (ORCPT ); Wed, 26 Jun 2019 06:28:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id p13so2071184wru.10 for ; Wed, 26 Jun 2019 03:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mvSt9hJ9riivcaZUoiXx5QKwOryBX80+CmAuVklqVuY=; b=R5NXGadOK14TqMvGFxi5JBu0gnCPHKST2RzdeMIqI3j+ns642EdrPmjEwDrJlZNxdL 0poBYaMQpPcvKLibCyqWRYdXSWbKgO8BvSHYDPFEDJSM9o4f7VgqBQOfBN7WBHSZj0kd amqwmru4k9QFqpsb9W5oYqGTk8bEFYdWhJdeipf4CZW4CLsI3j/r0Iul69JRS+pWdLEF 92gr3Hg5vY/TZyZg4UYxENt89GDwoXXhIdlCRKKE24hFUtugO3hA9d7FZw/nxjhcWkUw BiAGE0mKurK4Jee+XfvSy+mvQ4ZknfbEW1HJZAS7wvx7F2eJtmeRT0h5QPJ2x1isr5GK DoRQ== 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:mime-version:content-transfer-encoding; bh=mvSt9hJ9riivcaZUoiXx5QKwOryBX80+CmAuVklqVuY=; b=kFkRstgxcupI4Sk+OE1F9xj9I85j/usYcpnTcNqUDQcfMflirsR15fyModUU0jSVaC jTCZEkfOW64fWdzbj0io3PEGJPImwEysnY0x0c3JayuYzeJ4NbuogMTnvpEIZiA2EMDl GZloKSVmOipTeEZMWsr7/8dlXEP4oHCPDbncAKYhVQR7otxMqHI8ZmtR4llmdyheyYsj 6hX9CSuhJmNabL80cnwU8X/mfmEOrZhvfmkuudWoPr7fdL+391eFXVj4gDuzsZrWAtlc Qt+DpBwOzlvMy2aJpGpFZBiTJ/bfuTWeKxPOolFbcM3y0dFMzASi3iD60vPz8dp3mNhP 62pw== X-Gm-Message-State: APjAAAUMFcnt1/a1KvCq8XRLLNxf9ZI+UpeYoW5G9dIWtsFLNVfLquBc xKwf3h5dhPEgZr2Fa0zI5G6glg== X-Received: by 2002:adf:ea4a:: with SMTP id j10mr3038947wrn.3.1561544884817; Wed, 26 Jun 2019 03:28:04 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:04 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue , Srinivas Kandagatla Subject: [PATCH 4/6] nvmem: imx-ocotp: Add i.MX8MM support Date: Wed, 26 Jun 2019 11:27:31 +0100 Message-Id: <20190626102733.11708-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue This patch adds support to burn the fuses on the i.MX8MM. https://www.nxp.com/webapp/Download?colCode=IMX8MMRM The i.MX8MM is similar to i.MX6 processors in terms of addressing and clock setup. The documentation specifies 60 discreet OTP registers but, the fusemap address space encompasses up to 256 registers. We map the entire putative 256 OTP registers. Signed-off-by: Bryan O'Donoghue Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index b7dacf53c715..340ab336f987 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -473,6 +473,12 @@ static const struct ocotp_params imx8mq_params = { .set_timing = imx_ocotp_set_imx7_timing, }; +static const struct ocotp_params imx8mm_params = { + .nregs = 256, + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, +}; + static const struct of_device_id imx_ocotp_dt_ids[] = { { .compatible = "fsl,imx6q-ocotp", .data = &imx6q_params }, { .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_params }, @@ -483,6 +489,7 @@ static const struct of_device_id imx_ocotp_dt_ids[] = { { .compatible = "fsl,imx6sll-ocotp", .data = &imx6sll_params }, { .compatible = "fsl,imx7ulp-ocotp", .data = &imx7ulp_params }, { .compatible = "fsl,imx8mq-ocotp", .data = &imx8mq_params }, + { .compatible = "fsl,imx8mm-ocotp", .data = &imx8mm_params }, { }, }; MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids); From patchwork Wed Jun 26 10:27:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167792 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760270ilk; Wed, 26 Jun 2019 03:28:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA6Wd0PUkmByafOG42qYhfOJKwihRPzAigc9TXqoKD3+g+vWhA1ZOk/QXR05pKgyxxfTRR X-Received: by 2002:a17:902:b487:: with SMTP id y7mr4469884plr.219.1561544891448; Wed, 26 Jun 2019 03:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544891; cv=none; d=google.com; s=arc-20160816; b=WHp1nad8TkQ1OjGxWCEd0JzqvflOxeO8JCxbNYPLcW3p8qz5bGJmlfwg0PYP2dQkaB myIEeXqve3nzzD/R1Dvyd+D0+tGbgHMao3uJJQObJ7CNy1rQhmVXwH4p7jHX3CwVQAMt XPhCZacJzoLX2V3PjIOD19vuFugiAP34R94zpKyvciRcgqPmeRkYY1RRp4BxmfJ+bN/w wJjHukhGvy9UzsPqm6nqI4QFwpQroFbBnSn0ctI4lrKNtlTieApgQLtmi0P0YM5hUVl5 pPTZAbmp+E5Rc1N5u3+E2RkrUB1d77k0Ix7DS4smcKrL6U1/o9wdaDOMFVjX2ewswYgR ag9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5uzszV+7Ya3X0Ti8Q3j+2HtrxZYyAMfNJvKRoru6OH8=; b=oF2v5HzQZ1wNCrE1yQsp17Zic6LeLHgPervzO4xTBRZa4jw1Vbc5/lAqLVZRmCZ5gn /S7kfWUCVyhVIaPmPoA2ZfNjBR48GWW9zLytfL0h9xRA7Ar8lpUV3xCQQv/dO3gSfGRI t4bOSl927cFsiWZdYK1vAZBd9gvaXW8lIIkEZGa/zhtS3yVu4YDqW9f5rM+Pj4phSkq2 ePruDGv091znAsuRo0JBZqasBDpJJQFd+tI8v4Ac9fpbJ2Lv4E8ZwZW5X4I6YRQA0Qpx 3434ldrQKxThXDkpAPrNmPRgyA/wXiqsccNig2Yr0y5i25V2DVeGWLkj7xSs9JGkH8lL XwEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxB4Rfur; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si3068839plb.407.2019.06.26.03.28.11; Wed, 26 Jun 2019 03:28:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxB4Rfur; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbfFZK2J (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:09 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33290 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfFZK2H (ORCPT ); Wed, 26 Jun 2019 06:28:07 -0400 Received: by mail-wr1-f66.google.com with SMTP id n9so2127775wru.0 for ; Wed, 26 Jun 2019 03:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5uzszV+7Ya3X0Ti8Q3j+2HtrxZYyAMfNJvKRoru6OH8=; b=WxB4RfuruC/yhs4Ah8lZU7dPpnMc3rmfsmOYiXZIjFaaiKpKUyDWvEZrq2JnMwwanr kvhkjQDzMf5yGS0Hfs58/UFdyYu3k6QhNBNNO52M/0j5G3GphUbG1XAnosFEvULcorOb zsUK74hfTp17R+H5cgo4nM/sd5jPhV5XS/q9mwz16sbanKtyJUPXQMqTqy7AEq6p/+nc JiLpwMDy230jq4H7Fuu7lCsSWy3d8tG0TFLnZEXc5NOVyQhIdqhtF3S+HANndt517xhI X51m4mCErjy4cfilG6QuWjoMF3gHYjg8WQt1o/NrhaYZv5yO1CluxMO0grbW6kW5aNoh 15Yw== 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:mime-version:content-transfer-encoding; bh=5uzszV+7Ya3X0Ti8Q3j+2HtrxZYyAMfNJvKRoru6OH8=; b=lqS2Dx0fu1TDRo+2gq3trmYJ5+GypU03Qkj5fUBenfNRzsaLs/Hv82GPdzfs5jka3Z 3cz+Av5z+1mZ2XopkW3aDgqeEr0qdVjMmj60jevLZb/1FDpGz1GAlHr/K6RaIFLVJAm7 au+mBysx73hdIs6iVRIVeZk0smrKs4Y7aWItD30cPBIysUHr8XymX7tSiOs4oB/zk/Cy wuhs4H/lBg3/rC55OcbJoMVByInQ8nKqSLrWuXYVoaF9DMR+RNnOydC50nQNcGWd44Di rUTqzykTD751UMkTZuUJAqepRUjXYVTk0YiuYE5Rtac4rGBi8Qef058AcEDYzBijdsrm b+vg== X-Gm-Message-State: APjAAAUOzsE3v1OGRYzctOuPT/0XuDsqcbfOiXra3/RFH7xm9PIFd54f +BgassKHS5NVCqTYgN0UVMM1wA== X-Received: by 2002:adf:ea8b:: with SMTP id s11mr3069165wrm.100.1561544885665; Wed, 26 Jun 2019 03:28:05 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:05 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue , Rob Herring , Leonard Crestez , Srinivas Kandagatla Subject: [PATCH 5/6] dt-bindings: imx-ocotp: Add i.MX8MM compatible Date: Wed, 26 Jun 2019 11:27:32 +0100 Message-Id: <20190626102733.11708-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bryan O'Donoghue Add compatible for i.MX8MM as per arch/arm64/boot/dts/freescale/imx8mm.dtsi Signed-off-by: Bryan O'Donoghue Cc: Rob Herring Reviewed-by: Leonard Crestez Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/imx-ocotp.txt | 1 + 1 file changed, 1 insertion(+) -- 2.21.0 diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt index 68f7d6fdd140..96ffd06d2ca8 100644 --- a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt @@ -15,6 +15,7 @@ Required properties: "fsl,imx6sll-ocotp" (i.MX6SLL), "fsl,imx7ulp-ocotp" (i.MX7ULP), "fsl,imx8mq-ocotp" (i.MX8MQ), + "fsl,imx8mm-ocotp" (i.MX8MM), followed by "syscon". - #address-cells : Should be 1 - #size-cells : Should be 1 From patchwork Wed Jun 26 10:27:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 167794 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp760351ilk; Wed, 26 Jun 2019 03:28:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMWONy3TdGJd8I+wr0txa1KfFacDNmonms4i5IA7i0w0EaVyIuiBnvlGvA1vcZsTgU8BCm X-Received: by 2002:a63:7f07:: with SMTP id a7mr2226360pgd.26.1561544896518; Wed, 26 Jun 2019 03:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561544896; cv=none; d=google.com; s=arc-20160816; b=ZKfczxe2+TKXLtXMvTLJRvd2sQYukecK2RIyKJ873yxIf8h1Q14/y0k/IUK8kzpeCv EUGdM/QHDUh+MBJN8e51DEpySBsf2W7FxR8Dqgk7ulSJ/rb5UELa9c9mSnffre04J/+6 GhrS9qoF1KsQFVXH7HDTDQkqD7/FpnvYB6+cKQ0kLwbqlHXU/ZDgKlVUE0kNoloWVYvM xbHXR+bZtNDJSy1ozAIp6WYsOA/YdD0351MB2avg5u6rgujPYtZpzuEhJdKef0nHjIt5 qKN7BD6ylGXqzO0g4mCL2U8vyLCyc/EcHCmpG+5TIHB7NehtenwWZMHyF8X9fLgVFvNI 1ePA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YlUbQ+VAs6rWA6NRDoG6hvS1TSsas8Yc/9cAu2pyMdM=; b=nAaWC9xGpEu7P+Z7S/f4ENvT/KlpXMCe9ByglkLeuh+x4sSVzgv8g77O7A1/fom6fL +r7EULaBb9DHRVqj2mCeNc9avfwraAHAyuViMgo/xooWvVlqLKnaHbuDkILnl5Eg88oO +BAbEmbDHw2rI2bPtBz0y/xRkilbCIIPNqgUEwRJb6IWbH9h6h8wmrKnXi82EorgMooc u2A3P4Xtokamxg1PY2bxSZWJCgtFjX6pFwXjOJxmGG1cWdvn18atlydZ4nq3iwAjStdH VBSovCXgqPnM3VSdvKqh2QakXTwvsVUqUgbjpVBS7MIK7+y+9xchlyq31XUYudyl4K4m /lPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tIP3gvod; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si3068839plb.407.2019.06.26.03.28.16; Wed, 26 Jun 2019 03:28:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tIP3gvod; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbfFZK2P (ORCPT + 30 others); Wed, 26 Jun 2019 06:28:15 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43946 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727168AbfFZK2I (ORCPT ); Wed, 26 Jun 2019 06:28:08 -0400 Received: by mail-wr1-f66.google.com with SMTP id p13so2071295wru.10 for ; Wed, 26 Jun 2019 03:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlUbQ+VAs6rWA6NRDoG6hvS1TSsas8Yc/9cAu2pyMdM=; b=tIP3gvod44Al3x47FF+xsWez/VYa6b2gxC0T7uJxplv8LEGvSgo6R3SDZz492YQ/+/ +VovSEh7PJA08ySm+1GfbAQ7HwhQZtiw0BZvRCJLEyLY04OMJybeD+9qINWfh6bVzcnP eEk+ZAJz45tZC9S6V/quFPVTZ68gZspxFQ308vbbm+nRqr2CFveIxzGqVgnGTTi9VsEc J0p9ZnXcLVwOu5s8bAHyS0UxeS3p6cxct4AbJVM33Tat75A44rCL1B990eE9CR6Z0QZA V4VO77aUOjFct0GPFtCcmxZspZhj7MzGSaKkIrvUENsUU9uCCos4vCg6lQCN3VIxteqp JP4w== 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:mime-version:content-transfer-encoding; bh=YlUbQ+VAs6rWA6NRDoG6hvS1TSsas8Yc/9cAu2pyMdM=; b=ZWj+6qv/O8cHDmdid1eLLuGYF6bqPSxGiu5xjdsJkAajAu9VlOO7PImfD0XPfkV7mz ENC3A6Ek3wnHMfQhOjpL1KEsWb/TF7+O8VsApaHI2hyPO/KR8QpcT4ukG4eBsQeh1jaI 8AeUg1HW1Tj5BzDxSsdglPVdiCkH2qafDejsXo2e7XTU/dgSmFvftNSeknaZzknieT87 a/crnNVmRY1jsLuGwA8qcgYYYxVEb1a/hU9dXvKZ6UZGc7kBMNAHI0s1muLzga6KSyy3 ES554DRqsdOnz7hNTqY7X3PdHjVco8dPaKO29AwtzHXhrZ6VION5Twp6B5bmHlTD4dgy nUow== X-Gm-Message-State: APjAAAWm9UKibwIbxofz4/W5FQXOefJVj7E/pWWKxHiRzxhrqNr3huo5 eZJbRThGbUwYEadP1xoVG+mj/0da98M= X-Received: by 2002:a5d:430c:: with SMTP id h12mr3100824wrq.163.1561544886476; Wed, 26 Jun 2019 03:28:06 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id z19sm2212042wmi.7.2019.06.26.03.28.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:28:06 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Leonard Crestez , Peng Fan , Srinivas Kandagatla Subject: [PATCH 6/6] nvmem: imx-ocotp: imx8mq is compatible with imx6 not imx7 Date: Wed, 26 Jun 2019 11:27:33 +0100 Message-Id: <20190626102733.11708-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> References: <20190626102733.11708-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leonard Crestez According to NXP Reference Manuals and uboot/atf sources the OCOTP block on imx8m behaves more like imx6 than imx7. - Fuses can be read/written 32bits at a time (no imx7-like banking) - The OCOTP_HW_OCOTP_TIMING register is like imx6 not imx7 Since nvmem doesn't support uboot-style "sense" and "override" this issue only affected "write" which is very rarely used. Fixes: 163c0dbd0cb1 ("nvmem: imx-ocotp: add support for imx8mq") Signed-off-by: Leonard Crestez Reviewed-by: Peng Fan Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 340ab336f987..42d4451e7d67 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -469,8 +469,8 @@ static const struct ocotp_params imx7ulp_params = { static const struct ocotp_params imx8mq_params = { .nregs = 256, - .bank_address_words = 4, - .set_timing = imx_ocotp_set_imx7_timing, + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, }; static const struct ocotp_params imx8mm_params = {