Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp993595ybl; Sat, 17 Aug 2019 15:48:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsSTQD0VxXhIyzLMnwZqDqvSiobBZE7EoweBKRG6NiixwOqFFdzTbxduGZH9OiCMKnaZ2G X-Received: by 2002:a63:b64:: with SMTP id a36mr13889559pgl.215.1566082135320; Sat, 17 Aug 2019 15:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566082135; cv=none; d=google.com; s=arc-20160816; b=QKJsEwU/5M/7tem33vbZH1hUUpc8rsnEQGJSL76YNi/xWDf58BSn4NF9fsr6pqfa8y 5Ubea4HGwNmsTPCgBuALGHv4qEKpFm4zV0BBk0dUqOUGWQQ7rK4MPlQVbs288je10Y87 vEX4rgJee4CvEchc0MLYxX9h1GEKMmuZsdfLtXfNuzwoMQ8xFcCV6xlOHMBo8x+gYj6j p9FZa6msp0UprVDiDeO9zxH1C/nJ1X6zac7PLtK7eJuS0l46BZMYiJACUNbVe88syYpq YO7q7Pq8DSBdkU4XBuEZpDPKEmzw+fAPfRmKko88y2AwxuX2+JHMGrHvpeWjJKN/FQDm pyYQ== 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=r1yIg317avV75buqOGM2R0pazExTbp/1c6bnG6djg0Yv0gWZ4LMZh0GLWq0v1Cicd0 Khg4BBsr6tqMg3oCiJBDmbZTfDo4JORm6gSAr4NwQrkCNLnEsVOXKWDzypgQ4MEaQ2gc 0KFemdYxl7xKAKJ4XQrnpLTyRegPlTwqlpcoH4mUoxHvKBftv8CntvU0gIrvO8Q71jjm EtZYoXbfmHx9kXLbAHl6us9LjPhHHHXd34bDNv7hd97ibaUwUC2sKr0Kav/9LZewbUg+ oEhjbEB/dV0ODngRbvT8zmOk6G/mQM5RWs+aVh8bxTebtadwMW8uqEAkRCpebsQ3LccQ HNKA== 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 y63si6638944pgd.403.2019.08.17.15.48.40; Sat, 17 Aug 2019 15:48: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 S1726673AbfHQWrT (ORCPT + 99 others); Sat, 17 Aug 2019 18:47:19 -0400 Received: from inva021.nxp.com ([92.121.34.21]:52852 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbfHQWrE (ORCPT ); Sat, 17 Aug 2019 18:47:04 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B6DB82000C7; Sun, 18 Aug 2019 00:47:01 +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 D02ED20010A; Sun, 18 Aug 2019 00:46:53 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 75280402E5; Sun, 18 Aug 2019 06:46:44 +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 V2 4/6] cpufreq: imx-cpufreq-dt: Add i.MX8MN support Date: Sat, 17 Aug 2019 18:28:18 -0400 Message-Id: <1566080900-2539-4-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566080900-2539-1-git-send-email-Anson.Huang@nxp.com> References: <1566080900-2539-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