[v2,2/2] arm: dts: add ARM Mali GPU node for Odroid XU3
diff mbox series

Message ID 20190614235719.8134-1-joseph.kogut@gmail.com
State Under Review
Headers show
Series
  • Untitled series #132853
Related show

Commit Message

Joseph Kogut June 14, 2019, 11:57 p.m. UTC
Add device tree node for mali gpu on Odroid XU3 SoCs.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---

Changes v1 -> v2:
- Use interrupt name ordering from binding doc
- Specify a single clock for GPU node
- Add gpu opp table
- Fix warnings from IRQ_TYPE_NONE

 .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

--
2.22.0

Comments

Krzysztof Kozlowski June 16, 2019, 8:59 a.m. UTC | #1
On Fri, Jun 14, 2019 at 04:57:19PM -0700, Joseph Kogut wrote:
> Add device tree node for mali gpu on Odroid XU3 SoCs.
> 
> Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> ---
> 
> Changes v1 -> v2:
> - Use interrupt name ordering from binding doc
> - Specify a single clock for GPU node
> - Add gpu opp table
> - Fix warnings from IRQ_TYPE_NONE
> 
>  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++

This should go to exynos5422-odroid-core.dtsi instead, because it is
common to entire Odroid Exynos5422 family (not only XU3 family).

>  1 file changed, 26 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> index 93a48f2dda49..b8a4246e3b37 100644
> --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> @@ -48,6 +48,32 @@
>  		cooling-levels = <0 130 170 230>;
>  	};
> 
> +	gpu: gpu@11800000 {
> +		compatible = "samsung,exynos-mali", "arm,mali-t628";

This is common to all Exynos542x chips so it should go to
exynos5420.dtsi. Here you would need to only enable it and provide
regulator.

Probably this should be also associated with tmu_gpu as a cooling device
(if Mali registers a cooling device...). Otherwise the tmu_gpu is not
really used for it.

> +		reg = <0x11800000 0x5000>;
> +		interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> +		interrupt-names = "job", "mmu", "gpu";
> +		clocks = <&clock CLK_G3D>;
> +		mali-supply = <&buck4_reg>;

Please check if always-on property could be removed from buck4. Also,
what about LDO27? It should be used as well (maybe through
vendor-specific properties which would justify the need of new vendor
compatible).


Best regards,
Krzysztof

> +		operating-points-v2 = <&gpu_opp_table>;
> +	};
> +
> +	gpu_opp_table: gpu-opp-table {
> +		compatible = "operating-points-v2";
> +
> +		opp-177000000 {
> +			opp-hz = /bits/ 64 <117000000>;
> +			opp-microvolt = <812500>;
> +		};
> +
> +		opp-600000000 {
> +			opp-hz = /bits/ 64 <600000000>;
> +			opp-microvolt = <1150000>;
> +		};
> +	};
> +
>  	thermal-zones {
>  		cpu0_thermal: cpu0-thermal {
>  			thermal-sensors = <&tmu_cpu0 0>;
> --
> 2.22.0
>
Joseph Kogut June 17, 2019, 4:15 p.m. UTC | #2
Hi Krzysztof,

Thanks for the review.

On Sun, Jun 16, 2019 at 1:59 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Fri, Jun 14, 2019 at 04:57:19PM -0700, Joseph Kogut wrote:
> > Add device tree node for mali gpu on Odroid XU3 SoCs.
> >
> > Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> > ---
> >
> > Changes v1 -> v2:
> > - Use interrupt name ordering from binding doc
> > - Specify a single clock for GPU node
> > - Add gpu opp table
> > - Fix warnings from IRQ_TYPE_NONE
> >
> >  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
>
> This should go to exynos5422-odroid-core.dtsi instead, because it is
> common to entire Odroid Exynos5422 family (not only XU3 family).
>
> >  1 file changed, 26 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > index 93a48f2dda49..b8a4246e3b37 100644
> > --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > @@ -48,6 +48,32 @@
> >               cooling-levels = <0 130 170 230>;
> >       };
> >
> > +     gpu: gpu@11800000 {
> > +             compatible = "samsung,exynos-mali", "arm,mali-t628";
>
> This is common to all Exynos542x chips so it should go to
> exynos5420.dtsi. Here you would need to only enable it and provide
> regulator.
>

To clarify, which pieces are specific to the Odroid Exynos 5422
family, and which are common to the entire Exynos 542x family? I'm
thinking the gpu node is common to the 542x family, including the
interrupts and clock, and the regulator and opp table are specific to
the Odroid 5422?

> Probably this should be also associated with tmu_gpu as a cooling device
> (if Mali registers a cooling device...). Otherwise the tmu_gpu is not
> really used for it.
>

We have two operating performance points for the GPU, but I'm not sure
at what temperature we should trip the lower opp. Looking at the trip
temperatures for the CPU, we have four alerts, and one critical trip.
The highest alert is 85 C, would it be reasonable to trigger the lower
GPU opp at this temperature? Should it trigger sooner?

> > +             reg = <0x11800000 0x5000>;
> > +             interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > +                          <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > +                          <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > +             interrupt-names = "job", "mmu", "gpu";
> > +             clocks = <&clock CLK_G3D>;
> > +             mali-supply = <&buck4_reg>;
>
> Please check if always-on property could be removed from buck4.

I've checked, and this property can be removed safely.

> Also, what about LDO27? It should be used as well (maybe through
> vendor-specific properties which would justify the need of new vendor
> compatible).
>

I'm unsure how LDO27 is used, can you elaborate?

Best,
Joseph
Krzysztof Kozlowski June 17, 2019, 4:36 p.m. UTC | #3
On Mon, Jun 17, 2019 at 09:15:23AM -0700, Joseph Kogut wrote:
> Hi Krzysztof,
> 
> Thanks for the review.
> 
> On Sun, Jun 16, 2019 at 1:59 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > On Fri, Jun 14, 2019 at 04:57:19PM -0700, Joseph Kogut wrote:
> > > Add device tree node for mali gpu on Odroid XU3 SoCs.
> > >
> > > Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> > > ---
> > >
> > > Changes v1 -> v2:
> > > - Use interrupt name ordering from binding doc
> > > - Specify a single clock for GPU node
> > > - Add gpu opp table
> > > - Fix warnings from IRQ_TYPE_NONE
> > >
> > >  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
> >
> > This should go to exynos5422-odroid-core.dtsi instead, because it is
> > common to entire Odroid Exynos5422 family (not only XU3 family).
> >
> > >  1 file changed, 26 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > index 93a48f2dda49..b8a4246e3b37 100644
> > > --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > @@ -48,6 +48,32 @@
> > >               cooling-levels = <0 130 170 230>;
> > >       };
> > >
> > > +     gpu: gpu@11800000 {
> > > +             compatible = "samsung,exynos-mali", "arm,mali-t628";
> >
> > This is common to all Exynos542x chips so it should go to
> > exynos5420.dtsi. Here you would need to only enable it and provide
> > regulator.
> >
> 
> To clarify, which pieces are specific to the Odroid Exynos 5422
> family, and which are common to the entire Exynos 542x family? I'm
> thinking the gpu node is common to the 542x family, including the
> interrupts and clock, and the regulator and opp table are specific to
> the Odroid 5422?

Opp table depends - it might common to Exynos542x (as all use the same
Mali) or specific to boards (because there is Odroid XU3 Lite with
Exynos5422 working on lower frequencies).

So far the CPU and all bus OPP tables were put in exynos5420.dtsi so I
guess this can go there as well.

For the rest of properties you were correct.

> 
> > Probably this should be also associated with tmu_gpu as a cooling device
> > (if Mali registers a cooling device...). Otherwise the tmu_gpu is not
> > really used for it.
> >
> 
> We have two operating performance points for the GPU, but I'm not sure
> at what temperature we should trip the lower opp. Looking at the trip
> temperatures for the CPU, we have four alerts, and one critical trip.
> The highest alert is 85 C, would it be reasonable to trigger the lower
> GPU opp at this temperature? Should it trigger sooner?

The highest trip point is 120 C and it is critical. In general I would
follow the CPU trip points (so fan should start working at 50 degrees).
Unless you have some other data about recommended trip points. Useful is
vendor kernel (from Samsung, from Hard Kernel).

> 
> > > +             reg = <0x11800000 0x5000>;
> > > +             interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > > +                          <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > > +                          <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > > +             interrupt-names = "job", "mmu", "gpu";
> > > +             clocks = <&clock CLK_G3D>;
> > > +             mali-supply = <&buck4_reg>;
> >
> > Please check if always-on property could be removed from buck4.
> 
> I've checked, and this property can be removed safely.
> 
> > Also, what about LDO27? It should be used as well (maybe through
> > vendor-specific properties which would justify the need of new vendor
> > compatible).
> >
> 
> I'm unsure how LDO27 is used, can you elaborate?

It is supplying the VDD_G3DS (with a note "SRAM power"). I do not have
any more data on it. However I did not check in vendor kernel for it.

Best regards,
Krzysztof


> 
> Best,
> Joseph
Rob Herring June 17, 2019, 7:16 p.m. UTC | #4
On Fri, Jun 14, 2019 at 5:57 PM Joseph Kogut <joseph.kogut@gmail.com> wrote:
>
> Add device tree node for mali gpu on Odroid XU3 SoCs.
>
> Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> ---
>
> Changes v1 -> v2:
> - Use interrupt name ordering from binding doc
> - Specify a single clock for GPU node
> - Add gpu opp table
> - Fix warnings from IRQ_TYPE_NONE
>
>  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> index 93a48f2dda49..b8a4246e3b37 100644
> --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> @@ -48,6 +48,32 @@
>                 cooling-levels = <0 130 170 230>;
>         };
>
> +       gpu: gpu@11800000 {
> +               compatible = "samsung,exynos-mali", "arm,mali-t628";
> +               reg = <0x11800000 0x5000>;
> +               interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> +                            <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> +                            <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> +               interrupt-names = "job", "mmu", "gpu";
> +               clocks = <&clock CLK_G3D>;
> +               mali-supply = <&buck4_reg>;
> +               operating-points-v2 = <&gpu_opp_table>;
> +       };
> +
> +       gpu_opp_table: gpu-opp-table {

Not really a new problem in this file, but you are mixing nodes with
and without an address and really the gpu node should be under a
simple-bus node.

If the OPP is only for the GPU, I'd make it a child of the gpu node instead.

> +               compatible = "operating-points-v2";
> +
> +               opp-177000000 {
> +                       opp-hz = /bits/ 64 <117000000>;
> +                       opp-microvolt = <812500>;
> +               };
> +
> +               opp-600000000 {
> +                       opp-hz = /bits/ 64 <600000000>;
> +                       opp-microvolt = <1150000>;
> +               };
> +       };
> +
>         thermal-zones {
>                 cpu0_thermal: cpu0-thermal {
>                         thermal-sensors = <&tmu_cpu0 0>;
> --
> 2.22.0
>
Krzysztof Kozlowski June 18, 2019, 9:26 a.m. UTC | #5
On Sat, 15 Jun 2019 at 01:57, Joseph Kogut <joseph.kogut@gmail.com> wrote:
>
> Add device tree node for mali gpu on Odroid XU3 SoCs.
>
> Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> ---
>
> Changes v1 -> v2:
> - Use interrupt name ordering from binding doc
> - Specify a single clock for GPU node
> - Add gpu opp table
> - Fix warnings from IRQ_TYPE_NONE
>
>  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> index 93a48f2dda49..b8a4246e3b37 100644
> --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> @@ -48,6 +48,32 @@
>                 cooling-levels = <0 130 170 230>;
>         };
>
> +       gpu: gpu@11800000 {
> +               compatible = "samsung,exynos-mali", "arm,mali-t628";
> +               reg = <0x11800000 0x5000>;
> +               interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> +                            <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> +                            <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> +               interrupt-names = "job", "mmu", "gpu";
> +               clocks = <&clock CLK_G3D>;
> +               mali-supply = <&buck4_reg>;
> +               operating-points-v2 = <&gpu_opp_table>;
> +       };
> +
> +       gpu_opp_table: gpu-opp-table {

One more thing - use "opp_table" as node name (generic class of node,
matches style with other tables).

Best regards,
Krzysztof

> +               compatible = "operating-points-v2";
> +
> +               opp-177000000 {
> +                       opp-hz = /bits/ 64 <117000000>;
> +                       opp-microvolt = <812500>;
> +               };
> +
> +               opp-600000000 {
> +                       opp-hz = /bits/ 64 <600000000>;
> +                       opp-microvolt = <1150000>;
> +               };
> +       };
> +
>         thermal-zones {
>                 cpu0_thermal: cpu0-thermal {
>                         thermal-sensors = <&tmu_cpu0 0>;
> --
> 2.22.0
>
Rob Herring June 18, 2019, 2:18 p.m. UTC | #6
On Tue, Jun 18, 2019 at 3:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Sat, 15 Jun 2019 at 01:57, Joseph Kogut <joseph.kogut@gmail.com> wrote:
> >
> > Add device tree node for mali gpu on Odroid XU3 SoCs.
> >
> > Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> > ---
> >
> > Changes v1 -> v2:
> > - Use interrupt name ordering from binding doc
> > - Specify a single clock for GPU node
> > - Add gpu opp table
> > - Fix warnings from IRQ_TYPE_NONE
> >
> >  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > index 93a48f2dda49..b8a4246e3b37 100644
> > --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > @@ -48,6 +48,32 @@
> >                 cooling-levels = <0 130 170 230>;
> >         };
> >
> > +       gpu: gpu@11800000 {
> > +               compatible = "samsung,exynos-mali", "arm,mali-t628";
> > +               reg = <0x11800000 0x5000>;
> > +               interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > +                            <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > +                            <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > +               interrupt-names = "job", "mmu", "gpu";
> > +               clocks = <&clock CLK_G3D>;
> > +               mali-supply = <&buck4_reg>;
> > +               operating-points-v2 = <&gpu_opp_table>;
> > +       };
> > +
> > +       gpu_opp_table: gpu-opp-table {
>
> One more thing - use "opp_table" as node name (generic class of node,
> matches style with other tables).

'opp-table' as convention is using '-' rather than '_'.

Rob
Krzysztof Kozlowski June 18, 2019, 2:45 p.m. UTC | #7
On Tue, 18 Jun 2019 at 16:18, Rob Herring <robh+dt@kernel.org> wrote:
>
> On Tue, Jun 18, 2019 at 3:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > On Sat, 15 Jun 2019 at 01:57, Joseph Kogut <joseph.kogut@gmail.com> wrote:
> > >
> > > Add device tree node for mali gpu on Odroid XU3 SoCs.
> > >
> > > Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> > > ---
> > >
> > > Changes v1 -> v2:
> > > - Use interrupt name ordering from binding doc
> > > - Specify a single clock for GPU node
> > > - Add gpu opp table
> > > - Fix warnings from IRQ_TYPE_NONE
> > >
> > >  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
> > >  1 file changed, 26 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > index 93a48f2dda49..b8a4246e3b37 100644
> > > --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > @@ -48,6 +48,32 @@
> > >                 cooling-levels = <0 130 170 230>;
> > >         };
> > >
> > > +       gpu: gpu@11800000 {
> > > +               compatible = "samsung,exynos-mali", "arm,mali-t628";
> > > +               reg = <0x11800000 0x5000>;
> > > +               interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > > +                            <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > > +                            <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > > +               interrupt-names = "job", "mmu", "gpu";
> > > +               clocks = <&clock CLK_G3D>;
> > > +               mali-supply = <&buck4_reg>;
> > > +               operating-points-v2 = <&gpu_opp_table>;
> > > +       };
> > > +
> > > +       gpu_opp_table: gpu-opp-table {
> >
> > One more thing - use "opp_table" as node name (generic class of node,
> > matches style with other tables).
>
> 'opp-table' as convention is using '-' rather than '_'.

OK, so rather consistency because most of opp-tables have '_',
including existing DTSes and examples in
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt and
Documentation/devicetree/bindings/opp/opp.txt.

Best regards,
Krzysztof
Joseph Kogut June 18, 2019, 5:41 p.m. UTC | #8
On Mon, Jun 17, 2019 at 9:36 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Mon, Jun 17, 2019 at 09:15:23AM -0700, Joseph Kogut wrote:
> > Hi Krzysztof,
> >
> > Thanks for the review.
> >
> > On Sun, Jun 16, 2019 at 1:59 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > >
> > > On Fri, Jun 14, 2019 at 04:57:19PM -0700, Joseph Kogut wrote:
> > > > Add device tree node for mali gpu on Odroid XU3 SoCs.
> > > >
> > > > Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> > > > ---
> > > >
> > > > Changes v1 -> v2:
> > > > - Use interrupt name ordering from binding doc
> > > > - Specify a single clock for GPU node
> > > > - Add gpu opp table
> > > > - Fix warnings from IRQ_TYPE_NONE
> > > >
> > > >  .../boot/dts/exynos5422-odroidxu3-common.dtsi | 26 +++++++++++++++++++
> > >
> > > This should go to exynos5422-odroid-core.dtsi instead, because it is
> > > common to entire Odroid Exynos5422 family (not only XU3 family).
> > >
> > > >  1 file changed, 26 insertions(+)
> > > >
> > > > diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > > index 93a48f2dda49..b8a4246e3b37 100644
> > > > --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > > +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
> > > > @@ -48,6 +48,32 @@
> > > >               cooling-levels = <0 130 170 230>;
> > > >       };
> > > >
> > > > +     gpu: gpu@11800000 {
> > > > +             compatible = "samsung,exynos-mali", "arm,mali-t628";
> > >
> > > This is common to all Exynos542x chips so it should go to
> > > exynos5420.dtsi. Here you would need to only enable it and provide
> > > regulator.
> > >
> >
> > To clarify, which pieces are specific to the Odroid Exynos 5422
> > family, and which are common to the entire Exynos 542x family? I'm
> > thinking the gpu node is common to the 542x family, including the
> > interrupts and clock, and the regulator and opp table are specific to
> > the Odroid 5422?
>
> Opp table depends - it might common to Exynos542x (as all use the same
> Mali) or specific to boards (because there is Odroid XU3 Lite with
> Exynos5422 working on lower frequencies).
>
> So far the CPU and all bus OPP tables were put in exynos5420.dtsi so I
> guess this can go there as well.
>
> For the rest of properties you were correct.
>
> >
> > > Probably this should be also associated with tmu_gpu as a cooling device
> > > (if Mali registers a cooling device...). Otherwise the tmu_gpu is not
> > > really used for it.
> > >
> >
> > We have two operating performance points for the GPU, but I'm not sure
> > at what temperature we should trip the lower opp. Looking at the trip
> > temperatures for the CPU, we have four alerts, and one critical trip.
> > The highest alert is 85 C, would it be reasonable to trigger the lower
> > GPU opp at this temperature? Should it trigger sooner?
>
> The highest trip point is 120 C and it is critical. In general I would
> follow the CPU trip points (so fan should start working at 50 degrees).
> Unless you have some other data about recommended trip points. Useful is
> vendor kernel (from Samsung, from Hard Kernel).
>
> >
> > > > +             reg = <0x11800000 0x5000>;
> > > > +             interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > > > +                          <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > > > +                          <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > > > +             interrupt-names = "job", "mmu", "gpu";
> > > > +             clocks = <&clock CLK_G3D>;
> > > > +             mali-supply = <&buck4_reg>;
> > >
> > > Please check if always-on property could be removed from buck4.
> >
> > I've checked, and this property can be removed safely.
> >
> > > Also, what about LDO27? It should be used as well (maybe through
> > > vendor-specific properties which would justify the need of new vendor
> > > compatible).
> > >
> >
> > I'm unsure how LDO27 is used, can you elaborate?
>
> It is supplying the VDD_G3DS (with a note "SRAM power"). I do not have
> any more data on it. However I did not check in vendor kernel for it.
>

After checking (a fork of) the vendor sources [1], it seems to me that
this regulator is used for memory voltage related to Samsung's
Adaptive Supply Voltage, for which there is a pending patchset [2].

This seems to me to be out of the scope of this patchset, could you confirm?

[1] https://github.com/kumajaya/android_kernel_samsung_universal5422/blob/ad41104d43e6470f8d4880d65b259dc7b903cc0d/arch/arm/mach-exynos/asv-exynos5422.c#L1052
[2] https://lwn.net/Articles/784958/
Krzysztof Kozlowski June 18, 2019, 7:17 p.m. UTC | #9
On Tue, 18 Jun 2019 at 19:42, Joseph Kogut <joseph.kogut@gmail.com> wrote:
> > >
> > > > > +             reg = <0x11800000 0x5000>;
> > > > > +             interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
> > > > > +                          <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
> > > > > +                          <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
> > > > > +             interrupt-names = "job", "mmu", "gpu";
> > > > > +             clocks = <&clock CLK_G3D>;
> > > > > +             mali-supply = <&buck4_reg>;
> > > >
> > > > Please check if always-on property could be removed from buck4.
> > >
> > > I've checked, and this property can be removed safely.
> > >
> > > > Also, what about LDO27? It should be used as well (maybe through
> > > > vendor-specific properties which would justify the need of new vendor
> > > > compatible).
> > > >
> > >
> > > I'm unsure how LDO27 is used, can you elaborate?
> >
> > It is supplying the VDD_G3DS (with a note "SRAM power"). I do not have
> > any more data on it. However I did not check in vendor kernel for it.
> >
>
> After checking (a fork of) the vendor sources [1], it seems to me that
> this regulator is used for memory voltage related to Samsung's
> Adaptive Supply Voltage, for which there is a pending patchset [2].
>
> This seems to me to be out of the scope of this patchset, could you confirm?
>
> [1] https://github.com/kumajaya/android_kernel_samsung_universal5422/blob/ad41104d43e6470f8d4880d65b259dc7b903cc0d/arch/arm/mach-exynos/asv-exynos5422.c#L1052
> [2] https://lwn.net/Articles/784958/

Hi,

Indeed the vendor sources suggest that voltage scaling of this
regulator depends on ASV, not on frequency. However still the
regulator is there in the hardware so it should be in the bindings as
well (specific to Exynos). I guess the driver should also enable it
but this is separate topic (adding per-platform quirks to Panfrost
driver). Putting it to bindings also follows advice from line 12:
https://elixir.bootlin.com/linux/v5.2-rc5/source/Documentation/devicetree/bindings/writing-bindings.txt#L12

Best regards,
Krzysztof

Patch
diff mbox series

diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
index 93a48f2dda49..b8a4246e3b37 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
@@ -48,6 +48,32 @@ 
 		cooling-levels = <0 130 170 230>;
 	};

+	gpu: gpu@11800000 {
+		compatible = "samsung,exynos-mali", "arm,mali-t628";
+		reg = <0x11800000 0x5000>;
+		interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 74  IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "job", "mmu", "gpu";
+		clocks = <&clock CLK_G3D>;
+		mali-supply = <&buck4_reg>;
+		operating-points-v2 = <&gpu_opp_table>;
+	};
+
+	gpu_opp_table: gpu-opp-table {
+		compatible = "operating-points-v2";
+
+		opp-177000000 {
+			opp-hz = /bits/ 64 <117000000>;
+			opp-microvolt = <812500>;
+		};
+
+		opp-600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt = <1150000>;
+		};
+	};
+
 	thermal-zones {
 		cpu0_thermal: cpu0-thermal {
 			thermal-sensors = <&tmu_cpu0 0>;