From mboxrd@z Thu Jan 1 00:00:00 1970 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 AEF30CCD195 for ; Fri, 17 Oct 2025 15:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7bM73lypABp16DNaPQ/AZd3Rd/UhyQMrclXHvC1Kw7I=; b=aAxIYSfSeND+EnAS3Mrd6SJoce WnNQkBR4vzi3nkrf/9WP4hn01Z7DKq5cEIXc0t8UrK8MXjCvOzaeyI+7ITTdbq7aezkOWTA0AuJry iNglAFy/rYWRAwk2Yf1gcasqZNYnrPtsQZGwADxkhwmKQNRTi1UJXL2oGkxHEI5YkjiScidBHSBc1 A6YH9tMMJdfrr6FRzpahBJd3h3lidvuT4kDTMaLVNNAEDnm8G4k+79+nnv+hQQnFwA8gyRaNCa+Fy UGh37LCuyjMksEWWAAbttAZhGl1Y5ynPGPItbOv1Mjw+hs2jdnZ7MJiVG3CyeVAwxF650jkHSEopH 3i+dZlGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9mR7-00000008HBH-1ano; Fri, 17 Oct 2025 15:32:09 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9mR4-00000008H8f-2iCg; Fri, 17 Oct 2025 15:32:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=7bM73lypABp16DNaPQ/AZd3Rd/UhyQMrclXHvC1Kw7I=; b=ZsXwRklE70sGO7xxPM22QKPctB UrFMUK6/j9UD7Ttuh1Cms+ScjAPVht/GTGkfEjw5dVuefmrk6pgeh2/usurbRmK7jDoLnxahEe6Sk s4cFYfYaFZ6prBuXYgEAlBdTUoy8adDLQEdy+p1uzdNdR2gwkOGhnotx/x9sMI0EW3axKF4FW2E6/ yi7Zu/WkSs4NOp5I0hfi+lFaM+i8i6Mlb91FE9RYz0g0A3nNVnOxWveM++9N+5lOJUu02D9X1/yK8 HRWPDP9RWPaVXmYxWg1X/FVl05pO8YZ0WONZ92MTwAHZY9WMUhthg5v+KS9KTJ4Nv4V+ReelrwM1Q IVCWPm6g==; Received: from sender4-pp-f112.zoho.com ([136.143.188.112]) by desiato.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9mR0-00000007gTK-1Mg7; Fri, 17 Oct 2025 15:32:05 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1760715107; cv=none; d=zohomail.com; s=zohoarc; b=SZP21hJUyjRqWo3i+KFM+Ot6ZFYXX0ganbW4ApF0/Af1RFY6vtchJggaPKCwVhOyfcElELCJ+NYEKBbeclZpjOlpxEBLhvLgruTDOcqTufJ6lhg6jTJfp4TbqLYD8cqOourA9x8NCt1cAf2jkuNbCqRtg16e7DVPSFSurf0t4Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760715107; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=7bM73lypABp16DNaPQ/AZd3Rd/UhyQMrclXHvC1Kw7I=; b=UMSAHMrCRyt+9jDM2RUF/qFZgHqyyHytNtRN9mv2HypGc1yH36ChOkqy0AF9tMwwsLfvbOFrqqIcsPG+OIjTOmBs3oC/+bH7Pr/DzR/8D8sPQFDaqip2wP6z2bTuN/SsQ8J7jvbrxPbbIY5xJ9006lqDdRjmBvpumaHLJ3mDVAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1760715107; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=7bM73lypABp16DNaPQ/AZd3Rd/UhyQMrclXHvC1Kw7I=; b=R5P2wG+kqBxhtk1IsU93+kT+Q6jVvz2C78zjyjhfti/5KvwcC0Vm4cdysqz5eIKR U3P5/AEERfbd0QqPQCcRd/m2mYLzKafSGqa69c8WuigSMNSiQX6+hNDSKNcsdZx12Kn 0Xys4tb2aGO/QiRgmOpl5euk02DvlP6g8wKnbCtw= Received: by mx.zohomail.com with SMTPS id 1760715104463474.2685315868116; Fri, 17 Oct 2025 08:31:44 -0700 (PDT) From: Nicolas Frattaroli Date: Fri, 17 Oct 2025 17:31:09 +0200 Subject: [PATCH v8 2/5] dt-bindings: power: Add MT8196 GPU frequency control binding MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251017-mt8196-gpufreq-v8-2-98fc1cc566a1@collabora.com> References: <20251017-mt8196-gpufreq-v8-0-98fc1cc566a1@collabora.com> In-Reply-To: <20251017-mt8196-gpufreq-v8-0-98fc1cc566a1@collabora.com> To: AngeloGioacchino Del Regno , Boris Brezillon , Jassi Brar , Chia-I Wu , Chen-Yu Tsai , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Kees Cook , "Gustavo A. R. Silva" , Ulf Hansson Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-hardening@vger.kernel.org, linux-pm@vger.kernel.org, Nicolas Frattaroli X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251017_163202_854698_52A7C9D2 X-CRM114-Status: GOOD ( 13.53 ) 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 On the MT8196 and MT6991 SoCs, the GPU power and frequency is controlled by some integration logic, referred to as "MFlexGraphics" by MediaTek, which comes in the form of an embedded controller running special-purpose firmware. This controller takes care of the regulators and PLL clock frequencies to squeeze the maximum amount of power out of the silicon. Add a binding which models it as a power domain. Reviewed-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nicolas Frattaroli --- .../bindings/power/mediatek,mt8196-gpufreq.yaml | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/Documentation/devicetree/bindings/power/mediatek,mt8196-gpufreq.yaml b/Documentation/devicetree/bindings/power/mediatek,mt8196-gpufreq.yaml new file mode 100644 index 000000000000..b9e43abaf8a4 --- /dev/null +++ b/Documentation/devicetree/bindings/power/mediatek,mt8196-gpufreq.yaml @@ -0,0 +1,117 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/mediatek,mt8196-gpufreq.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MFlexGraphics Power and Frequency Controller + +maintainers: + - Nicolas Frattaroli + +description: + A special-purpose embedded MCU to control power and frequency of GPU devices + using MediaTek Flexible Graphics integration hardware. + +properties: + $nodename: + pattern: '^power-controller@[a-f0-9]+$' + + compatible: + enum: + - mediatek,mt8196-gpufreq + + reg: + items: + - description: GPR memory area + - description: RPC memory area + - description: SoC variant ID register + + reg-names: + items: + - const: gpr + - const: rpc + - const: hw-revision + + clocks: + items: + - description: main clock of the embedded controller (EB) + - description: core PLL + - description: stack 0 PLL + - description: stack 1 PLL + + clock-names: + items: + - const: eb + - const: core + - const: stack0 + - const: stack1 + + mboxes: + items: + - description: FastDVFS events + - description: frequency control + - description: sleep control + - description: timer control + - description: frequency hopping control + - description: hardware voter control + - description: FastDVFS control + + mbox-names: + items: + - const: fast-dvfs-event + - const: gpufreq + - const: sleep + - const: timer + - const: fhctl + - const: ccf + - const: fast-dvfs + + memory-region: + items: + - description: phandle to the GPUEB shared memory + + "#clock-cells": + const: 1 + + "#power-domain-cells": + const: 0 + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - mboxes + - mbox-names + - memory-region + - "#clock-cells" + - "#power-domain-cells" + +additionalProperties: false + +examples: + - | + #include + + power-controller@4b09fd00 { + compatible = "mediatek,mt8196-gpufreq"; + reg = <0x4b09fd00 0x80>, + <0x4b800000 0x1000>, + <0x4b860128 0x4>; + reg-names = "gpr", "rpc", "hw-revision"; + clocks = <&topckgen CLK_TOP_MFG_EB>, + <&mfgpll CLK_MFG_AO_MFGPLL>, + <&mfgpll_sc0 CLK_MFGSC0_AO_MFGPLL_SC0>, + <&mfgpll_sc1 CLK_MFGSC1_AO_MFGPLL_SC1>; + clock-names = "eb", "core", "stack0", "stack1"; + mboxes = <&gpueb_mbox 0>, <&gpueb_mbox 1>, <&gpueb_mbox 2>, + <&gpueb_mbox 3>, <&gpueb_mbox 4>, <&gpueb_mbox 5>, + <&gpueb_mbox 7>; + mbox-names = "fast-dvfs-event", "gpufreq", "sleep", "timer", "fhctl", + "ccf", "fast-dvfs"; + memory-region = <&gpueb_shared_memory>; + #clock-cells = <1>; + #power-domain-cells = <0>; + }; -- 2.51.0