From patchwork Thu Jul 4 14:20:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Duan X-Patchwork-Id: 11031547 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 BC5E6112C for ; Thu, 4 Jul 2019 14:29:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5DF28AB9 for ; Thu, 4 Jul 2019 14:29:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A98F528ABC; Thu, 4 Jul 2019 14:29:24 +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 4BDDE28ABB for ; Thu, 4 Jul 2019 14:29:24 +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: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=vLq6BI7stYcC+nIdm/WlJlatdUy3AqwPfi4iWQuanNc=; b=lT6 4MuyhRt2EAkiWqpuw3Mb4JuSVPJIp3kiB7iLyY287GVCAZXRNlTativXxCwTUzQskV0raAV5hbTDv Io+0kapv4BYVi0CUHUsjrg2JRXvIR/UqXjfEt4EXlAGD2EWGaWqB7tM7OvheLLk6mybsaTuxFt+SC 3a3HZ00vXpeTtOzqF4aZ1QYkymj1c5Q578DOPWuavBdmPYJjDfgv/o6TDXihuuVcdzLcQLe+skypK H7uYFdbtF3uA/TfMpCy/EnEWpFHj2fcGSqA7992xJMebi4s1vh75/srZcK844c+cmfvtnJ8rBVtUr CeU/eqInNeGJ2mT8UZVljUvIIEsHWpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hj2jj-0006L2-TR; Thu, 04 Jul 2019 14:29:23 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hj2jh-0006KZ-B7 for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2019 14:29:22 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B52EE2000B3; Thu, 4 Jul 2019 16:29:19 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E28DB200DA6; Thu, 4 Jul 2019 16:29:14 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2E9FB402C0; Thu, 4 Jul 2019 22:29:09 +0800 (SGT) From: fugang.duan@nxp.com To: srinivas.kandagatla@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH nvmem 1/1] nvmem: imx: correct the fuse word index Date: Thu, 4 Jul 2019 22:20:15 +0800 Message-Id: <20190704142015.10701-1-fugang.duan@nxp.com> X-Mailer: git-send-email 2.14.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190704_072921_518756_6B470987 X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fugang.duan@nxp.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, festevam@gmail.com, 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 From: Fugang Duan iMX8 fuse word index represent as one 4-bytes word, it should not be divided by 4. Exp: - MAC0 address layout in fuse: offset 708: MAC[3] MAC[2] MAC[1] MAC[0] offset 709: XX xx MAC[5] MAC[4] Signed-off-by: Fugang Duan --- drivers/nvmem/imx-ocotp-scu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.c index d9dc482..be2f5f0 100644 --- a/drivers/nvmem/imx-ocotp-scu.c +++ b/drivers/nvmem/imx-ocotp-scu.c @@ -71,8 +71,8 @@ static int imx_scu_ocotp_read(void *context, unsigned int offset, void *p; int i, ret; - index = offset >> 2; - num_bytes = round_up((offset % 4) + bytes, 4); + index = offset; + num_bytes = round_up(bytes, 4); count = num_bytes >> 2; if (count > (priv->data->nregs - index)) @@ -100,7 +100,7 @@ static int imx_scu_ocotp_read(void *context, unsigned int offset, buf++; } - memcpy(val, (u8 *)p + offset % 4, bytes); + memcpy(val, (u8 *)p, bytes); kfree(p);