Message ID | 20190419164808.23236-4-pure.logic@nexus-software.ie (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> 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 183DA922 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 19 Apr 2019 16:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B45C28CA3 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 19 Apr 2019 16:48:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F33F828CD7; Fri, 19 Apr 2019 16:48:58 +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 A1C2B28CA3 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 19 Apr 2019 16:48:58 +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: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=Skxm69WZZXjXkwJ02kEFqH00Mq56Wpq4xeV2+ZAoK4M=; b=mU8A7A4Xkin62N 4lZNM5P5H5QaZbdww8Ls3Z6bj3SJR4Xz17TQnkAYzof2iVJ++9NPnjS75KKBuwxbSbpTDFxA6jrKK jgMYy38I5yy1+K+SB1RNBvOIKz2fUqVRpjNjAZBJ9JVL96pe7vjcJGqWs/9Hv9dEbFPq6Zl9Ap+y6 +KqJmQI+68lpXQVq/YVSpPMi5Ly1XC0THD9d+cALxaBFOE99Zs/DleR3tpZILdyklqfw/MpG1V3RH dhy0FwlT+ZJoOUMs4QFrFZ0sTSDRrfRsuYr1nebN/ks1H+Uo6FIFRBKKJ7+ilE/mE8JjyhhFyNCrm U46PPecVlWMLk6wylEGQ==; 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 1hHWh7-0002Ny-2M; Fri, 19 Apr 2019 16:48:57 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHWgT-0001hG-Kj for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2019 16:48:19 +0000 Received: by mail-ed1-x543.google.com with SMTP id u23so4498851eds.9 for <linux-arm-kernel@lists.infradead.org>; Fri, 19 Apr 2019 09:48:17 -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 :mime-version:content-transfer-encoding; bh=6ps838Dlj+6qHtOe0XaK3an5MOfwt1ArrpYzao/jeKs=; b=pnnY2zrBpnTQu8OzawyrE+UYLH/jr6c4GMj1ypspfpI5TpmErye89WBS1RyQsC0L7S sozVuYsISpqKckejUFqZrhyyvgzVi74C+tBn/POt/z8TcAtV6jIFtYs2p7sd6Knpz+rE zisMsNGk6/zkEMDTIdB/+ouKVW+ZU2KR1DSu92H/+6NXekYu+sqBMcxR7OXJP2w9Lvod awp+VmftwpG1CzFs1hDKmg52mzIMWQRL51wQsmbn6blRDTQovu+G49JXCJqdhfp+wiWp O4Mh2XM0DkysO5d8wwN6OGItuRnBdPcK8eslz6oGZQygu9wZRooTYcW9+gX0EthbLGhj j3mQ== 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=6ps838Dlj+6qHtOe0XaK3an5MOfwt1ArrpYzao/jeKs=; b=INVIt9q8+O2XxrlJgrxrUGCEIQ/WmCzQIbhFI2cwKUtoY44PoHiQ1pgSEeAflcOzl2 XkI9etQsGRN7zY91EbmDv/uLzCGUXXwYC+zn9++nkidxVaVbq69Wh2SqbTnZt0ShHwie k1k2IkAqJKuHxTj+bkcaPAdnRVqu8J9uC+fRIOow3kwvXNQHj5AeLSpRPo7d9T3DbB3H rwfBEsVuT5MMsk4a8AaK+CobGvWvJaMW5tUH+EmaR6P4i5Ooks5mw+HEy6Vfece8/Wwv 4JJtvuw6FcHYP+XbJJ4KTbskIn05N6bUXnWDJ8W6OxihyQ8DdM0R7LQCLLY8fDGWqoHT 9nCg== X-Gm-Message-State: APjAAAViVYvQZ9qaQsW0q2rI0YH0w6I73fxtd+fRQ6X5zd/GLVtXKW8n leQqIeeysSQZeqOoJaffPIRgqg== X-Google-Smtp-Source: APXvYqwYAMUZ4DmnbPlLF4VX7Y+ICXR/Yab4LW6FIlgyYnbaID0Gjt/B5Olmsu571h19jmkuK2W5zA== X-Received: by 2002:a17:906:c348:: with SMTP id ci8mr2472996ejb.74.1555692496079; Fri, 19 Apr 2019 09:48:16 -0700 (PDT) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id e17sm955380eja.33.2019.04.19.09.48.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 09:48:15 -0700 (PDT) From: Bryan O'Donoghue <pure.logic@nexus-software.ie> To: l.stach@pengutronix.de, peng.fan@nxp.com, shawnguo@kernel.org, srinivas.kandagatla@linaro.org, leonard.crestez@nxp.com Subject: [PATCH v2 3/5] nvmem: imx-ocotp: Ensure the RELAX field is non-zero Date: Fri, 19 Apr 2019 17:48:06 +0100 Message-Id: <20190419164808.23236-4-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190419164808.23236-1-pure.logic@nexus-software.ie> References: <20190419164808.23236-1-pure.logic@nexus-software.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190419_094817_715636_105319DE X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=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 <pure.logic@nexus-software.ie>, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Add i.MX8MM support
|
expand
|
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 85a7d0da3abb..5b625d61e433 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -186,6 +186,8 @@ static void imx_ocotp_set_imx6_timing(struct ocotp_priv *priv) clk_rate = clk_get_rate(priv->clk); relax = clk_rate / (1000000000 / DEF_RELAX) - 1; + if (!relax) + relax = 1; strobe_prog = clk_rate / (1000000000 / 10000) + 2 * (DEF_RELAX + 1) - 1; strobe_read = clk_rate / (1000000000 / 40) + 2 * (DEF_RELAX + 1) - 1;
The RELAX field of the OCOTP block quote "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". On the i.MX8MM the calculation for the RELAX value is turning out to be zero which is not a problem for programming OTP values but, does subsequently mess up reloading the OTP shadow registers. This patch ensures the RELAX field is at least one ipg_clk cycle, which seems like a pretty obvious floor to place on a value such as this. Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> --- drivers/nvmem/imx-ocotp.c | 2 ++ 1 file changed, 2 insertions(+)