Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp715249ybe; Thu, 5 Sep 2019 04:59:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV1UudW21M4aKqNCYRSVqxnihMFnkgbOjRgA8CpQ7MkQJRtI/GZUpZ+0ZcwRl9KtrXTCk6 X-Received: by 2002:a63:cb4f:: with SMTP id m15mr2807883pgi.100.1567684779920; Thu, 05 Sep 2019 04:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567684779; cv=none; d=google.com; s=arc-20160816; b=l4sdJ8JWPejVlmeEhk5Wf2DVQ0+WhS4sbj9GuGSFnsWdoaDq4FsQ9stmy9S8ql9cAD l11eAFnpd+SBv6EYd2JwSmm0Gqbj9iGLkP/YWxLnQLivTqAW5y8fy3FeWKTM2OCelr4A loMeYHt+6KP0VdjQ7p1gLyjRhYYq/Wv/y0gPnRfkRuHrLI/wsIBTCMaVWh7/JATK/drK N7frjGCimXn75P8f8ZcZS7ZmEEUpizdG2ogRNoUZUl7aT39/y6wX3O4n3+aiuRUQaHmb oMAnfnKBzwR9Ay42CTPpqh5It9xsCWHVUFRq0BgKFn2+cBEFxqn4AvruqEPglKIJvRzY MnyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BLTsSGkAS20nKvSmDJ8nD9cteiUsmNrKqKIdwSgw/JU=; b=UM0wP2xhQCOpfxILhPjBOfP1IMY51tDD6+zw6lhe+uECngSXqlpNkOeY37d2hN9KBD QSGJmhUOSVN7G7XPR1zBAgN/RF1edh4FRaQr+8UR/vM3tC5A8qRAuCJE8cfYT+kBpQW5 rzkrsmvjRXwKkvyqsE0JEtYs5lodxOzrMXA4Mk8ax+9XaSiRxzHQfbn3K8Y/7fjyxRMo 3r5u4AXftizGiz+n3+Jy+g6/LgW02t4GqFctX4kDw7CPHO8XzpBz76vRladRZAL7dhKj N9BkWu1etqJAZcuJtPO0GDlX1iTNsnGhqbCoePuxeAEmXkmAVOcCJ3wqRR1me59vP+8s rknA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aXg0BCP9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si1564943pgb.367.2019.09.05.04.59.24; Thu, 05 Sep 2019 04:59:39 -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; dkim=pass header.i=@chromium.org header.s=google header.b=aXg0BCP9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732612AbfIEJtc (ORCPT + 99 others); Thu, 5 Sep 2019 05:49:32 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43288 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731857AbfIEJtc (ORCPT ); Thu, 5 Sep 2019 05:49:32 -0400 Received: by mail-qt1-f194.google.com with SMTP id l22so1999244qtp.10 for ; Thu, 05 Sep 2019 02:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BLTsSGkAS20nKvSmDJ8nD9cteiUsmNrKqKIdwSgw/JU=; b=aXg0BCP9Sek1lvZeMuLX3m0T7YqT3J7+y48L+cuVdvR8ljEDdiPEof2dLMZGMrNQqf frfpxxqdq4i1ZSuneYWogqaVVwUXhpWbAAr50DK5fwnz7E0gTyF774wGR5nyj0EYsHkU O58lSwPmNLnkiy7PLIyxy6NJBfLmKRlhrMQ/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BLTsSGkAS20nKvSmDJ8nD9cteiUsmNrKqKIdwSgw/JU=; b=FMlhDNsKSecJYbF9N5WJ2jskV2sAxx9EO7VSFNeZRBiNF+hMGsS92zizCEPtlBPCun 0sPDqhLiM6oizKOs2gHelvhD3Iuo4wEx782aio+S93/ZLMewxRXo16NuDaayuzTuYQeM v+j+c0rljrpfNXFsDBfNrUROPGrc/dubaGFdW8qz42QMjUKDlshhm7kyCSHILqNOh7ct 5Ondm4r4hmuN1L2GLrgwKvACOojidkgACWXvcMZGSn4rJRdu6x6V79hcHNf4HhzU9NYv oSj98mBTJvAyBWD2cOB1geTDU3PaIDtXWO4D2EWLOzDYX25KtwA/mhWtN3cTz1Emr6d9 lSmw== X-Gm-Message-State: APjAAAURcBpFVQODU3mtnlEaKDJX8gRkdiXOnze+w+7WYtQSy159Oljn LBklAHSKiUzxF9t9Fo7t+KygA2N0pMZ2kmHK9n8GzA== X-Received: by 2002:a0c:efcc:: with SMTP id a12mr1032204qvt.59.1567676970643; Thu, 05 Sep 2019 02:49:30 -0700 (PDT) MIME-Version: 1.0 References: <20190905081546.42716-1-drinkcat@chromium.org> In-Reply-To: From: Nicolas Boichat Date: Thu, 5 Sep 2019 17:49:19 +0800 Message-ID: Subject: Re: [PATCH] arm64: dts: mt8183: Add node for the Mali GPU To: Rob Herring Cc: Matthias Brugger , Mark Rutland , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , "linux-kernel@vger.kernel.org" , Nick Fan , Alyssa Rosenzweig , Boris Brezillon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the quick review! On Thu, Sep 5, 2019 at 5:09 PM Rob Herring wrote: > > On Thu, Sep 5, 2019 at 9:16 AM Nicolas Boichat wrote: > > > > Add a basic GPU node and opp table for mt8183. > > > > The binding we use with out-of-tree Mali drivers includes more > > clocks, I assume this would be required eventually if we have an > > in-tree driver: > > We have an in-tree driver... Right but AFAICT it does not support Bifrost GPU (yet?). > > > clocks = > > <&topckgen CLK_TOP_MFGPLL_CK>, > > <&topckgen CLK_TOP_MUX_MFG>, > > <&clk26m>, > > <&mfgcfg CLK_MFG_BG3D>; > > clock-names = > > "clk_main_parent", > > "clk_mux", > > "clk_sub_parent", > > "subsys_mfg_cg"; Do you think we should add those to the binding document? May not be easy to match what the amlogic binding does (I'm not sure to understand the details of this device, but I can dig further/ask). > > > > Signed-off-by: Nicolas Boichat > > > > --- > > Upstreaming what matches existing bindings from our Chromium OS tree: > > https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.19/arch/arm64/boot/dts/mediatek/mt8183.dtsi#1348 > > > > The evb part of this change depends on this patch to add PMIC dtsi: > > https://patchwork.kernel.org/patch/10928161/ > > > > arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 7 ++ > > arch/arm64/boot/dts/mediatek/mt8183.dtsi | 103 ++++++++++++++++++++ > > 2 files changed, 110 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts > > index 1fb195c683c3d01..200d8e65a6368a1 100644 > > --- a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts > > +++ b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts > > @@ -7,6 +7,7 @@ > > > > /dts-v1/; > > #include "mt8183.dtsi" > > +#include "mt6358.dtsi" > > > > / { > > model = "MediaTek MT8183 evaluation board"; > > @@ -30,6 +31,12 @@ > > status = "okay"; > > }; > > > > +&gpu { > > + supply-names = "mali", "mali_sram"; > > + mali-supply = <&mt6358_vgpu_reg>; > > + mali_sram-supply = <&mt6358_vsram_gpu_reg>; > > Not documented. Just 'sram-supply' is enough. Will fix. > Note that the binding doc queued up for 5.4 has been converted to DT schema. Yep I see that in linux-next. > > > +}; > > + > > &i2c0 { > > pinctrl-names = "default"; > > pinctrl-0 = <&i2c_pins_0>; > > diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi > > index 97f84aa9fc6e1c1..8ea548a762ea252 100644 > > --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi > > +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi > > @@ -579,6 +579,109 @@ > > #clock-cells = <1>; > > }; > > > > + gpu: mali@13040000 { > > gpu@... > > > + compatible = "mediatek,mt8183-mali", "arm,mali-bifrost"; > > You need to add this compatible string too. Will do. > > > + reg = <0 0x13040000 0 0x4000>; > > + interrupts = > > + , > > + , > > + ; > > + interrupt-names = "job", "mmu", "gpu"; > > + > > + clocks = <&topckgen CLK_TOP_MFGPLL_CK>; > > + power-domains = > > + <&scpsys MT8183_POWER_DOMAIN_MFG_CORE0>, > > + <&scpsys MT8183_POWER_DOMAIN_MFG_CORE1>, > > + <&scpsys MT8183_POWER_DOMAIN_MFG_2D>; > > This needs to be documented too. I see that Documentation/devicetree/bindings/gpu/arm,mali-midgard.yaml has power-domains in the example both not in the yaml, is that expected? > > > + > > + operating-points-v2 = <&gpu_opp_table>; > > + }; > > + > > + gpu_opp_table: opp_table0 { > > + compatible = "operating-points-v2"; > > + opp-shared; > > + > > + opp-300000000 { > > + opp-hz = /bits/ 64 <300000000>; > > + opp-microvolt = <625000>, <850000>; > > + }; > > + > > + opp-320000000 { > > + opp-hz = /bits/ 64 <320000000>; > > + opp-microvolt = <631250>, <850000>; > > + }; > > + > > + opp-340000000 { > > + opp-hz = /bits/ 64 <340000000>; > > + opp-microvolt = <637500>, <850000>; > > + }; > > + > > + opp-360000000 { > > + opp-hz = /bits/ 64 <360000000>; > > + opp-microvolt = <643750>, <850000>; > > + }; > > + > > + opp-380000000 { > > + opp-hz = /bits/ 64 <380000000>; > > + opp-microvolt = <650000>, <850000>; > > + }; > > + > > + opp-400000000 { > > + opp-hz = /bits/ 64 <400000000>; > > + opp-microvolt = <656250>, <850000>; > > + }; > > + > > + opp-420000000 { > > + opp-hz = /bits/ 64 <420000000>; > > + opp-microvolt = <662500>, <850000>; > > + }; > > + > > + opp-460000000 { > > + opp-hz = /bits/ 64 <460000000>; > > + opp-microvolt = <675000>, <850000>; > > + }; > > + > > + opp-500000000 { > > + opp-hz = /bits/ 64 <500000000>; > > + opp-microvolt = <687500>, <850000>; > > + }; > > + > > + opp-540000000 { > > + opp-hz = /bits/ 64 <540000000>; > > + opp-microvolt = <700000>, <850000>; > > + }; > > + > > + opp-580000000 { > > + opp-hz = /bits/ 64 <580000000>; > > + opp-microvolt = <712500>, <850000>; > > + }; > > + > > + opp-620000000 { > > + opp-hz = /bits/ 64 <620000000>; > > + opp-microvolt = <725000>, <850000>; > > + }; > > + > > + opp-653000000 { > > + opp-hz = /bits/ 64 <653000000>; > > + opp-microvolt = <743750>, <850000>; > > + }; > > + > > + opp-698000000 { > > + opp-hz = /bits/ 64 <698000000>; > > + opp-microvolt = <768750>, <868750>; > > + }; > > + > > + opp-743000000 { > > + opp-hz = /bits/ 64 <743000000>; > > + opp-microvolt = <793750>, <893750>; > > + }; > > + > > + opp-800000000 { > > + opp-hz = /bits/ 64 <800000000>; > > + opp-microvolt = <825000>, <925000>; > > + }; > > Okay, but I seriously doubt the OPP selection logic is sophisticated > enough or will ever be to use all these levels... > > > + }; > > + > > mmsys: syscon@14000000 { > > compatible = "mediatek,mt8183-mmsys", "syscon"; > > reg = <0 0x14000000 0 0x1000>; > > -- > > 2.23.0.187.g17f5b7556c-goog > >