arm64: sunxi: a523: Enable Mali GPU
Subsystems (2)
cover arm64: sunxi: a523: Enable Mali GPU
From: Mikhail Kalashnikov <[email protected]>
This patch adds gpu support on devices with a523 processor. Since there is no support for image output yet, the gpu is disabled after boot up.
$ dmesg | grep panfrost
[ 3.826968] panfrost 1800000.gpu: clock rate = 432000000
[ 3.832305] panfrost 1800000.gpu: bus_clock rate = 200000000
[ 3.838353] panfrost 1800000.gpu: mali-g57 id 0x9091 major 0x0 minor 0x1
status 0x0
[ 3.846050] panfrost 1800000.gpu: features: 00000000,000019f7, issues:
00000001,80000400
[ 3.854134] panfrost 1800000.gpu: Features: L2:0x07110206 Shader:0x00000000
Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[ 3.866011] panfrost 1800000.gpu: shader_present=0x1 l2_present=0x1
[ 3.874108] [drm] Initialized panfrost 1.3.0 for 1800000.gpu on minor 0Tested on x96qproplus and walnutpi 2b devices.
Based on v6.16-rc4 with patches:
https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]/
iuncuim (2):
arm64: dts: allwinner: a523: add Mali GPU node
arm64: dts: allwinner: a523: enable Mali GPU for all boards
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++ .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 5 +++++ .../boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 5 +++++ .../boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 5 +++++ .../dts/allwinner/sun55i-t527-orangepi-4a.dts | 5 +++++ 5 files changed, 35 insertions(+)
Signature · 1 line
2.50.0
PATCH 1/2 arm64: dts: allwinner: a523: add Mali GPU node
From: Mikhail Kalashnikov <[email protected]>
The Allwinner A523 SoC features the Mali-G57 MC1 GPU, which belongs to the Mali Valhall (v9) family. There is a power domain specifically for this GPU that needs to be enabled to utilize it.
To enable in a specific device, we need to enable the gpu node and specify the “mali-supply” regulator additionally in the device tree.
--- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +15 -0
@@ -108,6 +108,21 @@ soc { #size-cells = <1>; ranges = <0x0 0x0 0x0 0x40000000>; + gpu: gpu@1800000 { + compatible = "allwinner,sun55i-a523-mali", + "arm,mali-valhall-jm"; + reg = <0x1800000 0x10000>; + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "job", "mmu", "gpu"; + clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>; + clock-names = "core", "bus"; + power-domains = <&pck600 PD_GPU>; + resets = <&ccu RST_BUS_GPU>; + status = "disabled"; + }; + pio: pinctrl@2000000 { compatible = "allwinner,sun55i-a523-pinctrl"; reg = <0x2000000 0x800>;
Signature · 1 line
2.50.0
PATCH 2/2 arm64: dts: allwinner: a523: enable Mali GPU for all boards
In reply to iuncuimFrom: Mikhail Kalashnikov <[email protected]>
All devices based on the A523/A527/H728/T527 processors contain a G57 MC1 GPU.
Enable the DT nodes for this GPU and specify a regulator that supplies power to the SoC's VDD_GPU pins. The other parameters are set in the SoC dtsi, so are board independent.
--- arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 5 +++++ arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 5 +++++ arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 5 +++++ arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts | 5 +++++ 4 files changed, 20 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +5 -0
@@ -66,6 +66,11 @@ &gmac0 { status = "okay"; }; +&gpu { + mali-supply = <®_dcdc2>; + status = "okay"; +}; + &mdio0 { ext_rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22";
arch/arm64/boot/dts/allwinner/sun55i-h728-x96qpro+.dts +5 -0
@@ -54,6 +54,11 @@ &ehci1 { status = "okay"; }; +&gpu { + mali-supply = <®_dcdc2>; + status = "okay"; +}; + &mmc0 { vmmc-supply = <®_vcc3v3>; cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts +5 -0
@@ -76,6 +76,11 @@ &gmac0 { status = "okay"; }; +&gpu { + mali-supply = <®_dcdc2>; + status = "okay"; +}; + &mdio0 { ext_rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22";
arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts +5 -0
@@ -95,6 +95,11 @@ &ehci1 { status = "okay"; }; +&gpu { + mali-supply = <®_dcdc2>; + status = "okay"; +}; + &mmc0 { vmmc-supply = <®_cldo3>; cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
Signature · 1 line
2.50.0
Quoted 5 lines · On Sun, 6 Jul 2025 10:56:21 +0800 iuncuim <[email protected]> wrote:
From: Mikhail Kalashnikov <[email protected]>
This patch adds gpu support on devices with a523 processor. Since there is no support for image output yet, the gpu is disabled after boot up.
Quoted 11 lines
$ dmesg | grep panfrost
[ 3.826968] panfrost 1800000.gpu: clock rate = 432000000
[ 3.832305] panfrost 1800000.gpu: bus_clock rate = 200000000
[ 3.838353] panfrost 1800000.gpu: mali-g57 id 0x9091 major 0x0 minor 0x1
status 0x0
[ 3.846050] panfrost 1800000.gpu: features: 00000000,000019f7, issues:
00000001,80000400
[ 3.854134] panfrost 1800000.gpu: Features: L2:0x07110206 Shader:0x00000000
Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[ 3.866011] panfrost 1800000.gpu: shader_present=0x1 l2_present=0x1
[ 3.874108] [drm] Initialized panfrost 1.3.0 for 1800000.gpu on minor 0So what confidence do we have that this really works, apart from these successful initialisation messages? Has this been shown to work with some (yet-out-of-tree) DRM patches, to produce 3D rendered output? I wonder if we should wait with upstreaming until we can really test this on some kind of screen.
Cheers,
Andre
Quoted 20 lines
Tested on x96qproplus and walnutpi 2b devices.
Based on v6.16-rc4 with patches:
https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]/iuncuim (2):
arm64: dts: allwinner: a523: add Mali GPU node
arm64: dts: allwinner: a523: enable Mali GPU for all boardsarch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++ .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 5 +++++ .../boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 5 +++++ .../boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 5 +++++ .../dts/allwinner/sun55i-t527-orangepi-4a.dts | 5 +++++ 5 files changed, 35 insertions(+)
Chen-Yu Tsai
Tested-byQuoted 21 lines · Andre Przywara
Quoted 5 lines · On Sun, 6 Jul 2025 10:56:21 +0800 iuncuim <[email protected]> wrote:
From: Mikhail Kalashnikov <[email protected]>
This patch adds gpu support on devices with a523 processor. Since there is no support for image output yet, the gpu is disabled after boot up.
Quoted 11 lines
$ dmesg | grep panfrost [ 3.826968] panfrost 1800000.gpu: clock rate = 432000000 [ 3.832305] panfrost 1800000.gpu: bus_clock rate = 200000000 [ 3.838353] panfrost 1800000.gpu: mali-g57 id 0x9091 major 0x0 minor 0x1 status 0x0 [ 3.846050] panfrost 1800000.gpu: features: 00000000,000019f7, issues: 00000001,80000400 [ 3.854134] panfrost 1800000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7 [ 3.866011] panfrost 1800000.gpu: shader_present=0x1 l2_present=0x1 [ 3.874108] [drm] Initialized panfrost 1.3.0 for 1800000.gpu on minor 0
Quoted 5 lines
So what confidence do we have that this really works, apart from these successful initialisation messages? Has this been shown to work with some (yet-out-of-tree) DRM patches, to produce 3D rendered output? I wonder if we should wait with upstreaming until we can really test this on some kind of screen.
I ran glmark2-es2-drm using vkms, and it seemed to run correctly. The GPU job interrupt was triggering frequently, and the GPU mmu interrupt was triggered twice for each run. This was with Mesa 25.0.2 from Debian bookworm backports.
So this is sort of
If anyone has some idea about how to capture the output, I can give that a try.
Quoted 24 lines
Cheers,
AndreQuoted 20 lines
Tested on x96qproplus and walnutpi 2b devices.
Based on v6.16-rc4 with patches:
https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]
https://lore.kernel.org/linux-sunxi/[email protected]/iuncuim (2):
arm64: dts: allwinner: a523: add Mali GPU node
arm64: dts: allwinner: a523: enable Mali GPU for all boardsarch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++ .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 5 +++++ .../boot/dts/allwinner/sun55i-h728-x96qpro+.dts | 5 +++++ .../boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 5 +++++ .../dts/allwinner/sun55i-t527-orangepi-4a.dts | 5 +++++ 5 files changed, 35 insertions(+)