Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5556126ybg; Tue, 22 Oct 2019 05:10:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxASWISmLXoRZq6T7HpPvxkc/jD3lziLhlwdA7hZBY+pP4+t+DIWETUVo8Ipv1kX/58G+cS X-Received: by 2002:a17:906:4e55:: with SMTP id g21mr2647915ejw.0.1571746241800; Tue, 22 Oct 2019 05:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571746241; cv=none; d=google.com; s=arc-20160816; b=rC/M7bYOq04Dce695HWyk0O4RakqVB42zq68lnvYbbdePCOeaSJFZNGAsyLFelCn8K anCReTubE/f722vPiI9h9gGwwYXluTJPtmbmlLhspkWRdhKwwo3YjeuyBvkKM22eYfC2 PG5NT96sD+fTmkaQA0vC9frz0EFZoA4tOQ+VTST14HlQhbIV1nzXmwNdgIruukheahPG PkQfa6Fnb5gNb+f+IqWeA7bYyy7sTwcYU4HAN+HriYh9b+iykF35Px23dZ86WZ40jEoB ULzJ9cGf288nl1I8FvbTuV/QgI4qA30Ick60efDIbxGYAIeena6pi4aJ+p1XGWOFLzxT NSNA== 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=XbG6CjZezjN0LQ3/cbQw8Mi6hhGfSZ9Ti9U3oM3WrzM=; b=h+Sg17Fwqkd2Pv9SA/+Pq/EjcUC3xb7H/RWaHNfSpzsXG8QtvOfoHcyGsaIG4W//J+ IL61iI8KA9lnhMJUX4HT//2NgU5C+7FNi2S81TY4RM8HBzP0y3WapOQ8M/XWe7A+rsje hmT2OdeYao5LPZ34C3jkpXCEQukCvZ3keeNyzSgdUaMFHGXc3SDb//nt8BDpr7kGXwQ0 FkKkJ8w3PNfsQ2LjW+Lc/W6xXIoeydNIzrB4VltiWjNylWbgDgCj0P2qAE8DCiuf0jNX 9ciXR1JzyNCSUWf8BQMbEXbBWZ2hL/CiXrIDPjZ2xTsUGwCD9TlGFF+fMM5Lc4DQt3oe x1ZA== 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 c24si7864356edb.328.2019.10.22.05.10.17; Tue, 22 Oct 2019 05:10:41 -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 S1731226AbfJVIgV (ORCPT + 99 others); Tue, 22 Oct 2019 04:36:21 -0400 Received: from inva021.nxp.com ([92.121.34.21]:54164 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbfJVIgV (ORCPT ); Tue, 22 Oct 2019 04:36:21 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id ECE052000C7; Tue, 22 Oct 2019 10:36:18 +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 6B5A0200601; Tue, 22 Oct 2019 10:36:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 90A00402CB; Tue, 22 Oct 2019 16:36:08 +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 V2] cpufreq: imx-cpufreq-dt: Correct i.MX8MN's default speed grade value Date: Tue, 22 Oct 2019 16:33:19 +0800 Message-Id: <1571733199-17406-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 --- Changes since V1: - Improve the coding style by removing the tab; --- 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..85a6efd 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