Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp515440ybg; Tue, 9 Jun 2020 06:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws1E5H5CbSexjXg4DfEN4khkEqUeqthbNHe8iCDFjExHY0+iZgWrnwjy046nRlIx7awOYG X-Received: by 2002:a17:906:d78a:: with SMTP id pj10mr26565003ejb.50.1591709348899; Tue, 09 Jun 2020 06:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591709348; cv=none; d=google.com; s=arc-20160816; b=CeI4SuNT+KocA6zXMJzl0zW/kB+vkz6nkjH+OD8KC7UaOwHdKMNCB6AkBmJK+X/PYP gAyFkT28/ZlpFc5GecCSbN8Xhry3/eRcFm5yhgmDNs8C5Xk7qqk1jSx2VHu9rMaVZWR9 Ab+6NsYRce+UU+DvEcXHyQRpv09vEe8wZL0Gu89aAUJNlEsTRd9XYeYUSppNwJa/0EHd wy4RlebIEcTMAdfLbZemYsA7wnI+xqJFVOk93G238JM3tWhkpUz0eKdqNRvSdF0DK2X+ Gw5eC1BGrhP+nSiEJxyzanGSrpdecfxvT7PYBovCWDxuQUxaPKUKKi3uOA0lheBpiGKX GIoA== 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=e5u1CBK3LnhFFIB0nLqWgsMTCPlMwFO86lLfHHAoNPk=; b=rTl6ZT/SoO6REhuzCROSzREndThMiyZQsbwFqqcyTn+ZYFfavW2ZykloZlJ6jUTDms kr415rQC2fA3VNqXigydli/bOfBBTpoHXCZzijUv2c+XzWpwL5l7Dt7fsbOPma9AH7p9 CtT2lELiG/PS9y1x9AQmwgPLA2K9FtJU/07GO30IIGWFqHgnHb9V9Va11fq9w6pbpiBm qx29L0x/rAG//p/A/kPGX2zwUlddukoodbQWcjns448A+MKV3VFSSoP967V5MfipO4V8 aN2eznGJb6Y2ddsYNNysudkmFmkbPKE/P5yX78GRvP5te9HIMi72MKk//X+3kfKqILP3 JFlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id a19si9461338ejf.724.2020.06.09.06.28.44; Tue, 09 Jun 2020 06:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729023AbgFIN0l (ORCPT + 99 others); Tue, 9 Jun 2020 09:26:41 -0400 Received: from inva021.nxp.com ([92.121.34.21]:47858 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727945AbgFIN0h (ORCPT ); Tue, 9 Jun 2020 09:26:37 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 080982000DD; Tue, 9 Jun 2020 15:26:36 +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 65A11201213; Tue, 9 Jun 2020 15:26:31 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7B7474029F; Tue, 9 Jun 2020 21:26:25 +0800 (SGT) From: Anson Huang To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, leonard.crestez@nxp.com, abel.vesa@nxp.com, l.stach@pengutronix.de, peng.fan@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] soc: imx8m: Correct i.MX8MP UID fuse offset Date: Tue, 9 Jun 2020 21:15:50 +0800 Message-Id: <1591708550-14058-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 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 Correct i.MX8MP UID fuse offset according to fuse map: UID_LOW: 0x420 UID_HIGH: 0x430 Signed-off-by: Anson Huang --- drivers/soc/imx/soc-imx8m.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c index 7b0759a..0bc8314 100644 --- a/drivers/soc/imx/soc-imx8m.c +++ b/drivers/soc/imx/soc-imx8m.c @@ -22,6 +22,8 @@ #define OCOTP_UID_LOW 0x410 #define OCOTP_UID_HIGH 0x420 +#define IMX8MP_OCOTP_UID_OFFSET 0x10 + /* Same as ANADIG_DIGPROG_IMX7D */ #define ANADIG_DIGPROG_IMX8MM 0x800 @@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void) { void __iomem *ocotp_base; struct device_node *np; + u32 offset = of_machine_is_compatible("fsl,imx8mp") ? + IMX8MP_OCOTP_UID_OFFSET : 0; np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp"); if (!np) @@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void) ocotp_base = of_iomap(np, 0); WARN_ON(!ocotp_base); - soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH); + soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset); soc_uid <<= 32; - soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); + soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset); iounmap(ocotp_base); of_node_put(np); -- 2.7.4