Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5147286ybg; Mon, 21 Oct 2019 21:59:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN4hGuKt3bh+JhuJYlIdxPHfBfl9wk05ZesxrZrHWmJIDWpLAI/GzyCTakXxCl1iUXG9PW X-Received: by 2002:a50:ace1:: with SMTP id x88mr29006324edc.132.1571720370434; Mon, 21 Oct 2019 21:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571720370; cv=none; d=google.com; s=arc-20160816; b=1J6jb5ivh/au2pbKnuBVDmBbla+SVMG1BGI3Hma6T28ZpyY6YGNzjexMPnA0sBS6ec 16/fGih2a8ZgvO1KSfH2Qq4u7iVrNxzkbbJz2yxdUu8drW07ztK8YzXyah/E867K2FwY X8nBfBmDqTBs0ZfoocvClE9Z0SnhZsLv/1pvdz4A37tE8EqlNdC75JRnREnug4e6ymAp 2HwdHrWpcCQRMo1e3AnAoodDYiQ1gtpPvol5LF3ovokcKIrD4lS/RaXgXg0M2SvZbJnl wp/LLlO2G68n6NyIybiov6IzNIWrGifv0AhM50rkO8ISfCCt42kc//T1P6WgQ9E6aT4o /3Sw== 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=zcjf72p+K7wLF+hll/+67T9K6up/vhXq9Qt6yaGYnug=; b=moWiLF2nz7GCkb44uvycdBBWtzIlpPsb/xF1l0TZT4luPuOfGrV4ruLXJDnikXoudh bGfgPjz40zGLUtAXqTkRL6P+BWNf0mxpUgDDhPlbGEQZ5ljG6DW6OHtFztbnksv98DT2 jMT1c7wHbMh6bQ+MMDJRh+BMD2c9wxSOfFPSEZUXDpY6azy0XhAQ20iybwp9AabcE09u WUXQmtL9eT8nkQHX4KWT9+Wp9nAFrCsiF1ueHENsSpEXNVY0qa9al/P6OrZw2xT3a+a4 eTG+mu2vzkyuJGzE0xsTS+kPwHEEVpkA/OCQTcYq/vWFVXHJ83I/YHmi3TbAcfwunhMM uTjA== 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 r26si13344073edx.61.2019.10.21.21.59.07; Mon, 21 Oct 2019 21:59:30 -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 S2387489AbfJVEml (ORCPT + 99 others); Tue, 22 Oct 2019 00:42:41 -0400 Received: from inva020.nxp.com ([92.121.34.13]:44002 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387462AbfJVEmk (ORCPT ); Tue, 22 Oct 2019 00:42:40 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 984DD1A030A; Tue, 22 Oct 2019 06:42:38 +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 1A2D81A0009; Tue, 22 Oct 2019 06:42:34 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 46DBA40245; Tue, 22 Oct 2019 12:42:28 +0800 (SGT) From: Anson Huang To: rafael.j.wysocki@intel.com, viresh.kumar@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.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.MX8MN's default speed grade value Date: Tue, 22 Oct 2019 12:39:39 +0800 Message-Id: <1571719179-23316-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.MX8MN has different speed grade definition compared to i.MX8MQ/i.MX8MM, when fuses are NOT written, the default speed_grade should be set to minimum available OPP defined in DT which is 1.2GHz, the corresponding speed_grade value should be 0xb. Fixes: 5b8010ba70d5 ("cpufreq: imx-cpufreq-dt: Add i.MX8MN support") Signed-off-by: Anson Huang --- drivers/cpufreq/imx-cpufreq-dt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 35db14c..26531f0 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -44,19 +44,19 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) mkt_segment = (cell_value & OCOTP_CFG3_MKT_SEGMENT_MASK) >> OCOTP_CFG3_MKT_SEGMENT_SHIFT; /* - * Early samples without fuses written report "0 0" which means - * consumer segment and minimum speed grading. - * - * According to datasheet minimum speed grading is not supported for - * consumer parts so clamp to 1 to avoid warning for "no OPPs" + * Early samples without fuses written report "0 0" which may NOT + * match any OPP defined in DT. So clamp to minimum OPP defined in + * DT to avoid warning for "no OPPs". * * Applies to i.MX8M series SoCs. */ - if (mkt_segment == 0 && speed_grade == 0 && ( - of_machine_is_compatible("fsl,imx8mm") || - of_machine_is_compatible("fsl,imx8mn") || - of_machine_is_compatible("fsl,imx8mq"))) - speed_grade = 1; + if (mkt_segment == 0 && speed_grade == 0) { + if (of_machine_is_compatible("fsl,imx8mm") || + of_machine_is_compatible("fsl,imx8mq")) + speed_grade = 1; + if (of_machine_is_compatible("fsl,imx8mn")) + speed_grade = 0xb; + } supported_hw[0] = BIT(speed_grade); supported_hw[1] = BIT(mkt_segment); -- 2.7.4