Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1283606ybl; Sat, 17 Aug 2019 23:52:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjM2FmrptxPxCJxT/KOyRYYIuHstWjAcu/k6ehBYZsNDlehR1Dxb4F8ibyGsjWSWNalPxJ X-Received: by 2002:a05:6a00:c7:: with SMTP id e7mr18548836pfj.52.1566111179111; Sat, 17 Aug 2019 23:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566111179; cv=none; d=google.com; s=arc-20160816; b=nZI3s8z87Bmkorn4FUBR3Gkqa5qHfPwyiSK5HYjXmpeqnfuZr6frQS82YvdNOvmegl kttrAAT0ol1Z27CiyLp5HT8tTIGcf3t7I8Vm2wA61U3LGB2nghZH/v6EQOAa4Ie7+UyK ckU4/5CpfbTzTUPA0S35n1iBV4i9hhNTeURpbwMd//EjZwFW4TYOPAsVA7Q7atg9vWDK l0gHmusippPZbRSckCTsBYuYydXIgy3uUlORdKmI3iJ/N6EvkUozbQkQCrlgvmud9MNq Q+ewaV7MrfBQiarMx+kRH0K0HdyEI2S2KCHBFKU4GgIl3W9JEn5LF1DccKXAyF9bYUC+ tkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=UWUrQkoMZpHqKDCfbRLUukuMvQGAFwTt36kYAXjkqMs=; b=eG8ESh6I6uQ30mmEER0zrd90MccDenXNQUrrHqhFuk7VLmFuj7QWzgOthZ5bIYWaIm JOcUG1pvf5qVNTeCvsaWztYudEda7sZddE+5SEJIOLUvS8UwCbsxzS0N8Q5VXhKumkhy JtaWdPamOQjqFq56kzqVN/Lonat9CNRDkBIs0IZSCO3KC2Kxf7dVpcLMTS3vihpkYZDC AJvqz25FAaUHS96QmSEsdSQq/Rez3RWJR0Aae86G394pvY57X9lyxBrB//5UxlH9QNyZ wxcaob4HWCXAA2Tk098iF965mhakqBn/3Xm15H8ObCMfRhaWcWc8koWBdUXOSNpu416y fJDA== 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 w4si7271487ply.247.2019.08.17.23.52.44; Sat, 17 Aug 2019 23:52:59 -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 S1726610AbfHRGvK (ORCPT + 99 others); Sun, 18 Aug 2019 02:51:10 -0400 Received: from inva020.nxp.com ([92.121.34.13]:50474 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbfHRGvJ (ORCPT ); Sun, 18 Aug 2019 02:51:09 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9BD741A02EC; Sun, 18 Aug 2019 08:51:06 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B78771A00D1; Sun, 18 Aug 2019 08:50:58 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EDF3C40318; Sun, 18 Aug 2019 14:50:48 +0800 (SGT) From: Anson Huang To: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, leonard.crestez@nxp.com, abel.vesa@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH RESEND V2 4/7] cpufreq: imx-cpufreq-dt: Add i.MX8MN support Date: Sun, 18 Aug 2019 02:32:22 -0400 Message-Id: <1566109945-11149-4-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566109945-11149-1-git-send-email-Anson.Huang@nxp.com> References: <1566109945-11149-1-git-send-email-Anson.Huang@nxp.com> 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.MX8MN has different speed grading definition as below, it has 4 bits to define speed grading, add support for it. SPEED_GRADE[3:0] MHz 0000 2300 0001 2200 0010 2100 0011 2000 0100 1900 0101 1800 0110 1700 0111 1600 1000 1500 1001 1400 1010 1300 1011 1200 1100 1100 1101 1000 1110 900 1111 800 Signed-off-by: Anson Huang --- No changes. --- drivers/cpufreq/imx-cpufreq-dt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 4f85f31..35db14c 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -16,6 +16,7 @@ #define OCOTP_CFG3_SPEED_GRADE_SHIFT 8 #define OCOTP_CFG3_SPEED_GRADE_MASK (0x3 << 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) @@ -34,7 +35,12 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) if (ret) return ret; - speed_grade = (cell_value & OCOTP_CFG3_SPEED_GRADE_MASK) >> OCOTP_CFG3_SPEED_GRADE_SHIFT; + if (of_machine_is_compatible("fsl,imx8mn")) + speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK) + >> OCOTP_CFG3_SPEED_GRADE_SHIFT; + 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; /* -- 2.7.4