Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2246630ybi; Thu, 4 Jul 2019 07:30:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXX5e5njY8UhNw+77WNJLu3ByDvTuw2P1MEehEamcaTWnxDtTLXdJgndR+LuGSswic0XU3 X-Received: by 2002:a17:90a:ad86:: with SMTP id s6mr20233544pjq.42.1562250602462; Thu, 04 Jul 2019 07:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562250602; cv=none; d=google.com; s=arc-20160816; b=Lxcj4r5SvlAYOKbka3r+ABRpvCsU40WOA3N70ThJO/93+0ZzCsLvQaJMCPa1gEKH/K kAMaMKVQE6+euH/Fs6t/jMORv+j5GF6u2M5eAvbQMhLiURrwUvop6yJVcjci7pBn7KIe Ttt9/z7PKPun5gWGFHK51j4bly9Y8G/JMpj8z4Jq6I7hm3Fwrezi+rKNXdvFJUqXAzEV 5/soyJUaHyDYn10l5KYggpYhB5gS+e/eg5OCIZ4YbdpEwjPpe4706HijbCJNIReJDl2M jEiuyiZCXpUN17FvP5oPXRF8yODrB3LRZPx4zqUkfn2t+FrU1yZ11GNuayqvQ8k/pBEz 634A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=6Q4Y6z0clt1tc+87L6F4HcWcJ+kWOdPEqWTJ5q1WahU=; b=GIDU1tsSlJ6OycwQi0a8Nb9LLjWjxVTyzBJILqcr/yX1Ye/oiFUk7E5ssmc7MFRJ06 LLsthYGEVZlSYR4BJprMslm7SiRQJJT+K8Enz67KMUncJmoFjiqC/9frFk9xG2NfERV3 lnpZXXIoBypze5723T7+oFMCjqmfKZ4neowS20FZfvqDeCkUmAJjYCDwG8Yii4lEbESq xQncA0i6LhR0ww7aF7U23eQShg34zAT6uAvuDOMKNFjNYpc89Jw3ZIrQODf8K/5z7TGb YlO5DxGw9PuDKFwz2AHcn7X02boc+Ok3329sS+Gg4g4J1uRfINCw6ZCWWCunlm4zTZ/R wC3w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si5451706pgw.451.2019.07.04.07.29.47; Thu, 04 Jul 2019 07:30:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbfGDO3V (ORCPT + 99 others); Thu, 4 Jul 2019 10:29:21 -0400 Received: from inva021.nxp.com ([92.121.34.21]:40172 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbfGDO3V (ORCPT ); Thu, 4 Jul 2019 10:29:21 -0400 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 Cc: gregkh@linuxfoundation.org, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fugang.duan@nxp.com 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4