From patchwork Fri Aug 5 09:12:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmlhLXdlaSBDaGFuZyAo5by15L2z5YGJKQ==?= X-Patchwork-Id: 12937102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA7ADC00140 for ; Fri, 5 Aug 2022 09:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lOv5f55EIeh1zi1jlZhPe48DQZdh/zUQgBTMbpigh8Q=; b=bpg1gVxcUlNLnf x7ltOEYi0PN32t4unRxn7jYEA523Ym6haWi9p7SaSUUi+7zGh3rAMbY2jbu7E0tyaj2znbUGbgqUl CqZSAvArlC6RnHrhLWXya3EwSAneS7o5W4NIaNfahp/8SUdUOtfcZP57fw1IzeRozsJCOWSIG7VVk tDTQbKXKlYIWx589tbc6AWJ71ZYAGlkMJL3qit9jNqaSLirjaTDUpcEB10zSBSsq7D4d1XZLU90FG +Kp/K2FeHOids4BJLTl8y/zVbIHpfpbShyqns3B9pkbvZZ2JgssS2PyZ7Xcu/W70ZI+yq4cenCmW0 o+gcKPALMqlHDrzMsdag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJtY2-00DZBh-7f; Fri, 05 Aug 2022 09:23:14 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJtXx-00DZ6s-Kp; Fri, 05 Aug 2022 09:23:11 +0000 X-UUID: f48767f4b878444584a47b869de286b8-20220805 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.8,REQID:8bc17338-3fd6-45c6-a63d-f1d61af4be76,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:25,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACT ION:release,TS:25 X-CID-META: VersionHash:0f94e32,CLOUDID:caf5d248-f57f-4088-93dd-066979cdb4e6,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:4,EDM:-3,IP:nil,URL:0,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: f48767f4b878444584a47b869de286b8-20220805 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1041848910; Fri, 05 Aug 2022 02:23:00 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 5 Aug 2022 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 5 Aug 2022 17:12:25 +0800 From: jia-wei.chang To: "Rafael J . Wysocki" , Viresh Kumar , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , Hector Yuan CC: Jia-Wei Chang , , , , , , Subject: [PATCH 1/2] dt-bindings: cpufreq: add mt8188 cpufreq hw dt-bindings Date: Fri, 5 Aug 2022 17:12:10 +0800 Message-ID: <20220805091211.2791-2-jia-wei.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220805091211.2791-1-jia-wei.chang@mediatek.com> References: <20220805091211.2791-1-jia-wei.chang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_022310_033462_3AFFCD89 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jia-Wei Chang Add mt8188 cpufreq hw compatible in dt-bindings. Signed-off-by: Jia-Wei Chang --- .../devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml b/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml index 9cd42a64b13e..b56d36224612 100644 --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-mediatek-hw.yaml @@ -16,7 +16,9 @@ description: properties: compatible: - const: mediatek,cpufreq-hw + enum: + - mediatek,cpufreq-hw + - mediatek,mt8188-cpufreq-hw reg: minItems: 1 From patchwork Fri Aug 5 09:12:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmlhLXdlaSBDaGFuZyAo5by15L2z5YGJKQ==?= X-Patchwork-Id: 12937116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41EA2C00140 for ; Fri, 5 Aug 2022 09:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pPs5zohQLctYvDqojvXCOxgnLtOsiVPxJ4joma0DN4Y=; b=ykSwMjhs/NoHTy GrVl7Sjcwf1ezYnZ19htxvk+KHoIfkNaTHuvUyu0GOPA2TP6KBKAK33jwCbfqKe0IUfdMDP9Zs6Jr tmXBmmuEiz8JmfgGIRJM5/jYTJTQtFGLn0kydsrToT96v3P//Z7PL+TSZcmfQ2G3OJy8F5jbq1E64 QA0DLxxlYThQ7UrECbDmmUxAXldXzegtQHg5KfvJq7/2f2xXyqpvjDCadKhvHdgGrQN/JySnKUS3k cmopqTXwtxGZNTczPQ/jfsCc+w5OhYkOknKb5BjXcBOR60gsXcDE/4io1ekxMh6yOzL7rNopAQbfk eRb5B6fJ8PNVcAZ34emA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJts1-00Diwa-Hj; Fri, 05 Aug 2022 09:43:53 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJtrv-00Diro-Gl; Fri, 05 Aug 2022 09:43:50 +0000 X-UUID: b495a035fa744a1583919662e9004577-20220805 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.8,REQID:182b81d3-e2cf-4c53-af73-3d57e4547d12,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:0f94e32,CLOUDID:5b40e09b-da39-4e3b-a854-56c7d2111b46,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: b495a035fa744a1583919662e9004577-20220805 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 223512692; Fri, 05 Aug 2022 02:43:41 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Fri, 5 Aug 2022 17:12:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 5 Aug 2022 17:12:33 +0800 From: jia-wei.chang To: "Rafael J . Wysocki" , Viresh Kumar , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , Hector Yuan CC: Jia-Wei Chang , , , , , , Subject: [PATCH 2/2] cpufreq: mediatek-hw: add support for mt8188 Date: Fri, 5 Aug 2022 17:12:11 +0800 Message-ID: <20220805091211.2791-3-jia-wei.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220805091211.2791-1-jia-wei.chang@mediatek.com> References: <20220805091211.2791-1-jia-wei.chang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_024347_611202_BF1668ED X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jia-Wei Chang MT8188 mediatek-cpufreq-hw uses different register layout so it requires a new compatible and platform data. Signed-off-by: Jia-Wei Chang --- drivers/cpufreq/mediatek-cpufreq-hw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c index f0e0a35c7f21..83ba87545ee7 100644 --- a/drivers/cpufreq/mediatek-cpufreq-hw.c +++ b/drivers/cpufreq/mediatek-cpufreq-hw.c @@ -50,6 +50,15 @@ static const u16 cpufreq_mtk_offsets[REG_ARRAY_SIZE] = { [REG_FREQ_LATENCY] = 0x110, }; +static const u16 cpufreq_mt8188_offsets[REG_ARRAY_SIZE] = { + [REG_FREQ_LUT_TABLE] = 0x0, + [REG_FREQ_ENABLE] = 0x84, + [REG_FREQ_PERF_STATE] = 0x88, + [REG_FREQ_HW_STATE] = 0x8c, + [REG_EM_POWER_TBL] = 0x90, + [REG_FREQ_LATENCY] = 0x114, +}; + static int __maybe_unused mtk_cpufreq_get_cpu_power(struct device *cpu_dev, unsigned long *uW, unsigned long *KHz) @@ -318,6 +327,7 @@ static int mtk_cpufreq_hw_driver_remove(struct platform_device *pdev) static const struct of_device_id mtk_cpufreq_hw_match[] = { { .compatible = "mediatek,cpufreq-hw", .data = &cpufreq_mtk_offsets }, + { .compatible = "mediatek,mt8188-cpufreq-hw", .data = &cpufreq_mt8188_offsets }, {} };