Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp327873ybh; Mon, 9 Mar 2020 22:55:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+9GVHqCMgiqGneUZfMlfZCqTmx/Je9QYpnlI5V7nS05Z4IKc2Agql1KdBzyewNINHIEfk X-Received: by 2002:aca:4e47:: with SMTP id c68mr37781oib.16.1583819755324; Mon, 09 Mar 2020 22:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583819755; cv=none; d=google.com; s=arc-20160816; b=wR74Iha2Q+XENH+Kxy/wiVMOdFdboNsR6OUgxe8ia4hMhsaxfuQ3MP06knwVMPbo5c deKFCYBfPg8AonIDGrlIiIXHjU2kmjvET7t6visoNUVv0Dk9eHSewx7MZyoxuFc4WMZV pjF5Md5lfNsUpltKvoV+cu7yEFwnHvMrJYKYN9YlRyjXfHWEgH+ch+f+ZaWr4hd9k6Am WK1YFYJeF5EcGkZ4RdHGDgiHIs8XWLzwAnCyuYbVQ9oYvOiEFlnvqDyV/mncqVA8B8tN orsAA1+4R4RCSHQJdv0LtSSiLV+Cfpz9AE+uydtJBncC9vItMalr/3Y0O6kL2DYJoO+W JHng== 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=60wgqNWOno5DHuysXsPTmCpOAOZdtmNPaEpowdoGVJM=; b=tM/aBJZZa/IgpTJy9BctC8eUUwwAYaBtg0KcJQKiD+KOsdlAUl4r50Eu/A1GiPlDT4 2//JLIZnKjt6m/pcLrT3Ndth+gawCabVJ2SgdIbziEz0pOzeKz5mtYgxjdihriIV+XkN d5V6bWUM9gfJgPv34U+cybeOEpLvp90w+Nlhc793RXbUhF0C4iOJ3QMcOg5zCTFE6k1k xmGQe2BhIwWMfwKzHNsAhrZn6s1smDkqhZsnPFcyq0NAupl9ibexyVxkuy8VcNJxcW2v UGj6DXZumf0yAZe2otRwwOcr4znKzA907k8gKfOBlZQFCCsDfme3g+4uymYEbH4lC+LS RwtA== 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 e24si7209274otq.14.2020.03.09.22.55.43; Mon, 09 Mar 2020 22:55:55 -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 S1726295AbgCJFys (ORCPT + 99 others); Tue, 10 Mar 2020 01:54:48 -0400 Received: from inva021.nxp.com ([92.121.34.21]:44138 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbgCJFyr (ORCPT ); Tue, 10 Mar 2020 01:54:47 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4439F200431; Tue, 10 Mar 2020 06:54:46 +0100 (CET) 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 8A960200438; Tue, 10 Mar 2020 06:54:40 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 79D9B40245; Tue, 10 Mar 2020 13:54:33 +0800 (SGT) From: Anson Huang To: rjw@rjwysocki.net, viresh.kumar@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, abel.vesa@nxp.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] cpufreq: imx-cpufreq-dt: Correct i.MX8MP's market segment fuse location Date: Tue, 10 Mar 2020 13:48:16 +0800 Message-Id: <1583819296-7763-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 i.MX8MP's market segment fuse field is bit[6:5], correct it. Fixes: 83fe39ad0a48 ("cpufreq: imx-cpufreq-dt: Add i.MX8MP support") Signed-off-by: Anson Huang --- drivers/cpufreq/imx-cpufreq-dt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 0e29d88..de206d2 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -19,6 +19,8 @@ #define IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK (0xf << 8) #define OCOTP_CFG3_MKT_SEGMENT_SHIFT 6 #define OCOTP_CFG3_MKT_SEGMENT_MASK (0x3 << 6) +#define IMX8MP_OCOTP_CFG3_MKT_SEGMENT_SHIFT 5 +#define IMX8MP_OCOTP_CFG3_MKT_SEGMENT_MASK (0x3 << 5) /* cpufreq-dt device registered by imx-cpufreq-dt */ static struct platform_device *cpufreq_dt_pdev; @@ -45,7 +47,13 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) else speed_grade = (cell_value & OCOTP_CFG3_SPEED_GRADE_MASK) >> OCOTP_CFG3_SPEED_GRADE_SHIFT; - mkt_segment = (cell_value & OCOTP_CFG3_MKT_SEGMENT_MASK) >> OCOTP_CFG3_MKT_SEGMENT_SHIFT; + + if (of_machine_is_compatible("fsl,imx8mp")) + mkt_segment = (cell_value & IMX8MP_OCOTP_CFG3_MKT_SEGMENT_MASK) + >> IMX8MP_OCOTP_CFG3_MKT_SEGMENT_SHIFT; + else + mkt_segment = (cell_value & OCOTP_CFG3_MKT_SEGMENT_MASK) + >> OCOTP_CFG3_MKT_SEGMENT_SHIFT; /* * Early samples without fuses written report "0 0" which may NOT -- 2.7.4