From patchwork Thu Apr 25 13:34:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 10917089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E60E14C0 for ; Thu, 25 Apr 2019 13:34:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F07E522362 for ; Thu, 25 Apr 2019 13:34:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4588289C0; Thu, 25 Apr 2019 13:34:45 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 2F84F22362 for ; Thu, 25 Apr 2019 13:34:45 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=Y7DvELRHd8m8MnNBKaaeebgiSQeWZB2DQ3pOdFbwyXE=; b=CMStPH9Eq9IDlm 6/xPXVoPnSdPc+q1qg+kwQVeJMD0tPuDm8QnJe4IA78Gaj+cGkiECA2dwOXaX9dpYICcAZM/6lmyZ uUh84+ZOe4KAa8FbhKc2nLNRp+hREtkPORBucbmcQueXXSf06Iq0OtArq7gYyp4n/oYgYmXqwJ0GJ guHWUZb+mLyD2SbYlT/nBUAE4C4JFiaUhvPz1MwyUKtVs7hwP+uMAYCs2TgeySypctCxm91GiSNip mlNtdtpKDqSazFtgSvQuJK/+n3UDKw4xDac0OjoAUhAkuTAwAWtAHnAEmZYysuNCI0tHhyJvLrgAx Y1/hGtflUL5tvedRdEPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJeWM-0006UR-OC; Thu, 25 Apr 2019 13:34:38 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJeWI-0006Rn-QZ for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2019 13:34:36 +0000 Received: by mail-ed1-x544.google.com with SMTP id j20so19160125edq.10 for ; Thu, 25 Apr 2019 06:34:31 -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:mime-version :content-transfer-encoding; bh=ieoHTH/LiMT8JooBRueqd/BFniWCDOnPH9RCo5UY+vY=; b=gcBtFQ0DvjmWq12n7x2Uzoddxt2x9m4/qUxZ/kdPRPpQ+q4gSgirTyYyiMhS0YhBAc oK+/1odjLkP1x+A+ixkuTnemKbCnaR5NMc4yiBmtVUSQ1axQkZSdltYLBPSQ1MNB+47n ggnzx9gGVpXaHCyZXWaS5ne7JtoD2FSCPx5744GkEx9TAckJ5+JMc8wcCsvSvG0/VhXh Z9AN68BXDNCoyXDmhB53oswCaPlkrlFZbXadCUVOTGiKowDA9z+43j87GTEH45A/JeoF TNhYFzNN/4Z1guYs79ArCwpUXqpLZgaGZzzjZnu0bmxwNMgPa7fOvaNR6mJmDZ5Hoa+Y T8cg== 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:mime-version :content-transfer-encoding; bh=ieoHTH/LiMT8JooBRueqd/BFniWCDOnPH9RCo5UY+vY=; b=i3UUn33vCPupqySVOagizCaVOrTZtvrbAmUK2cpLuFR2UeXoyV/QCsK4RlwX0yKQFy o+h6M4+dqooqwkYSLTkyFdX5XSt383mRgNgh4edcAqaPirldVDDthxjB2o4vPEgy8rRI Dw0EhyiFBrhfSVh2otwTZQMnKfzsJUDJprK2Cv+sSBcudIDRWzDXAuP+nEjNyGfMqOeY L72AGNkXx4jit7XM3L5EWcrSg+FszZQYacxWSMUXnYtgbVmJqk/b8Yp7resfVc58Bz+a IjrTrclfE+liZrD+RSbhhPux+FDb3sVGcjoBjmBkYM71JGsNm7hxpHLbZabU4x0aOq++ RDoQ== X-Gm-Message-State: APjAAAVc0Yqd+CYqkDRTgbCYOmNBDA4dRmKfx/ABQbuV/uK7Hybw/pST LXMd68B4IZCZWPO+rlvRRwfwIA== X-Google-Smtp-Source: APXvYqysinOSJ2/oHj/U8vPFT4p6Ey0PFfVuh26AVdqcGxZDHjbO/5DlxR2jJ8DG50FTMTtMY2JOOQ== X-Received: by 2002:a05:6402:1711:: with SMTP id y17mr23776389edu.275.1556199270252; Thu, 25 Apr 2019 06:34:30 -0700 (PDT) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id k20sm4027084edb.9.2019.04.25.06.34.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 06:34:29 -0700 (PDT) From: Bryan O'Donoghue To: l.stach@pengutronix.de, peng.fan@nxp.com, shawnguo@kernel.org, srinivas.kandagatla@linaro.org, leonard.crestez@nxp.com Subject: [PATCH v6 0/5] Add i.MX8MM support Date: Thu, 25 Apr 2019 14:34:22 +0100 Message-Id: <20190425133427.30648-1-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_063435_038053_CB5D4D5F X-CRM114-Status: GOOD ( 13.27 ) 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: aisheng.dong@nxp.com, abel.vesa@nxp.com, anson.huang@nxp.com, linux-imx@nxp.com, kernel@pengutronix.de, fabio.estevam@nxp.com, Bryan O'Donoghue , linux-arm-kernel@lists.infradead.org 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 V6: - Drop BV_ prefix from u-boot timing defines - Add RB Leonard V5: - Adopt u-boot method of calculating timings. On the basis that the OTP registers have a programming time that is not related to the ipg_clk rate specify the various timing inputs to the RELAX, STROBE_READ and STROBE_PROG as-is done in u-boot. The wait time to burn a given OTP fuse is not documented anywhere except in code in u-boot. The ipg_clk then is used to clock the registers in the OCOTP block and to tell the OCOTP block how long to wait for programming to complete and how long to delay before doing an automatic re-read of the registers. Tested on the i.MX8MM-EVK relax = 1 strobe_read 6 strobe_prog 670 V4: - Change the RELAX fix to drop subtraction of -1 for all users - Leonard - Expand register definition from the 60 documented OTP registers to the entire 256 registers putatively in the address space* - Add Reviewed-by as indicated - Leonard - Added Suggested-by where it made sense - Bryan * Dumping the expanded address space shows that there are indeed OTP values present that can be read back from registers that are not formally documented for i.MX8MM eg. Bank 20 0x55000801 0x00014d14 0xd503201f 0x55000801 Bank 21 0x00014d20 0xd503201f 0x00000000 0x00000000 V3: - Fix commit log for the expanding the ADDR field i.MX6 uses seven not four bits, which is why the existing define says 0x7F not 0x0F - bod V2: - Rebased to linux-next/master to align with i.8MQ work - Two patches dropped as a result of rebase - Added patch to expand OCOTP_CTRL_ADDR to 8 bits for all users - Leonard - Makes sure nregs = 60 not 64 for i.MX8MM - Tested imx8mm-evk, imx7s-warp7 V1: This set adds support for the i.MX8MM. When adding support for this processor there are two interesting gotchas to watch for. #1 We current do not preserve the WAIT field for i.MX6 and since we are reusing the i.MX6 set_timing() values, this would also affect i.MX8. On the face of it, it appears to be an inocuous error with no real side effects. #2 Secondly the i.MX8MM will calculate a zero value for the RELAX bit-field when programming up OTP fuses. This is fine for programming the fuses but, it introduces a strange failure state with reloading the shadow registers subsequent to blowing an OTP fuse. The second important patch here then is ensuring the RELAX field is non-zero to avoid the failure state. Bryan O'Donoghue (5): nvmem: imx-ocotp: Elongate OCOTP_CTRL ADDR field to eight bits nvmem: imx-ocotp: Ensure WAIT bits are preserved when setting timing nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm nvmem: imx-ocotp: Add i.MX8MM support dt-bindings: imx-ocotp: Add i.MX8MM compatible .../devicetree/bindings/nvmem/imx-ocotp.txt | 1 + drivers/nvmem/imx-ocotp.c | 48 ++++++++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-)