Skip to contentSkip to conversation

ARM: dts: rockchip: add Utgard Mali nodes for some socs

PATCH Superseded Heiko Stuebner 2 participants 12 messages Sep 15, 2017 – Sep 22, 2017

Subsystems (4)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

v2 cover ARM: dts: rockchip: add Utgard Mali nodes for some socs

This adds a mali-supply similar to the Midgard binding, the compatibles for 3 Rockchip socs and the nodes for these.

The rk3036 and rk3188 gpus were tested, on the boards that get their gpus enabled, using the current Lima resurrection project and were able to probe the gpus sucessfully and draw a nice red-triangle in an off-screen application.

The only special thing Rockchip Malis do, is that all MMUs have a shared interrupt and all PPs also have a shared interrupt, but that works out well with the current binding.

changes in v2:
- adapt to Rob's comment for the compatibles, not sure how I could miss the long compatible list at the top in the first place :-)
- add Rob's Ack for patch 2 and adapt styling to match the other properties
- add power-domains as optional property

The power-domains are missing from the actual devicetree patches for now, as the rk3036 does not have any and I just submitted power-domain support for rk3188 in a separate series. So while the rk3188 needs a power-domain it's driver is still in-flight :-)

Heiko Stuebner (8):
dt-bindings: gpu: mali-utgard: Add Rockchip Utgard Malis
dt-bindings: gpu: mali-utgard: add optional supply regulator
dt-bindings: gpu: mali-utgard: add optional power-domain reference
ARM: dts: rockchip: add rk3036 gpu node
ARM: dts: rockchip: enable the gpu on rk3036-kylin boards
ARM: dts: rockchip: add rk322x gpu node
ARM: dts: rockchip: add gpu nodes on rk3066/rk3188
ARM: dts: rockchip: enable gpu on rk3188-radxarock

 .../devicetree/bindings/gpu/arm,mali-utgard.txt    | 16 +++++++++++++++
 arch/arm/boot/dts/rk3036-kylin.dts                 |  5 +++++
 arch/arm/boot/dts/rk3036.dtsi                      | 19 +++++++++++++++++
 arch/arm/boot/dts/rk3066a.dtsi                     | 24 ++++++++++++++++++++++
 arch/arm/boot/dts/rk3188-radxarock.dts             |  4 ++++
 arch/arm/boot/dts/rk3188.dtsi                      | 24 ++++++++++++++++++++++
 arch/arm/boot/dts/rk322x.dtsi                      | 21 +++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi                      | 11 ++++++++++
 8 files changed, 124 insertions(+)
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH v2 1/8 dt-bindings: gpu: mali-utgard: Add Rockchip Utgard Malis

Some (older or lower power) Rockchip socs use Utgard-based Mali-GPUs. So add the necessary compatibles for them. As the setup is the same for all of them (needing only the additional reset line), they get added in a somewhat condensed form, to not inflate the document unnecessary.

---
 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt +8 -0
index b4ebd56d03f3..24aacafb2594 100644
@@ -13,6 +13,10 @@ Required properties:
       + allwinner,sun50i-h5-mali
       + amlogic,meson-gxbb-mali
       + amlogic,meson-gxl-mali
+      + rockchip,rk3036-mali
+      + rockchip,rk3066-mali
+      + rockchip,rk3188-mali
+      + rockchip,rk3228-mali
       + stericsson,db8500-mali
 
   - reg: Physical base address and length of the GPU registers
@@ -63,6 +67,10 @@ to specify one more vendor-specific compatible, among:
     Required properties:
       * resets: phandle to the reset line for the GPU
 
+  - Rockchip variants:
+    Required properties:
+      * resets: phandle to the reset line for the GPU
+
   - stericsson,db8500-mali
     Required properties:
       * interrupt-names and interrupts:
Signature · 1 line
2.14.1
author maintainer
#3 lore raw

PATCH v2 2/8 dt-bindings: gpu: mali-utgard: add optional supply regulator

In reply to Heiko Stuebner

Mali GPUs have a separate supplying regulator in a lot of socs, so describe a mali-supply property. The already described operating points will likely also need access to this regulator.

---
 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt +4 -0
index 24aacafb2594..25ebf4140e69 100644
@@ -44,6 +44,10 @@ Optional properties:
     Memory region to allocate from, as defined in
     Documentation/devicetree/bindi/reserved-memory/reserved-memory.txt
 
+  - mali-supply:
+    Phandle to regulator for the Mali device, as defined in
+    Documentation/devicetree/bindings/regulator/regulator.txt for details.
+
   - operating-points-v2:
     Operating Points for the GPU, as defined in
     Documentation/devicetree/bindings/opp/opp.txt
Signature · 1 line
2.14.1
author maintainer
#4 lore raw

PATCH v2 3/8 dt-bindings: gpu: mali-utgard: add optional power-domain reference

In reply to Heiko Stuebner

On some socs Mali Utgard gpu have both soc power-domains and external supplying regulators, so add an optional power-domains property for reference.

---
 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt +4 -0
index 25ebf4140e69..c6814d7cc2b2 100644
@@ -52,6 +52,10 @@ Optional properties:
     Operating Points for the GPU, as defined in
     Documentation/devicetree/bindings/opp/opp.txt
 
+  - power-domains:
+    A power domain consumer specifier as defined in
+    Documentation/devicetree/bindings/power/power_domain.txt
+
 Vendor-specific bindings
 ------------------------
 
Signature · 1 line
2.14.1
author maintainer
#6 lore raw

PATCH v2 4/8 ARM: dts: rockchip: add rk3036 gpu node

In reply to Heiko Stuebner

The rk3036 uses a Mali400 GPU with one pixel processor. This adds the core node for it, which can be enabled in board devicetrees.

Rockchip Mali GPUs use only one clock line for both bus and core.

---
 arch/arm/boot/dts/rk3036.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/rk3036.dtsi +19 -0
index 4916c65e0ace..5b084c0143ce 100644
@@ -152,6 +152,25 @@
 		};
 	};
 
+	gpu: gpu at 10090000 {
+		compatible = "rockchip,rk3036-mali", "arm,mali-400";
+		reg = <0x10090000 0x10000>;
+		interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "gp",
+				  "gpmmu",
+				  "pp0",
+				  "pp0mmu";
+		assigned-clocks = <&cru SCLK_GPU>;
+		assigned-clock-rates = <100000000>;
+		clocks = <&cru SCLK_GPU>, <&cru SCLK_GPU>;
+		clock-names = "core", "bus";
+		resets = <&cru SRST_GPU>;
+		status = "disabled";
+	};
+
 	vop: vop at 10118000 {
 		compatible = "rockchip,rk3036-vop";
 		reg = <0x10118000 0x19c>;
Signature · 1 line
2.14.1
author maintainer
#7 lore raw

PATCH v2 5/8 ARM: dts: rockchip: enable the gpu on rk3036-kylin boards

In reply to Heiko Stuebner

Enable the gpu node and add the gpu supply for it.

---
 arch/arm/boot/dts/rk3036-kylin.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/rk3036-kylin.dts +5 -0
index fdb1570bc7d3..e2a0f576946f 100644
@@ -135,6 +135,11 @@
 	status = "okay";
 };
 
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
 &hdmi {
 	status = "okay";
 };
Signature · 1 line
2.14.1
author maintainer
#8 lore raw

PATCH v2 6/8 ARM: dts: rockchip: add rk322x gpu node

In reply to Heiko Stuebner

The rk3228/3229 uses a Mali400 GPU with two pixel processors. This adds the core node for it, which can be enabled in board devicetrees.

---
 arch/arm/boot/dts/rk322x.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/rk322x.dtsi +21 -0
index 06814421eed2..c97287ebb0ea 100644
@@ -558,6 +558,27 @@
 		status = "disabled";
 	};
 
+	gpu: gpu at 20000000 {
+		compatible = "rockchip,rk3228-mali", "arm,mali-400";
+		reg = <0x20000000 0x10000>;
+		interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "gp",
+				  "gpmmu",
+				  "pp0",
+				  "pp0mmu",
+				  "pp1",
+				  "pp1mmu";
+		clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
+		clock-names = "core", "bus";
+		resets = <&cru SRST_GPU_A>;
+		status = "disabled";
+	};
+
 	vpu_mmu: iommu at 20020800 {
 		compatible = "rockchip,iommu";
 		reg = <0x20020800 0x100>;
Signature · 1 line
2.14.1
author maintainer
#9 lore raw

PATCH v2 7/8 ARM: dts: rockchip: add gpu nodes on rk3066/rk3188

In reply to Heiko Stuebner

The old Cortex-A9 socs use Mali400 GPUs with 4 pixel processors. This adds the core gpu nodes with the per-soc interrupts but sharing the core node.

Rockchip SoCs use only one clock to supply the GPUs

---
 arch/arm/boot/dts/rk3066a.dtsi | 24 ++++++++++++++++++++++++
 arch/arm/boot/dts/rk3188.dtsi  | 24 ++++++++++++++++++++++++
 arch/arm/boot/dts/rk3xxx.dtsi  | 11 +++++++++++
 3 files changed, 59 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +24 -0
index f50481fd8e5c..b76119dd5733 100644
@@ -610,6 +610,30 @@
 	};
 };
 
+&gpu {
+	compatible = "rockchip,rk3066-mali", "arm,mali-400";
+	interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+	interrupt-names = "gp",
+			  "gpmmu",
+			  "pp0",
+			  "pp0mmu",
+			  "pp1",
+			  "pp1mmu",
+			  "pp2",
+			  "pp2mmu",
+			  "pp3",
+			  "pp3mmu";
+};
+
 &i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c0_xfer>;
arch/arm/boot/dts/rk3188.dtsi +24 -0
index 1399bc04ea77..9e24d0ffadac 100644
@@ -553,6 +553,30 @@
 	interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
 };
 
+&gpu {
+	compatible = "rockchip,rk3188-mali", "arm,mali-400";
+	interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+	interrupt-names = "gp",
+			  "gpmmu",
+			  "pp0",
+			  "pp0mmu",
+			  "pp1",
+			  "pp1mmu",
+			  "pp2",
+			  "pp2mmu",
+			  "pp3",
+			  "pp3mmu";
+};
+
 &i2c0 {
 	compatible = "rockchip,rk3188-i2c";
 	pinctrl-names = "default";
arch/arm/boot/dts/rk3xxx.dtsi +11 -0
index 4aa6f60d6a22..49584b6a4195 100644
@@ -117,6 +117,17 @@
 		clock-output-names = "xin24m";
 	};
 
+	gpu: gpu at 10090000 {
+		compatible = "arm,mali-400";
+		reg = <0x10090000 0x10000>;
+		clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
+		clock-names = "core", "bus";
+		assigned-clocks = <&cru ACLK_GPU>;
+		assigned-clock-rates = <100000000>;
+		resets = <&cru SRST_GPU>;
+		status = "disabled";
+	};
+
 	L2: l2-cache-controller at 10138000 {
 		compatible = "arm,pl310-cache";
 		reg = <0x10138000 0x1000>;
Signature · 1 line
2.14.1
author maintainer
#10 lore raw

PATCH v2 8/8 ARM: dts: rockchip: enable gpu on rk3188-radxarock

In reply to Heiko Stuebner

Enable the gpu node on that board.

---
 arch/arm/boot/dts/rk3188-radxarock.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/rk3188-radxarock.dts +4 -0
index 53d6fc2fdbce..00e05a6662ac 100644
@@ -176,6 +176,10 @@
 	cpu0-supply = <&vdd_arm>;
 };
 
+&gpu {
+	status = "okay";
+};
+
 &i2c1 {
 	status = "okay";
 	clock-frequency = <400000>;
Signature · 1 line
2.14.1
maintainer
#2 lore raw

PATCH v2 1/8 dt-bindings: gpu: mali-utgard: Add Rockchip Utgard Malis

In reply to Heiko Stuebner
Quoted 9 lines · Heiko Stuebner

Some (older or lower power) Rockchip socs use Utgard-based Mali-GPUs. So add the necessary compatibles for them. As the setup is the same for all of them (needing only the additional reset line), they get added in a somewhat condensed form, to not inflate the document unnecessary.

---
 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
maintainer
#5 lore raw

PATCH v2 3/8 dt-bindings: gpu: mali-utgard: add optional power-domain reference

In reply to Heiko Stuebner
Quoted 8 lines · Heiko Stuebner

On some socs Mali Utgard gpu have both soc power-domains and external supplying regulators, so add an optional power-domains property for reference.

---
 Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt | 4 ++++
 1 file changed, 4 insertions(+)
author maintainer
#11 lore raw

v2 cover ARM: dts: rockchip: add Utgard Mali nodes for some socs

In reply to Heiko Stuebner

Am Freitag, 15. September 2017, 11:18:04 CEST schrieb Heiko Stuebner:

Quoted 11 lines

This adds a mali-supply similar to the Midgard binding, the compatibles for 3 Rockchip socs and the nodes for these.

The rk3036 and rk3188 gpus were tested, on the boards that get their gpus enabled, using the current Lima resurrection project and were able to probe the gpus sucessfully and draw a nice red-triangle in an off-screen application.

The only special thing Rockchip Malis do, is that all MMUs have a shared interrupt and all PPs also have a shared interrupt, but that works out well with the current binding.

applied all 8 for 4.15 with Rob's Acks for the binding changes.