Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1964596ybl; Thu, 15 Aug 2019 04:19:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFdYT39fw8PQ2cHb1FvT5MLG27exyYDDsEFyNwZsiutNrfmFl+WdaoSTLP9XLmAxpk6jz0 X-Received: by 2002:a17:902:8696:: with SMTP id g22mr3888947plo.122.1565867963586; Thu, 15 Aug 2019 04:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565867963; cv=none; d=google.com; s=arc-20160816; b=PlkDBm2Kmlu1U/jBhOEYJ6hMk3lIq12wzW4+srEFzVYctxcl4R2hdxc9HEAQfs9xcG ewpdiOEHQzgHAa8E6CqKVH53vo/O4LCR0UucTlIz2ypWknYFWGKzwyayzqtyYSzabHpa CxbqM9o/ilFgZZb+shoBcCeX1Oic+qa7935aZcV77az/6aZ2ww4TywqrPMgkMUkrOiUe G67Esn57nx2G2gOXxbCfuSV8gR6KYG7Wzk7OEFmdy/b7alsjQBAm6l/h6Qhg31BhryU4 9jaarWSnH3mAf9fDEp5+cr2y22TWndw+8pA6S4mimiPaRA1Tw0x7XnbjvgqJD7gPpiRh URpA== 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=lu6RjMoPRvKfCCbntGAZM2wbQFQBPUPuas/ceQzqcqs=; b=AbRIpeoWO5mGAiqtiRU3MMmRQUwmuMnc8TN+V3Vxk5O1Ih9WHVag0cgmKw+Vqfoe5c jEGXSo0e4QvQfnhPrBEVAE9yoyL06VAv5u7TK6okFWkkR8JiNC7WkpjTn6WcZG4geFy9 TJnN+mV0n+1OX1CJsmdVJWb5JFACulPDdu86owzcxeXL+jHeCP7K3nZfG9WSLM4ETIN9 02Hh2V3smhGB8ZMfoQyP/dXViU0FePTTKin8jr2chsEpXHCw5Sm70FSNLPZ/iVysheA6 6i07ABOzGwA3+Lmt/P1Y24VRWnFrfVu9e2DOVSEOIgIGf42YZH6NRGsQ6eRnKZdjyrPH 9iHg== 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 h185si1655694pge.199.2019.08.15.04.19.07; Thu, 15 Aug 2019 04:19:23 -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 S1731378AbfHOLSW (ORCPT + 99 others); Thu, 15 Aug 2019 07:18:22 -0400 Received: from inva020.nxp.com ([92.121.34.13]:38038 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731080AbfHOLSU (ORCPT ); Thu, 15 Aug 2019 07:18:20 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 004A81A0268; Thu, 15 Aug 2019 13:18:18 +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 1CA8D1A00FE; Thu, 15 Aug 2019 13:18:10 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 534E44030E; Thu, 15 Aug 2019 19:18:00 +0800 (SGT) From: Anson.Huang@nxp.com 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 4/6] cpufreq: imx-cpufreq-dt: Add i.MX8MN support Date: Thu, 15 Aug 2019 06:59:41 -0400 Message-Id: <1565866783-19672-4-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565866783-19672-1-git-send-email-Anson.Huang@nxp.com> References: <1565866783-19672-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 From: Anson Huang 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 --- 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