devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
@ 2017-01-16 13:24 Maxime Ripard
       [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-16 13:24 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Carlo Caione, Kevin Hilman,
	Heiko Stuebner, Matthias Brugger, Kukjin Kim, Krzysztof Kozlowski,
	Javier Martinez Canillas, Linus Walleij, Alexandre Belloni,
	Thomas Petazzoni, Boris Brezillon, Antoine Ténart,
	Maxime Ripard

The ARM Mali Utgard GPU family is embedded into a number of SoCs from
Allwinner, Amlogic, Mediatek or Rockchip.

Add a binding for the GPU of that family.

Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
 .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
new file mode 100644
index 000000000000..df05ba0ec357
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
@@ -0,0 +1,76 @@
+ARM Mali Utgard GPU
+===================
+
+Required properties:
+  - compatible:
+    * "arm,mali-utgard" and one of the following:
+      + "arm,mali-300"
+      + "arm,mali-400"
+      + "arm,mali-450"
+
+  - reg: Physical base address and length of the GPU registers
+
+  - interrupts: an entry for each entry in interrupt-names.
+    See ../interrupt-controller/interrupts.txt for details.
+
+  - interrupt-names:
+    * ppX: Pixel Processor X interrupt (X from 0 to 7)
+    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
+    * pp: Pixel Processor broadcast interrupt (mali-450 only)
+    * gp: Geometry Processor interrupt
+    * gpmmu: Geometry Processor MMU interrupt
+
+
+Optional properties:
+  - interrupt-names:
+    * pmu: Power Management Unit interrupt, if implemented in hardware
+
+Vendor-specific bindings
+------------------------
+
+The Mali GPU is integrated very differently from one SoC to
+another. In order to accommodate those differences, you have the option
+to specify one more vendor-specific compatible, among:
+
+  - allwinner,sun4i-a10-mali
+    Required properties:
+      * clocks: an entry for each entry in clock-names
+      * clock-names:
+        + bus: bus clock for the GPU
+        + core: clock driving the GPU itself
+      * resets: phandle to the reset line for the GPU
+
+  - allwinner,sun7i-a20-mali
+    Required properties:
+      * clocks: an entry for each entry in clock-names
+      * clock-names:
+        + bus: bus clock for the GPU
+        + core: clock driving the GPU itself
+      * resets: phandle to the reset line for the GPU
+
+Example:
+
+mali: gpu@01c40000 {
+	compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
+		     "arm,mali-utgard";
+	reg = <0x01c40000 0x10000>;
+	interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+	interrupt-names = "gp",
+			  "gpmmu",
+			  "pp0",
+			  "ppmmu0",
+			  "pp1",
+			  "ppmmu1",
+			  "pmu";
+	clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
+	clock-names = "bus", "core";
+	resets = <&ccu RST_BUS_GPU>;
+};
+
+
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 2/2] ARM: sun8i: dt: Add mali node
       [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2017-01-16 13:24   ` Maxime Ripard
  2017-01-16 18:49   ` [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Krzysztof Kozlowski
  1 sibling, 0 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-16 13:24 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland
  Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Carlo Caione, Kevin Hilman,
	Heiko Stuebner, Matthias Brugger, Kukjin Kim, Krzysztof Kozlowski,
	Javier Martinez Canillas, Linus Walleij, Alexandre Belloni,
	Thomas Petazzoni, Boris Brezillon, Antoine Ténart,
	Maxime Ripard

The A23 and A33 have an ARM Mali 400 GPU. Now that we have a binding, add
it to our DT.

Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-a23-a33.dtsi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index e4991a78ad73..1aaa68ec1880 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -486,6 +486,33 @@
 			#size-cells = <0>;
 		};
 
+		mali: gpu@01c40000 {
+			compatible = "allwinner,sun8i-a23-mali",
+				     "allwinner,sun7i-a20-mali",
+				     "arm,mali-400", "arm,mali-utgard";
+			reg = <0x01c40000 0x10000>;
+			interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "gp",
+					  "gpmmu",
+					  "pp0",
+					  "ppmmu0",
+					  "pp1",
+					  "ppmmu1",
+					  "pmu";
+			clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
+			clock-names = "bus", "core";
+			resets = <&ccu RST_BUS_GPU>;
+
+			assigned-clocks = <&ccu CLK_GPU>;
+			assigned-clock-rates = <408000000>;
+		};
+
 		gic: interrupt-controller@01c81000 {
 			compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
 			reg = <0x01c81000 0x1000>,
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
       [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  2017-01-16 13:24   ` [PATCH 2/2] ARM: sun8i: dt: Add mali node Maxime Ripard
@ 2017-01-16 18:49   ` Krzysztof Kozlowski
  2017-01-17  9:38     ` Maxime Ripard
  1 sibling, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2017-01-16 18:49 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Rob Herring, Mark Rutland, Chen-Yu Tsai,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Carlo Caione, Kevin Hilman,
	Heiko Stuebner, Matthias Brugger, Kukjin Kim, Krzysztof Kozlowski,
	Javier Martinez Canillas, Linus Walleij, Alexandre Belloni,
	Thomas Petazzoni, Boris Brezillon, Antoine Ténart

On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> Allwinner, Amlogic, Mediatek or Rockchip.
> 
> Add a binding for the GPU of that family.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> 

Hi,

Do you have a driver in kernel which will implement these bindings?

Defining them for out-of-tree driver does not bring any benefits (3rd
party driver will not respect them anyway).

Best regards,
Krzysztof

> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> new file mode 100644
> index 000000000000..df05ba0ec357
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> @@ -0,0 +1,76 @@
> +ARM Mali Utgard GPU
> +===================
> +
> +Required properties:
> +  - compatible:
> +    * "arm,mali-utgard" and one of the following:
> +      + "arm,mali-300"
> +      + "arm,mali-400"
> +      + "arm,mali-450"
> +
> +  - reg: Physical base address and length of the GPU registers
> +
> +  - interrupts: an entry for each entry in interrupt-names.
> +    See ../interrupt-controller/interrupts.txt for details.
> +
> +  - interrupt-names:
> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> +    * gp: Geometry Processor interrupt
> +    * gpmmu: Geometry Processor MMU interrupt
> +
> +
> +Optional properties:
> +  - interrupt-names:
> +    * pmu: Power Management Unit interrupt, if implemented in hardware
> +
> +Vendor-specific bindings
> +------------------------
> +
> +The Mali GPU is integrated very differently from one SoC to
> +another. In order to accommodate those differences, you have the option
> +to specify one more vendor-specific compatible, among:
> +
> +  - allwinner,sun4i-a10-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +  - allwinner,sun7i-a20-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +Example:
> +
> +mali: gpu@01c40000 {
> +	compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
> +		     "arm,mali-utgard";
> +	reg = <0x01c40000 0x10000>;
> +	interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
> +	interrupt-names = "gp",
> +			  "gpmmu",
> +			  "pp0",
> +			  "ppmmu0",
> +			  "pp1",
> +			  "ppmmu1",
> +			  "pmu";
> +	clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
> +	clock-names = "bus", "core";
> +	resets = <&ccu RST_BUS_GPU>;
> +};
> +
> +
> -- 
> 2.11.0
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-16 18:49   ` [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Krzysztof Kozlowski
@ 2017-01-17  9:38     ` Maxime Ripard
  2017-01-17 10:22       ` Neil Armstrong
                         ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-17  9:38 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Boris Brezillon, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart, Carlo Caione,
	Thomas Petazzoni, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1180 bytes --]

Hi,

On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> > Allwinner, Amlogic, Mediatek or Rockchip.
> > 
> > Add a binding for the GPU of that family.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >  1 file changed, 76 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> 
> Do you have a driver in kernel which will implement these bindings?

No, but we have bindings for out-of-tree drivers already.

> Defining them for out-of-tree driver does not bring any benefits
> (3rd party driver will not respect them anyway).

You could see it the other way around too. The out-of-tree drivers
don't respect it at the moment because there's no binding to respect.

And at least for us, we definitely plan on doing that.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-17  9:38     ` Maxime Ripard
@ 2017-01-17 10:22       ` Neil Armstrong
       [not found]         ` <4f5b8608-af6c-3ef5-aaf0-e7e034d006cd-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
  2017-01-17 11:31       ` Krzysztof Kozlowski
  2017-01-19 16:08       ` Rob Herring
  2 siblings, 1 reply; 23+ messages in thread
From: Neil Armstrong @ 2017-01-17 10:22 UTC (permalink / raw)
  To: Maxime Ripard, Krzysztof Kozlowski
  Cc: Mark Rutland, devicetree, Heiko Stuebner, Boris Brezillon,
	Kevin Hilman, Linus Walleij, Javier Martinez Canillas,
	Chen-Yu Tsai, Rob Herring, Alexandre Belloni, Kukjin Kim,
	Matthias Brugger, Thomas Petazzoni, Carlo Caione,
	Antoine Ténart, linux-arm-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 1441 bytes --]

On 01/17/2017 10:38 AM, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
>> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
>>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>>> Allwinner, Amlogic, Mediatek or Rockchip.
>>>
>>> Add a binding for the GPU of that family.
>>>
>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>> ---
>>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>>>  1 file changed, 76 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>
>> Do you have a driver in kernel which will implement these bindings?
> 
> No, but we have bindings for out-of-tree drivers already.
> 
>> Defining them for out-of-tree driver does not bring any benefits
>> (3rd party driver will not respect them anyway).
> 
> You could see it the other way around too. The out-of-tree drivers
> don't respect it at the moment because there's no binding to respect.
> 
> And at least for us, we definitely plan on doing that.
> 
> Maxime

Hi Maxime, Krzysztof,

We hope this will be accepted so it will solve the same issue we have on Amlogic SoCs
and all the other mali powered SoCs.

Having mainline bindings will forcre out-of-tree driver to respect those bindings
and remove a dts out-of-tree patch aswell.

Neil


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-17  9:38     ` Maxime Ripard
  2017-01-17 10:22       ` Neil Armstrong
@ 2017-01-17 11:31       ` Krzysztof Kozlowski
  2017-01-17 20:51         ` Maxime Ripard
  2017-01-19 16:08       ` Rob Herring
  2 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2017-01-17 11:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Boris Brezillon, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart, Carlo Caione,
	Thomas Petazzoni, linux-arm-kernel

On Tue, Jan 17, 2017 at 11:38 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
>> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
>> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>> > Allwinner, Amlogic, Mediatek or Rockchip.
>> >
>> > Add a binding for the GPU of that family.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> > ---
>> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>> >  1 file changed, 76 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>
>> Do you have a driver in kernel which will implement these bindings?
>
> No, but we have bindings for out-of-tree drivers already.
>
>> Defining them for out-of-tree driver does not bring any benefits
>> (3rd party driver will not respect them anyway).
>
> You could see it the other way around too. The out-of-tree drivers
> don't respect it at the moment because there's no binding to respect.

Indeed, that's a point. However valid only when the out-of-tree driver
will respect them, for example do not break them on next release.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
       [not found]         ` <4f5b8608-af6c-3ef5-aaf0-e7e034d006cd-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
@ 2017-01-17 11:33           ` Krzysztof Kozlowski
  2017-01-17 20:50             ` Maxime Ripard
  2017-01-19 15:51           ` Maxime Ripard
  1 sibling, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2017-01-17 11:33 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Maxime Ripard, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Heiko Stuebner, Javier Martinez Canillas, Kevin Hilman,
	Linus Walleij, Boris Brezillon, Matthias Brugger, Chen-Yu Tsai,
	Rob Herring, Alexandre Belloni, Kukjin Kim, Antoine Ténart,
	Carlo Caione, Thomas Petazzoni,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Jan 17, 2017 at 12:22 PM, Neil Armstrong
<narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> wrote:
> On 01/17/2017 10:38 AM, Maxime Ripard wrote:
>> Hi,
>>
>> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
>>> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
>>>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>>>> Allwinner, Amlogic, Mediatek or Rockchip.
>>>>
>>>> Add a binding for the GPU of that family.
>>>>
>>>> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>>>> ---
>>>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>>>>  1 file changed, 76 insertions(+)
>>>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>>
>>> Do you have a driver in kernel which will implement these bindings?
>>
>> No, but we have bindings for out-of-tree drivers already.
>>
>>> Defining them for out-of-tree driver does not bring any benefits
>>> (3rd party driver will not respect them anyway).
>>
>> You could see it the other way around too. The out-of-tree drivers
>> don't respect it at the moment because there's no binding to respect.
>>
>> And at least for us, we definitely plan on doing that.
>>
>> Maxime
>
> Hi Maxime, Krzysztof,
>
> We hope this will be accepted so it will solve the same issue we have on Amlogic SoCs
> and all the other mali powered SoCs.

It will be helpful also for other SoCs using Mali 400 (e.g.
Exynos3250, Exynos4412).

> Having mainline bindings will forcre out-of-tree driver to respect those bindings
> and remove a dts out-of-tree patch aswell.

I would argue here over the word "force". Having bindings defined here
does not force anyone into anything. The out-of-tree can do whatever
they want. It is a wish from kernel side - it might be respected but
it might not.

Just to be sure - I am not opposed against. Some time ago I wanted
Mali400 to be upstreamed but with current policy about user-space side
it is not possible.

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-17 11:33           ` Krzysztof Kozlowski
@ 2017-01-17 20:50             ` Maxime Ripard
  0 siblings, 0 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-17 20:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Mark Rutland, devicetree, Heiko Stuebner, Neil Armstrong,
	Kevin Hilman, Linus Walleij, Javier Martinez Canillas,
	Chen-Yu Tsai, Rob Herring, Boris Brezillon, Kukjin Kim,
	Matthias Brugger, Alexandre Belloni, Thomas Petazzoni,
	Carlo Caione, Antoine Ténart, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3066 bytes --]

On Tue, Jan 17, 2017 at 01:33:57PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Jan 17, 2017 at 12:22 PM, Neil Armstrong
> <narmstrong@baylibre.com> wrote:
> > On 01/17/2017 10:38 AM, Maxime Ripard wrote:
> >> Hi,
> >>
> >> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
> >>> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> >>>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> >>>> Allwinner, Amlogic, Mediatek or Rockchip.
> >>>>
> >>>> Add a binding for the GPU of that family.
> >>>>
> >>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >>>> ---
> >>>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >>>>  1 file changed, 76 insertions(+)
> >>>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> >>>
> >>> Do you have a driver in kernel which will implement these bindings?
> >>
> >> No, but we have bindings for out-of-tree drivers already.
> >>
> >>> Defining them for out-of-tree driver does not bring any benefits
> >>> (3rd party driver will not respect them anyway).
> >>
> >> You could see it the other way around too. The out-of-tree drivers
> >> don't respect it at the moment because there's no binding to respect.
> >>
> >> And at least for us, we definitely plan on doing that.
> >>
> >> Maxime
> >
> > Hi Maxime, Krzysztof,
> >
> > We hope this will be accepted so it will solve the same issue we have on Amlogic SoCs
> > and all the other mali powered SoCs.
> 
> It will be helpful also for other SoCs using Mali 400 (e.g.
> Exynos3250, Exynos4412).

Yep, hence why you were in Cc :)

> > Having mainline bindings will forcre out-of-tree driver to respect those bindings
> > and remove a dts out-of-tree patch aswell.
> 
> I would argue here over the word "force". Having bindings defined here
> does not force anyone into anything. The out-of-tree can do whatever
> they want. It is a wish from kernel side - it might be respected but
> it might not.

Well, that statement can be made for each line of the kernel itself,
nothing forces you to use the code as is, or to make any kind of
modifications, including to its ABI. You just have an incentive to
respect the various frameworks and ABI because it's the path of least
resistance and all the tools, libraries and applications already know
how to use those interfaces.

But that's just it, an incentive, that anyone is free or not to comply
to.

> Just to be sure - I am not opposed against. Some time ago I wanted
> Mali400 to be upstreamed but with current policy about user-space side
> it is not possible.

While I would also very much like to see the kernel driver upstreamed,
this is unreasonable at this point. But this patch is here only to add
a binding to it, so that the out-of-tree drivers can comply to it, and
this is something we already have done.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-17 11:31       ` Krzysztof Kozlowski
@ 2017-01-17 20:51         ` Maxime Ripard
  0 siblings, 0 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-17 20:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Boris Brezillon, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart, Carlo Caione,
	Thomas Petazzoni, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1671 bytes --]

On Tue, Jan 17, 2017 at 01:31:19PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Jan 17, 2017 at 11:38 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Hi,
> >
> > On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
> >> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> >> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> >> > Allwinner, Amlogic, Mediatek or Rockchip.
> >> >
> >> > Add a binding for the GPU of that family.
> >> >
> >> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >> > ---
> >> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >> >  1 file changed, 76 insertions(+)
> >> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> >>
> >> Do you have a driver in kernel which will implement these bindings?
> >
> > No, but we have bindings for out-of-tree drivers already.
> >
> >> Defining them for out-of-tree driver does not bring any benefits
> >> (3rd party driver will not respect them anyway).
> >
> > You could see it the other way around too. The out-of-tree drivers
> > don't respect it at the moment because there's no binding to respect.
> 
> Indeed, that's a point. However valid only when the out-of-tree driver
> will respect them, for example do not break them on next release.

If you're talking about the default platform provided by ARM, you also
have the option of creating your own. That's what we did, and it
worked like a charm.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-16 13:24 [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Maxime Ripard
       [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2017-01-18 23:09 ` Linus Walleij
  2017-01-19 15:49   ` Maxime Ripard
  2017-01-19 16:16 ` Rob Herring
  2017-01-19 19:24 ` John Stultz
  3 siblings, 1 reply; 23+ messages in thread
From: Linus Walleij @ 2017-01-18 23:09 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree@vger.kernel.org, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Antoine Ténart,
	Krzysztof Kozlowski, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Carlo Caione, Boris Brezillon,
	Thomas Petazzoni, linux-arm-kernel@lists.infradead.org

On Mon, Jan 16, 2017 at 2:24 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> Allwinner, Amlogic, Mediatek or Rockchip.
>
> Add a binding for the GPU of that family.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> new file mode 100644
> index 000000000000..df05ba0ec357
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> @@ -0,0 +1,76 @@
> +ARM Mali Utgard GPU
> +===================
> +
> +Required properties:
> +  - compatible:
> +    * "arm,mali-utgard" and one of the following:
> +      + "arm,mali-300"
> +      + "arm,mali-400"
> +      + "arm,mali-450"
> +
> +  - reg: Physical base address and length of the GPU registers
> +
> +  - interrupts: an entry for each entry in interrupt-names.
> +    See ../interrupt-controller/interrupts.txt for details.
> +
> +  - interrupt-names:
> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> +    * gp: Geometry Processor interrupt
> +    * gpmmu: Geometry Processor MMU interrupt
> +
> +
> +Optional properties:
> +  - interrupt-names:
> +    * pmu: Power Management Unit interrupt, if implemented in hardware

On the MALI-400 MP in the ST-Ericsson DB8500 we have an additional interrupt
called "Mali400 combined". This is simply the HW designer's
doing an OR over all the 4 IRQ lines. Is this useful to define in the
bindings? Then it should be an optional

 * combined: all lines OR:ed together (if available)

Also you are defining "resets" below in the examples, should
this be listed as an optional property?

> +The Mali GPU is integrated very differently from one SoC to
> +another. In order to accommodate those differences, you have the option
> +to specify one more vendor-specific compatible, among:
> +
> +  - allwinner,sun4i-a10-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +  - allwinner,sun7i-a20-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU

Please add:

- stericsson,db8500-mali: also known as the "Smart Graphics
Accelerator" (SGA500)
   Required properties:
    * clocks: an entry for each entry in clock-names
    * clock-names:
      + bus: bus clock for the GPU (ICNCLK a.k.a. PRCMU_ACLK)
      + core: clock driving the GPU itself (PRCMU_SGACLK)

(It has no explicit reset line.)

With these:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-18 23:09 ` Linus Walleij
@ 2017-01-19 15:49   ` Maxime Ripard
  2017-01-20  9:16     ` Linus Walleij
  0 siblings, 1 reply; 23+ messages in thread
From: Maxime Ripard @ 2017-01-19 15:49 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mark Rutland, devicetree@vger.kernel.org, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Antoine Ténart,
	Krzysztof Kozlowski, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Carlo Caione, Boris Brezillon,
	Thomas Petazzoni, linux-arm-kernel@lists.infradead.org


[-- Attachment #1.1: Type: text/plain, Size: 4261 bytes --]

Hi Linus,

On Thu, Jan 19, 2017 at 12:09:37AM +0100, Linus Walleij wrote:
> On Mon, Jan 16, 2017 at 2:24 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> 
> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> > Allwinner, Amlogic, Mediatek or Rockchip.
> >
> > Add a binding for the GPU of that family.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >  1 file changed, 76 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> >
> > diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > new file mode 100644
> > index 000000000000..df05ba0ec357
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > @@ -0,0 +1,76 @@
> > +ARM Mali Utgard GPU
> > +===================
> > +
> > +Required properties:
> > +  - compatible:
> > +    * "arm,mali-utgard" and one of the following:
> > +      + "arm,mali-300"
> > +      + "arm,mali-400"
> > +      + "arm,mali-450"
> > +
> > +  - reg: Physical base address and length of the GPU registers
> > +
> > +  - interrupts: an entry for each entry in interrupt-names.
> > +    See ../interrupt-controller/interrupts.txt for details.
> > +
> > +  - interrupt-names:
> > +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> > +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> > +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> > +    * gp: Geometry Processor interrupt
> > +    * gpmmu: Geometry Processor MMU interrupt
> > +
> > +
> > +Optional properties:
> > +  - interrupt-names:
> > +    * pmu: Power Management Unit interrupt, if implemented in hardware
> 
> On the MALI-400 MP in the ST-Ericsson DB8500 we have an additional interrupt
> called "Mali400 combined". This is simply the HW designer's
> doing an OR over all the 4 IRQ lines. Is this useful to define in the
> bindings? Then it should be an optional

Do you still have all the other interrupts, or just this combined interrupt?

Either way, that should definitely be part of the binding, but maybe
as part of the vendor specific binding below?

I didn't encounter any other platform doing so when I gave it a
(quick) look.

>  * combined: all lines OR:ed together (if available)
> 
> Also you are defining "resets" below in the examples, should
> this be listed as an optional property?

In my mind, this is not optional. For some platforms, it's mandatory,
and for some, it's not there at all. IMO, this should really be a
mandatory property, but only for the compatibles that use it (just
like the clocks are).

> > +The Mali GPU is integrated very differently from one SoC to
> > +another. In order to accommodate those differences, you have the option
> > +to specify one more vendor-specific compatible, among:
> > +
> > +  - allwinner,sun4i-a10-mali
> > +    Required properties:
> > +      * clocks: an entry for each entry in clock-names
> > +      * clock-names:
> > +        + bus: bus clock for the GPU
> > +        + core: clock driving the GPU itself
> > +      * resets: phandle to the reset line for the GPU
> > +
> > +  - allwinner,sun7i-a20-mali
> > +    Required properties:
> > +      * clocks: an entry for each entry in clock-names
> > +      * clock-names:
> > +        + bus: bus clock for the GPU
> > +        + core: clock driving the GPU itself
> > +      * resets: phandle to the reset line for the GPU
> 
> Please add:
> 
> - stericsson,db8500-mali: also known as the "Smart Graphics
> Accelerator" (SGA500)
>    Required properties:
>     * clocks: an entry for each entry in clock-names
>     * clock-names:
>       + bus: bus clock for the GPU (ICNCLK a.k.a. PRCMU_ACLK)
>       + core: clock driving the GPU itself (PRCMU_SGACLK)
>
> (It has no explicit reset line.)

Ack.

> With these:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
       [not found]         ` <4f5b8608-af6c-3ef5-aaf0-e7e034d006cd-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
  2017-01-17 11:33           ` Krzysztof Kozlowski
@ 2017-01-19 15:51           ` Maxime Ripard
  2017-01-19 16:02             ` Neil Armstrong
  1 sibling, 1 reply; 23+ messages in thread
From: Maxime Ripard @ 2017-01-19 15:51 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Krzysztof Kozlowski, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Boris Brezillon, Matthias Brugger, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart, Carlo Caione,
	Thomas Petazzoni,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

Hi Neil,

On Tue, Jan 17, 2017 at 11:22:22AM +0100, Neil Armstrong wrote:
> On 01/17/2017 10:38 AM, Maxime Ripard wrote:
> > Hi,
> > 
> > On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
> >> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> >>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> >>> Allwinner, Amlogic, Mediatek or Rockchip.
> >>>
> >>> Add a binding for the GPU of that family.
> >>>
> >>> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> >>> ---
> >>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >>>  1 file changed, 76 insertions(+)
> >>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> >>
> >> Do you have a driver in kernel which will implement these bindings?
> > 
> > No, but we have bindings for out-of-tree drivers already.
> > 
> >> Defining them for out-of-tree driver does not bring any benefits
> >> (3rd party driver will not respect them anyway).
> > 
> > You could see it the other way around too. The out-of-tree drivers
> > don't respect it at the moment because there's no binding to respect.
> > 
> > And at least for us, we definitely plan on doing that.
> > 
> > Maxime
> 
> Hi Maxime, Krzysztof,
> 
> We hope this will be accepted so it will solve the same issue we
> have on Amlogic SoCs and all the other mali powered SoCs.

Do you have any requirements (or weird case) that is not covered by
the current doc?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 15:51           ` Maxime Ripard
@ 2017-01-19 16:02             ` Neil Armstrong
  0 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2017-01-19 16:02 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree, Heiko Stuebner, Boris Brezillon,
	Kevin Hilman, Linus Walleij, Krzysztof Kozlowski,
	Javier Martinez Canillas, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Matthias Brugger, Thomas Petazzoni,
	Carlo Caione, Antoine Ténart, linux-arm-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 1743 bytes --]

On 01/19/2017 04:51 PM, Maxime Ripard wrote:
> Hi Neil,
> 
> On Tue, Jan 17, 2017 at 11:22:22AM +0100, Neil Armstrong wrote:
>> On 01/17/2017 10:38 AM, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
>>>> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
>>>>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>>>>> Allwinner, Amlogic, Mediatek or Rockchip.
>>>>>
>>>>> Add a binding for the GPU of that family.
>>>>>
>>>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>>>> ---
>>>>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>>>>>  1 file changed, 76 insertions(+)
>>>>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>>>
>>>> Do you have a driver in kernel which will implement these bindings?
>>>
>>> No, but we have bindings for out-of-tree drivers already.
>>>
>>>> Defining them for out-of-tree driver does not bring any benefits
>>>> (3rd party driver will not respect them anyway).
>>>
>>> You could see it the other way around too. The out-of-tree drivers
>>> don't respect it at the moment because there's no binding to respect.
>>>
>>> And at least for us, we definitely plan on doing that.
>>>
>>> Maxime
>>
>> Hi Maxime, Krzysztof,
>>
>> We hope this will be accepted so it will solve the same issue we
>> have on Amlogic SoCs and all the other mali powered SoCs.
> 
> Do you have any requirements (or weird case) that is not covered by
> the current doc?
> 
> Thanks,
> Maxime
> 

Hi Maxime,

Apart the GPU DVFS, all is covered by the current doc for the Amlogic Meson GXBB and GXL SoCs.

Neil


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-17  9:38     ` Maxime Ripard
  2017-01-17 10:22       ` Neil Armstrong
  2017-01-17 11:31       ` Krzysztof Kozlowski
@ 2017-01-19 16:08       ` Rob Herring
  2 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2017-01-19 16:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Krzysztof Kozlowski, Matthias Brugger, Chen-Yu Tsai, Kukjin Kim,
	Alexandre Belloni, Boris Brezillon, Antoine Ténart,
	Carlo Caione, Thomas Petazzoni, linux-arm-kernel

On Tue, Jan 17, 2017 at 10:38:13AM +0100, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Jan 16, 2017 at 08:49:06PM +0200, Krzysztof Kozlowski wrote:
> > On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> > > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> > > Allwinner, Amlogic, Mediatek or Rockchip.
> > > 
> > > Add a binding for the GPU of that family.
> > > 
> > > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > > ---
> > >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> > >  1 file changed, 76 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > 
> > Do you have a driver in kernel which will implement these bindings?
> 
> No, but we have bindings for out-of-tree drivers already.
> 
> > Defining them for out-of-tree driver does not bring any benefits
> > (3rd party driver will not respect them anyway).
> 
> You could see it the other way around too. The out-of-tree drivers
> don't respect it at the moment because there's no binding to respect.
> 
> And at least for us, we definitely plan on doing that.

I have no issue taking this. Bindings are in the kernel for 
convenience. Having a driver can help make sure they are complete and 
sound, but otherwise isn't strictly required.

In fact, the ARM folks already asked me about this, but you beat them to 
it (plus it's hard to get them to care about mali400 much).

Rob

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-16 13:24 [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Maxime Ripard
       [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  2017-01-18 23:09 ` Linus Walleij
@ 2017-01-19 16:16 ` Rob Herring
  2017-01-20  8:59   ` Maxime Ripard
  2017-01-19 19:24 ` John Stultz
  3 siblings, 1 reply; 23+ messages in thread
From: Rob Herring @ 2017-01-19 16:16 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Krzysztof Kozlowski, Matthias Brugger, Chen-Yu Tsai, Kukjin Kim,
	Alexandre Belloni, Boris Brezillon, Antoine Ténart,
	Carlo Caione, Thomas Petazzoni, linux-arm-kernel

On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> Allwinner, Amlogic, Mediatek or Rockchip.
> 
> Add a binding for the GPU of that family.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> 
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> new file mode 100644
> index 000000000000..df05ba0ec357
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> @@ -0,0 +1,76 @@
> +ARM Mali Utgard GPU
> +===================
> +
> +Required properties:
> +  - compatible:
> +    * "arm,mali-utgard" and one of the following:

Drop this. It's meaningless and 3 compatibles to match is the kernel is 
not a big deal.

> +      + "arm,mali-300"
> +      + "arm,mali-400"
> +      + "arm,mali-450"
> +
> +  - reg: Physical base address and length of the GPU registers
> +
> +  - interrupts: an entry for each entry in interrupt-names.
> +    See ../interrupt-controller/interrupts.txt for details.
> +
> +  - interrupt-names:
> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)

Is the number of pixel processors probe-able? If not, then it needs to 
be implied by the vendor compatible string or a property.

> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> +    * gp: Geometry Processor interrupt
> +    * gpmmu: Geometry Processor MMU interrupt

That's a lot of interrupts. Was going to ask about combining, but 
I see Linus raised that.

> +
> +
> +Optional properties:
> +  - interrupt-names:
> +    * pmu: Power Management Unit interrupt, if implemented in hardware
> +
> +Vendor-specific bindings
> +------------------------
> +
> +The Mali GPU is integrated very differently from one SoC to
> +another. In order to accommodate those differences, you have the option
> +to specify one more vendor-specific compatible, among:
> +
> +  - allwinner,sun4i-a10-mali

List this with the compatible strings. I assume one of the arm,mali-??? 
strings applies too.

> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself

This should be in the core binding. The number of clocks should not 
vary. We often get this wrong because the IP blocks get integrated and 
connected to the same clock source. But this should be equal to the 
number of clock inputs.

> +      * resets: phandle to the reset line for the GPU
> +
> +  - allwinner,sun7i-a20-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +Example:
> +
> +mali: gpu@01c40000 {
> +	compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
> +		     "arm,mali-utgard";
> +	reg = <0x01c40000 0x10000>;
> +	interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
> +		     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
> +	interrupt-names = "gp",
> +			  "gpmmu",
> +			  "pp0",
> +			  "ppmmu0",
> +			  "pp1",
> +			  "ppmmu1",
> +			  "pmu";
> +	clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
> +	clock-names = "bus", "core";
> +	resets = <&ccu RST_BUS_GPU>;
> +};
> +
> +
> -- 
> 2.11.0
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-16 13:24 [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Maxime Ripard
                   ` (2 preceding siblings ...)
  2017-01-19 16:16 ` Rob Herring
@ 2017-01-19 19:24 ` John Stultz
  2017-01-20  9:16   ` Maxime Ripard
                     ` (2 more replies)
  3 siblings, 3 replies; 23+ messages in thread
From: John Stultz @ 2017-01-19 19:24 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, Thomas Petazzoni, Heiko Stuebner,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Kevin Hilman, Linus Walleij, John Reitan, Krzysztof Kozlowski,
	Javier Martinez Canillas, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart,
	Matthias Brugger, Boris Brezillon, Carlo Caione,
	linux-arm-kernel@lists.infradead.org

On Mon, Jan 16, 2017 at 5:24 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> Allwinner, Amlogic, Mediatek or Rockchip.
>
> Add a binding for the GPU of that family.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> new file mode 100644
> index 000000000000..df05ba0ec357
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> @@ -0,0 +1,76 @@
> +ARM Mali Utgard GPU
> +===================
> +
> +Required properties:
> +  - compatible:
> +    * "arm,mali-utgard" and one of the following:
> +      + "arm,mali-300"
> +      + "arm,mali-400"
> +      + "arm,mali-450"
> +
> +  - reg: Physical base address and length of the GPU registers
> +
> +  - interrupts: an entry for each entry in interrupt-names.
> +    See ../interrupt-controller/interrupts.txt for details.
> +
> +  - interrupt-names:
> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> +    * gp: Geometry Processor interrupt
> +    * gpmmu: Geometry Processor MMU interrupt
> +
> +
> +Optional properties:
> +  - interrupt-names:
> +    * pmu: Power Management Unit interrupt, if implemented in hardware
> +
> +Vendor-specific bindings
> +------------------------
> +
> +The Mali GPU is integrated very differently from one SoC to
> +another. In order to accommodate those differences, you have the option
> +to specify one more vendor-specific compatible, among:
> +
> +  - allwinner,sun4i-a10-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +  - allwinner,sun7i-a20-mali
> +    Required properties:
> +      * clocks: an entry for each entry in clock-names
> +      * clock-names:
> +        + bus: bus clock for the GPU
> +        + core: clock driving the GPU itself
> +      * resets: phandle to the reset line for the GPU
> +
> +Example:
> +
> +mali: gpu@01c40000 {
> +       compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
> +                    "arm,mali-utgard";
> +       reg = <0x01c40000 0x10000>;
> +       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
> +                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
> +       interrupt-names = "gp",
> +                         "gpmmu",
> +                         "pp0",
> +                         "ppmmu0",
> +                         "pp1",
> +                         "ppmmu1",
> +                         "pmu";
> +       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
> +       clock-names = "bus", "core";
> +       resets = <&ccu RST_BUS_GPU>;
> +};
> +
> +


Having a mali utgard binding upstream would be great. However I'm a
little worried that the mali driver I've used sort of only half way
uses DT, and still requires a custom built in platform driver to setup
numerous other things.  Curious if you have a pointer to the kernel
driver you've been using with the vendor specific bindings above?  I'd
like to try to adapt what we have to your method to validate the above
as generic.

And, just for context, here's the node we've been using with hikey:

                mali:mali@f4080000 {
                        compatible = "arm,mali-450", "arm,mali-utgard";
                        reg = <0x0 0x3f100000 0x0 0x00708000>;
                        clocks = <&media_ctrl HI6220_G3D_CLK>,
                                 <&media_ctrl HI6220_G3D_PCLK>;
                        clock-names = "clk_g3d", "pclk_g3d";
                        mali_def_freq = <500>;
                        pclk_freq = <144>;
                        dfs_steps = <2>;
                        dfs_lockprf = <1>;
                        dfs_limit_max_prf = <1>;
                        dfs_profile_num = <2>;
                        dfs_profiles = <250 3 0>, <500 1 0>;
                        mali_type = <2>;

                        interrupt-parent = <&gic>;
                        interrupts =    <1 126 4>, /*gp*/
                                        <1 126 4>, /*gp mmu*/
                                        <1 126 4>, /*pp bc*/
                                        <1 126 4>, /*pmu*/
                                        <1 126 4>, /*pp0*/
                                        <1 126 4>,
                                        <1 126 4>, /*pp1*/
                                        <1 126 4>,
                                        <1 126 4>, /*pp2*/
                                        <1 126 4>,
                                        <1 126 4>, /*pp4*/
                                        <1 126 4>,
                                        <1 126 4>, /*pp5*/
                                        <1 126 4>,
                                        <1 126 4>, /*pp6*/
                                        <1 126 4>;
                        interrupt-names = "IRQGP", "IRQGPMMU",
"IRQPP", "IRQPMU",
                                        "IRQPP0", "IRQPPMMU0",
"IRQPP1", "IRQPPMMU1",
                                        "IRQPP2",
"IRQPPMMU2","IRQPP4", "IRQPPMMU4",
                                        "IRQPP5", "IRQPPMMU5",
"IRQPP6", "IRQPPMMU6";
                };



thanks
-john

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 16:16 ` Rob Herring
@ 2017-01-20  8:59   ` Maxime Ripard
  0 siblings, 0 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-20  8:59 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Rutland, devicetree, Heiko Stuebner,
	Javier Martinez Canillas, Kevin Hilman, Linus Walleij,
	Krzysztof Kozlowski, Matthias Brugger, Chen-Yu Tsai, Kukjin Kim,
	Alexandre Belloni, Boris Brezillon, Antoine Ténart,
	Carlo Caione, Thomas Petazzoni, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3773 bytes --]

Hi Rob,

On Thu, Jan 19, 2017 at 10:16:48AM -0600, Rob Herring wrote:
> On Mon, Jan 16, 2017 at 02:24:23PM +0100, Maxime Ripard wrote:
> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> > Allwinner, Amlogic, Mediatek or Rockchip.
> > 
> > Add a binding for the GPU of that family.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >  1 file changed, 76 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > new file mode 100644
> > index 000000000000..df05ba0ec357
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > @@ -0,0 +1,76 @@
> > +ARM Mali Utgard GPU
> > +===================
> > +
> > +Required properties:
> > +  - compatible:
> > +    * "arm,mali-utgard" and one of the following:
> 
> Drop this. It's meaningless and 3 compatibles to match is the kernel is 
> not a big deal.

Ok.

> > +      + "arm,mali-300"
> > +      + "arm,mali-400"
> > +      + "arm,mali-450"
> > +
> > +  - reg: Physical base address and length of the GPU registers
> > +
> > +  - interrupts: an entry for each entry in interrupt-names.
> > +    See ../interrupt-controller/interrupts.txt for details.
> > +
> > +  - interrupt-names:
> > +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> > +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> 
> Is the number of pixel processors probe-able? If not, then it needs to 
> be implied by the vendor compatible string or a property.

Yes, this is something that can be discovered by reading the pixel
processors version register. If the value is not 0, the processor is
there, otherwise it's not.

> > +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> > +    * gp: Geometry Processor interrupt
> > +    * gpmmu: Geometry Processor MMU interrupt
> 
> That's a lot of interrupts. Was going to ask about combining, but 
> I see Linus raised that.

Yes, apparently, some SoCs use that, but that doesn't seem to be a
standard feature (or at least, it's not used on our SoCs). So we're
stuck with those :/

> > +Optional properties:
> > +  - interrupt-names:
> > +    * pmu: Power Management Unit interrupt, if implemented in hardware
> > +
> > +Vendor-specific bindings
> > +------------------------
> > +
> > +The Mali GPU is integrated very differently from one SoC to
> > +another. In order to accommodate those differences, you have the option
> > +to specify one more vendor-specific compatible, among:
> > +
> > +  - allwinner,sun4i-a10-mali
> 
> List this with the compatible strings. I assume one of the arm,mali-??? 
> strings applies too.

Yep.

> > +    Required properties:
> > +      * clocks: an entry for each entry in clock-names
> > +      * clock-names:
> > +        + bus: bus clock for the GPU
> > +        + core: clock driving the GPU itself
> 
> This should be in the core binding. The number of clocks should not 
> vary. We often get this wrong because the IP blocks get integrated and 
> connected to the same clock source. But this should be equal to the 
> number of clock inputs.

Ok. So far, the Allwinner one and the examples from Linus and John
have been using two clocks, but apparently on rockchip it's using a
single one, which is why I made it that way. I'll move that to the
core binding.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 15:49   ` Maxime Ripard
@ 2017-01-20  9:16     ` Linus Walleij
  0 siblings, 0 replies; 23+ messages in thread
From: Linus Walleij @ 2017-01-20  9:16 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Rob Herring, Mark Rutland, Chen-Yu Tsai,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Carlo Caione,
	Kevin Hilman, Heiko Stuebner, Matthias Brugger, Kukjin Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Alexandre Belloni,
	Thomas Petazzoni, Boris Brezillon, Antoine Ténart

On Thu, Jan 19, 2017 at 4:49 PM, Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:

>> > +Optional properties:
>> > +  - interrupt-names:
>> > +    * pmu: Power Management Unit interrupt, if implemented in hardware
>>
>> On the MALI-400 MP in the ST-Ericsson DB8500 we have an additional interrupt
>> called "Mali400 combined". This is simply the HW designer's
>> doing an OR over all the 4 IRQ lines. Is this useful to define in the
>> bindings? Then it should be an optional
>
> Do you still have all the other interrupts, or just this combined interrupt?

We have the others too, I guess some HW engineer just thought it'd
be nice to have the combo.

> Either way, that should definitely be part of the binding, but maybe
> as part of the vendor specific binding below?

OK.

>>  * combined: all lines OR:ed together (if available)
>>
>> Also you are defining "resets" below in the examples, should
>> this be listed as an optional property?
>
> In my mind, this is not optional. For some platforms, it's mandatory,
> and for some, it's not there at all. IMO, this should really be a
> mandatory property, but only for the compatibles that use it (just
> like the clocks are).

OK.

Yours,
LInus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 19:24 ` John Stultz
@ 2017-01-20  9:16   ` Maxime Ripard
  2017-01-20 14:15     ` Rob Herring
  2017-01-20 14:10   ` Rob Herring
  2017-01-26 17:15   ` Mason
  2 siblings, 1 reply; 23+ messages in thread
From: Maxime Ripard @ 2017-01-20  9:16 UTC (permalink / raw)
  To: John Stultz
  Cc: Mark Rutland, Thomas Petazzoni, Heiko Stuebner,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Kevin Hilman, Linus Walleij, John Reitan, Krzysztof Kozlowski,
	Javier Martinez Canillas, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Ténart,
	Matthias Brugger, Boris Brezillon, Carlo Caione,
	linux-arm-kernel@lists.infradead.org


[-- Attachment #1.1: Type: text/plain, Size: 7944 bytes --]

Hi John,

On Thu, Jan 19, 2017 at 11:24:38AM -0800, John Stultz wrote:
> On Mon, Jan 16, 2017 at 5:24 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
> > Allwinner, Amlogic, Mediatek or Rockchip.
> >
> > Add a binding for the GPU of that family.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
> >  1 file changed, 76 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> >
> > diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > new file mode 100644
> > index 000000000000..df05ba0ec357
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
> > @@ -0,0 +1,76 @@
> > +ARM Mali Utgard GPU
> > +===================
> > +
> > +Required properties:
> > +  - compatible:
> > +    * "arm,mali-utgard" and one of the following:
> > +      + "arm,mali-300"
> > +      + "arm,mali-400"
> > +      + "arm,mali-450"
> > +
> > +  - reg: Physical base address and length of the GPU registers
> > +
> > +  - interrupts: an entry for each entry in interrupt-names.
> > +    See ../interrupt-controller/interrupts.txt for details.
> > +
> > +  - interrupt-names:
> > +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
> > +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
> > +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
> > +    * gp: Geometry Processor interrupt
> > +    * gpmmu: Geometry Processor MMU interrupt
> > +
> > +
> > +Optional properties:
> > +  - interrupt-names:
> > +    * pmu: Power Management Unit interrupt, if implemented in hardware
> > +
> > +Vendor-specific bindings
> > +------------------------
> > +
> > +The Mali GPU is integrated very differently from one SoC to
> > +another. In order to accommodate those differences, you have the option
> > +to specify one more vendor-specific compatible, among:
> > +
> > +  - allwinner,sun4i-a10-mali
> > +    Required properties:
> > +      * clocks: an entry for each entry in clock-names
> > +      * clock-names:
> > +        + bus: bus clock for the GPU
> > +        + core: clock driving the GPU itself
> > +      * resets: phandle to the reset line for the GPU
> > +
> > +  - allwinner,sun7i-a20-mali
> > +    Required properties:
> > +      * clocks: an entry for each entry in clock-names
> > +      * clock-names:
> > +        + bus: bus clock for the GPU
> > +        + core: clock driving the GPU itself
> > +      * resets: phandle to the reset line for the GPU
> > +
> > +Example:
> > +
> > +mali: gpu@01c40000 {
> > +       compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
> > +                    "arm,mali-utgard";
> > +       reg = <0x01c40000 0x10000>;
> > +       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
> > +                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
> > +       interrupt-names = "gp",
> > +                         "gpmmu",
> > +                         "pp0",
> > +                         "ppmmu0",
> > +                         "pp1",
> > +                         "ppmmu1",
> > +                         "pmu";
> > +       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
> > +       clock-names = "bus", "core";
> > +       resets = <&ccu RST_BUS_GPU>;
> > +};
> 
> Having a mali utgard binding upstream would be great. However I'm a
> little worried that the mali driver I've used sort of only half way
> uses DT, and still requires a custom built in platform driver to setup
> numerous other things.  Curious if you have a pointer to the kernel
> driver you've been using with the vendor specific bindings above?  I'd
> like to try to adapt what we have to your method to validate the above
> as generic.

I've created a custom platform driver, so just like you it seems,
because I've not managed to make ARM's DT support work.

https://github.com/mripard/sunxi-mali/blob/master/driver/src/devicedrv/mali/platform/sunxi/sunxi.c

I haven't updated it yet with the bindings suggested above, but only
the interrupt and clock names have changed. The rest very much
applies.

The only thing that might be vendor specific would be the (optional)
declaration of the mali_gpu_device_data structure. As far as I know,
there's two things of importance there:
  - the list of the valid OPPs in order to do DVFS, but that could be
    made generic too using the operating-points binding

  - And the valid area for the buffers for the fbdev blobs (fb_start,
    fb_size and shared_mem_size). I'm not entirely happy with this one
    so far (which is also why I've not pushed it). We'd need to come
    up with a way to get the base address and size of the CMA region
    backing the framebuffer allocation, but I haven't find any trivial
    way to do so, so for now I just hardcoded it. Worst case scenario,
    we can hardcode values based on the compatible.

> And, just for context, here's the node we've been using with hikey:
> 
>                 mali:mali@f4080000 {
>                         compatible = "arm,mali-450", "arm,mali-utgard";
>                         reg = <0x0 0x3f100000 0x0 0x00708000>;

This is because the hikey is using a 64 bits CPU, right?

>                         clocks = <&media_ctrl HI6220_G3D_CLK>,
>                                  <&media_ctrl HI6220_G3D_PCLK>;
>                         clock-names = "clk_g3d", "pclk_g3d";
>                         mali_def_freq = <500>;
>                         pclk_freq = <144>;
>                         dfs_steps = <2>;
>                         dfs_lockprf = <1>;
>                         dfs_limit_max_prf = <1>;
>                         dfs_profile_num = <2>;
>                         dfs_profiles = <250 3 0>, <500 1 0>;
>                         mali_type = <2>;
> 
>                         interrupt-parent = <&gic>;
>                         interrupts =    <1 126 4>, /*gp*/
>                                         <1 126 4>, /*gp mmu*/
>                                         <1 126 4>, /*pp bc*/
>                                         <1 126 4>, /*pmu*/
>                                         <1 126 4>, /*pp0*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp1*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp2*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp4*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp5*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp6*/
>                                         <1 126 4>;
>                         interrupt-names = "IRQGP", "IRQGPMMU",
> "IRQPP", "IRQPMU",
>                                         "IRQPP0", "IRQPPMMU0",
> "IRQPP1", "IRQPPMMU1",
>                                         "IRQPP2",
> "IRQPPMMU2","IRQPP4", "IRQPPMMU4",
>                                         "IRQPP5", "IRQPPMMU5",
> "IRQPP6", "IRQPPMMU6";
>                 };

So all your interrupts are shared?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 19:24 ` John Stultz
  2017-01-20  9:16   ` Maxime Ripard
@ 2017-01-20 14:10   ` Rob Herring
  2017-01-26 17:15   ` Mason
  2 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2017-01-20 14:10 UTC (permalink / raw)
  To: John Stultz
  Cc: Maxime Ripard, Mark Rutland, Thomas Petazzoni,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Heiko Stuebner, Javier Martinez Canillas, Kevin Hilman,
	Linus Walleij, Krzysztof Kozlowski, Matthias Brugger,
	Chen-Yu Tsai, Kukjin Kim, Alexandre Belloni, Boris Brezillon,
	Carlo Caione, Antoine Ténart, linux-arm-kernel

On Thu, Jan 19, 2017 at 1:24 PM, John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Mon, Jan 16, 2017 at 5:24 AM, Maxime Ripard
> <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>> Allwinner, Amlogic, Mediatek or Rockchip.
>>
>> Add a binding for the GPU of that family.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>> ---
>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>>  1 file changed, 76 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>
>> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> new file mode 100644
>> index 000000000000..df05ba0ec357
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> @@ -0,0 +1,76 @@
>> +ARM Mali Utgard GPU
>> +===================
>> +
>> +Required properties:
>> +  - compatible:
>> +    * "arm,mali-utgard" and one of the following:
>> +      + "arm,mali-300"
>> +      + "arm,mali-400"
>> +      + "arm,mali-450"
>> +
>> +  - reg: Physical base address and length of the GPU registers
>> +
>> +  - interrupts: an entry for each entry in interrupt-names.
>> +    See ../interrupt-controller/interrupts.txt for details.
>> +
>> +  - interrupt-names:
>> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
>> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
>> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
>> +    * gp: Geometry Processor interrupt
>> +    * gpmmu: Geometry Processor MMU interrupt
>> +
>> +
>> +Optional properties:
>> +  - interrupt-names:
>> +    * pmu: Power Management Unit interrupt, if implemented in hardware
>> +
>> +Vendor-specific bindings
>> +------------------------
>> +
>> +The Mali GPU is integrated very differently from one SoC to
>> +another. In order to accommodate those differences, you have the option
>> +to specify one more vendor-specific compatible, among:
>> +
>> +  - allwinner,sun4i-a10-mali
>> +    Required properties:
>> +      * clocks: an entry for each entry in clock-names
>> +      * clock-names:
>> +        + bus: bus clock for the GPU
>> +        + core: clock driving the GPU itself
>> +      * resets: phandle to the reset line for the GPU
>> +
>> +  - allwinner,sun7i-a20-mali
>> +    Required properties:
>> +      * clocks: an entry for each entry in clock-names
>> +      * clock-names:
>> +        + bus: bus clock for the GPU
>> +        + core: clock driving the GPU itself
>> +      * resets: phandle to the reset line for the GPU
>> +
>> +Example:
>> +
>> +mali: gpu@01c40000 {
>> +       compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
>> +                    "arm,mali-utgard";
>> +       reg = <0x01c40000 0x10000>;
>> +       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
>> +       interrupt-names = "gp",
>> +                         "gpmmu",
>> +                         "pp0",
>> +                         "ppmmu0",
>> +                         "pp1",
>> +                         "ppmmu1",
>> +                         "pmu";
>> +       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
>> +       clock-names = "bus", "core";
>> +       resets = <&ccu RST_BUS_GPU>;
>> +};
>> +
>> +
>
>
> Having a mali utgard binding upstream would be great. However I'm a
> little worried that the mali driver I've used sort of only half way
> uses DT, and still requires a custom built in platform driver to setup
> numerous other things.  Curious if you have a pointer to the kernel
> driver you've been using with the vendor specific bindings above?  I'd
> like to try to adapt what we have to your method to validate the above
> as generic.
>
> And, just for context, here's the node we've been using with hikey:
>
>                 mali:mali@f4080000 {
>                         compatible = "arm,mali-450", "arm,mali-utgard";
>                         reg = <0x0 0x3f100000 0x0 0x00708000>;

Why's the size 7MB?

>                         clocks = <&media_ctrl HI6220_G3D_CLK>,
>                                  <&media_ctrl HI6220_G3D_PCLK>;
>                         clock-names = "clk_g3d", "pclk_g3d";

Seems like these are swapped from Maxime's order. Based on the pclk
frequency, that's the bus clock.

>                         mali_def_freq = <500>;
>                         pclk_freq = <144>;

There's a standard property for these with assigned-clocks.

>                         dfs_steps = <2>;
>                         dfs_lockprf = <1>;
>                         dfs_limit_max_prf = <1>;
>                         dfs_profile_num = <2>;
>                         dfs_profiles = <250 3 0>, <500 1 0>;

This looks like a OPP table. It can all be driver data associated with
the compatible string for now.

>                         mali_type = <2>;

Not sure about this one.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-20  9:16   ` Maxime Ripard
@ 2017-01-20 14:15     ` Rob Herring
       [not found]       ` <CAL_JsqL5fYVvCRgui9NQVEM+=gkGUnf7-D9KHK9YTtJyfGy3Ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Rob Herring @ 2017-01-20 14:15 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Mark Rutland, Thomas Petazzoni, Heiko Stuebner,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Kevin Hilman, Linus Walleij, John Reitan, Krzysztof Kozlowski,
	Javier Martinez Canillas, Chen-Yu Tsai, Kukjin Kim, John Stultz,
	Boris Brezillon, Antoine Ténart, Matthias Brugger,
	Alexandre Belloni, Carlo Caione,
	linux-arm-kernel@lists.infradead.org

On Fri, Jan 20, 2017 at 3:16 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi John,
>
> On Thu, Jan 19, 2017 at 11:24:38AM -0800, John Stultz wrote:
>> On Mon, Jan 16, 2017 at 5:24 AM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>> > Allwinner, Amlogic, Mediatek or Rockchip.
>> >
>> > Add a binding for the GPU of that family.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> > ---
>> >  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>> >  1 file changed, 76 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> >
>> > diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> > new file mode 100644
>> > index 000000000000..df05ba0ec357
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> > @@ -0,0 +1,76 @@
>> > +ARM Mali Utgard GPU
>> > +===================
>> > +
>> > +Required properties:
>> > +  - compatible:
>> > +    * "arm,mali-utgard" and one of the following:
>> > +      + "arm,mali-300"
>> > +      + "arm,mali-400"
>> > +      + "arm,mali-450"
>> > +
>> > +  - reg: Physical base address and length of the GPU registers
>> > +
>> > +  - interrupts: an entry for each entry in interrupt-names.
>> > +    See ../interrupt-controller/interrupts.txt for details.
>> > +
>> > +  - interrupt-names:
>> > +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
>> > +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
>> > +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
>> > +    * gp: Geometry Processor interrupt
>> > +    * gpmmu: Geometry Processor MMU interrupt
>> > +
>> > +
>> > +Optional properties:
>> > +  - interrupt-names:
>> > +    * pmu: Power Management Unit interrupt, if implemented in hardware
>> > +
>> > +Vendor-specific bindings
>> > +------------------------
>> > +
>> > +The Mali GPU is integrated very differently from one SoC to
>> > +another. In order to accommodate those differences, you have the option
>> > +to specify one more vendor-specific compatible, among:
>> > +
>> > +  - allwinner,sun4i-a10-mali
>> > +    Required properties:
>> > +      * clocks: an entry for each entry in clock-names
>> > +      * clock-names:
>> > +        + bus: bus clock for the GPU
>> > +        + core: clock driving the GPU itself
>> > +      * resets: phandle to the reset line for the GPU
>> > +
>> > +  - allwinner,sun7i-a20-mali
>> > +    Required properties:
>> > +      * clocks: an entry for each entry in clock-names
>> > +      * clock-names:
>> > +        + bus: bus clock for the GPU
>> > +        + core: clock driving the GPU itself
>> > +      * resets: phandle to the reset line for the GPU
>> > +
>> > +Example:
>> > +
>> > +mali: gpu@01c40000 {
>> > +       compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
>> > +                    "arm,mali-utgard";
>> > +       reg = <0x01c40000 0x10000>;
>> > +       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
>> > +                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
>> > +       interrupt-names = "gp",
>> > +                         "gpmmu",
>> > +                         "pp0",
>> > +                         "ppmmu0",
>> > +                         "pp1",
>> > +                         "ppmmu1",
>> > +                         "pmu";
>> > +       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
>> > +       clock-names = "bus", "core";
>> > +       resets = <&ccu RST_BUS_GPU>;
>> > +};
>>
>> Having a mali utgard binding upstream would be great. However I'm a
>> little worried that the mali driver I've used sort of only half way
>> uses DT, and still requires a custom built in platform driver to setup
>> numerous other things.  Curious if you have a pointer to the kernel
>> driver you've been using with the vendor specific bindings above?  I'd
>> like to try to adapt what we have to your method to validate the above
>> as generic.
>
> I've created a custom platform driver, so just like you it seems,
> because I've not managed to make ARM's DT support work.
>
> https://github.com/mripard/sunxi-mali/blob/master/driver/src/devicedrv/mali/platform/sunxi/sunxi.c
>
> I haven't updated it yet with the bindings suggested above, but only
> the interrupt and clock names have changed. The rest very much
> applies.
>
> The only thing that might be vendor specific would be the (optional)
> declaration of the mali_gpu_device_data structure. As far as I know,
> there's two things of importance there:
>   - the list of the valid OPPs in order to do DVFS, but that could be
>     made generic too using the operating-points binding
>
>   - And the valid area for the buffers for the fbdev blobs (fb_start,
>     fb_size and shared_mem_size). I'm not entirely happy with this one
>     so far (which is also why I've not pushed it). We'd need to come
>     up with a way to get the base address and size of the CMA region
>     backing the framebuffer allocation, but I haven't find any trivial
>     way to do so, so for now I just hardcoded it. Worst case scenario,
>     we can hardcode values based on the compatible.

memory-region property?

>
>> And, just for context, here's the node we've been using with hikey:
>>
>>                 mali:mali@f4080000 {
>>                         compatible = "arm,mali-450", "arm,mali-utgard";
>>                         reg = <0x0 0x3f100000 0x0 0x00708000>;
>
> This is because the hikey is using a 64 bits CPU, right?

Having 2 cells for address and size is generally entirely pointless.
The peripheral regions generally don't need 64-bits of address space
or size. ranges should be used.

Rob

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
       [not found]       ` <CAL_JsqL5fYVvCRgui9NQVEM+=gkGUnf7-D9KHK9YTtJyfGy3Ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-01-23 12:34         ` Maxime Ripard
  0 siblings, 0 replies; 23+ messages in thread
From: Maxime Ripard @ 2017-01-23 12:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: John Stultz, Mark Rutland, Thomas Petazzoni,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Heiko Stuebner, Javier Martinez Canillas, Kevin Hilman,
	Linus Walleij, Krzysztof Kozlowski, Matthias Brugger,
	Chen-Yu Tsai, Kukjin Kim, Alexandre Belloni, Boris Brezillon,
	Carlo Caione, Antoine Ténart, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

Hi Rob,

On Fri, Jan 20, 2017 at 08:15:21AM -0600, Rob Herring wrote:
> > The only thing that might be vendor specific would be the (optional)
> > declaration of the mali_gpu_device_data structure. As far as I know,
> > there's two things of importance there:
> >   - the list of the valid OPPs in order to do DVFS, but that could be
> >     made generic too using the operating-points binding
> >
> >   - And the valid area for the buffers for the fbdev blobs (fb_start,
> >     fb_size and shared_mem_size). I'm not entirely happy with this one
> >     so far (which is also why I've not pushed it). We'd need to come
> >     up with a way to get the base address and size of the CMA region
> >     backing the framebuffer allocation, but I haven't find any trivial
> >     way to do so, so for now I just hardcoded it. Worst case scenario,
> >     we can hardcode values based on the compatible.
> 
> memory-region property?

That might do it, however those buffers usually are allocated by the
display engine, and not the GPU device. Even if we declare a reserved
memory region and use memory-region in the GPU node, chances are that
buffers allocated for the display may not be in that region (for
example if it's using the default CMA pool).

Unless we create a memory region for the default CMA pool?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings
  2017-01-19 19:24 ` John Stultz
  2017-01-20  9:16   ` Maxime Ripard
  2017-01-20 14:10   ` Rob Herring
@ 2017-01-26 17:15   ` Mason
  2 siblings, 0 replies; 23+ messages in thread
From: Mason @ 2017-01-26 17:15 UTC (permalink / raw)
  To: John Stultz, Maxime Ripard
  Cc: Mark Rutland, Thomas Petazzoni, Heiko Stuebner, Kevin Hilman,
	Linus Walleij, John Reitan, Krzysztof Kozlowski,
	Javier Martinez Canillas, Chen-Yu Tsai, Rob Herring,
	Alexandre Belloni, Kukjin Kim, Antoine Tenart, Matthias Brugger,
	Boris Brezillon, Carlo Caione, Linux ARM, DT, Thibaud

On 19/01/2017 20:24, John Stultz wrote:

> On Mon, Jan 16, 2017 at 5:24 AM, Maxime Ripard wrote:
>
>> The ARM Mali Utgard GPU family is embedded into a number of SoCs from
>> Allwinner, Amlogic, Mediatek or Rockchip.
>>
>> Add a binding for the GPU of that family.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>> ---
>>  .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 76 ++++++++++++++++++++++
>>  1 file changed, 76 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>>
>> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> new file mode 100644
>> index 000000000000..df05ba0ec357
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
>> @@ -0,0 +1,76 @@
>> +ARM Mali Utgard GPU
>> +===================
>> +
>> +Required properties:
>> +  - compatible:
>> +    * "arm,mali-utgard" and one of the following:
>> +      + "arm,mali-300"
>> +      + "arm,mali-400"
>> +      + "arm,mali-450"
>> +
>> +  - reg: Physical base address and length of the GPU registers
>> +
>> +  - interrupts: an entry for each entry in interrupt-names.
>> +    See ../interrupt-controller/interrupts.txt for details.
>> +
>> +  - interrupt-names:
>> +    * ppX: Pixel Processor X interrupt (X from 0 to 7)
>> +    * ppmmuX: Pixel Processor X MMU interrupt (X from 0 to 7)
>> +    * pp: Pixel Processor broadcast interrupt (mali-450 only)
>> +    * gp: Geometry Processor interrupt
>> +    * gpmmu: Geometry Processor MMU interrupt
>> +
>> +
>> +Optional properties:
>> +  - interrupt-names:
>> +    * pmu: Power Management Unit interrupt, if implemented in hardware
>> +
>> +Vendor-specific bindings
>> +------------------------
>> +
>> +The Mali GPU is integrated very differently from one SoC to
>> +another. In order to accommodate those differences, you have the option
>> +to specify one more vendor-specific compatible, among:
>> +
>> +  - allwinner,sun4i-a10-mali
>> +    Required properties:
>> +      * clocks: an entry for each entry in clock-names
>> +      * clock-names:
>> +        + bus: bus clock for the GPU
>> +        + core: clock driving the GPU itself
>> +      * resets: phandle to the reset line for the GPU
>> +
>> +  - allwinner,sun7i-a20-mali
>> +    Required properties:
>> +      * clocks: an entry for each entry in clock-names
>> +      * clock-names:
>> +        + bus: bus clock for the GPU
>> +        + core: clock driving the GPU itself
>> +      * resets: phandle to the reset line for the GPU
>> +
>> +Example:
>> +
>> +mali: gpu@01c40000 {
>> +       compatible = "allwinner,sun7i-a20-mali", "arm,mali-400",
>> +                    "arm,mali-utgard";
>> +       reg = <0x01c40000 0x10000>;
>> +       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
>> +                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
>> +       interrupt-names = "gp",
>> +                         "gpmmu",
>> +                         "pp0",
>> +                         "ppmmu0",
>> +                         "pp1",
>> +                         "ppmmu1",
>> +                         "pmu";
>> +       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
>> +       clock-names = "bus", "core";
>> +       resets = <&ccu RST_BUS_GPU>;
>> +};
>> +
>> +
> 
> 
> Having a mali utgard binding upstream would be great. However I'm a
> little worried that the mali driver I've used sort of only half way
> uses DT, and still requires a custom built in platform driver to setup
> numerous other things.  Curious if you have a pointer to the kernel
> driver you've been using with the vendor specific bindings above?  I'd
> like to try to adapt what we have to your method to validate the above
> as generic.
> 
> And, just for context, here's the node we've been using with hikey:
> 
>                 mali:mali@f4080000 {
>                         compatible = "arm,mali-450", "arm,mali-utgard";
>                         reg = <0x0 0x3f100000 0x0 0x00708000>;
>                         clocks = <&media_ctrl HI6220_G3D_CLK>,
>                                  <&media_ctrl HI6220_G3D_PCLK>;
>                         clock-names = "clk_g3d", "pclk_g3d";
>                         mali_def_freq = <500>;
>                         pclk_freq = <144>;
>                         dfs_steps = <2>;
>                         dfs_lockprf = <1>;
>                         dfs_limit_max_prf = <1>;
>                         dfs_profile_num = <2>;
>                         dfs_profiles = <250 3 0>, <500 1 0>;
>                         mali_type = <2>;
> 
>                         interrupt-parent = <&gic>;
>                         interrupts =    <1 126 4>, /*gp*/
>                                         <1 126 4>, /*gp mmu*/
>                                         <1 126 4>, /*pp bc*/
>                                         <1 126 4>, /*pmu*/
>                                         <1 126 4>, /*pp0*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp1*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp2*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp4*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp5*/
>                                         <1 126 4>,
>                                         <1 126 4>, /*pp6*/
>                                         <1 126 4>;
>                         interrupt-names = "IRQGP", "IRQGPMMU", "IRQPP", "IRQPMU",
>                                         "IRQPP0", "IRQPPMMU0", "IRQPP1", "IRQPPMMU1",
>                                         "IRQPP2", "IRQPPMMU2", "IRQPP4", "IRQPPMMU4",
>                                         "IRQPP5", "IRQPPMMU5", "IRQPP6", "IRQPPMMU6";
>                 };

Interesting. Thanks for sharing.

The SoC I work on (tango4 smp8758) also embeds a Mali-400 MP4.
(IIUC, MP4 means 4 shader cores?)

I have seen
	https://github.com/mripard/sunxi-mali/blob/r6p2/driver/src/devicedrv/mali/platform/sunxi/sunxi.c
in the past, but I suppose it's time to take a much closer look.

Regards.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-01-26 17:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16 13:24 [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Maxime Ripard
     [not found] ` <20170116132424.7038-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-01-16 13:24   ` [PATCH 2/2] ARM: sun8i: dt: Add mali node Maxime Ripard
2017-01-16 18:49   ` [PATCH 1/2] dt-bindings: gpu: Add Mali Utgard bindings Krzysztof Kozlowski
2017-01-17  9:38     ` Maxime Ripard
2017-01-17 10:22       ` Neil Armstrong
     [not found]         ` <4f5b8608-af6c-3ef5-aaf0-e7e034d006cd-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2017-01-17 11:33           ` Krzysztof Kozlowski
2017-01-17 20:50             ` Maxime Ripard
2017-01-19 15:51           ` Maxime Ripard
2017-01-19 16:02             ` Neil Armstrong
2017-01-17 11:31       ` Krzysztof Kozlowski
2017-01-17 20:51         ` Maxime Ripard
2017-01-19 16:08       ` Rob Herring
2017-01-18 23:09 ` Linus Walleij
2017-01-19 15:49   ` Maxime Ripard
2017-01-20  9:16     ` Linus Walleij
2017-01-19 16:16 ` Rob Herring
2017-01-20  8:59   ` Maxime Ripard
2017-01-19 19:24 ` John Stultz
2017-01-20  9:16   ` Maxime Ripard
2017-01-20 14:15     ` Rob Herring
     [not found]       ` <CAL_JsqL5fYVvCRgui9NQVEM+=gkGUnf7-D9KHK9YTtJyfGy3Ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-23 12:34         ` Maxime Ripard
2017-01-20 14:10   ` Rob Herring
2017-01-26 17:15   ` Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).