Devicetree
 help / color / mirror / Atom feed
* [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
@ 2026-11-18 18:59 Iker Pedrosa
  2026-11-18 19:09 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Iker Pedrosa @ 2026-11-18 18:59 UTC (permalink / raw)
  To: Alessio Belle, Luigi Santivetti, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell
  Cc: imagination, dri-devel, devicetree, linux-kernel, linux-riscv,
	spacemit, Iker Pedrosa

Add PowerVR Rogue GPU device node for SpacemiT K1 SoC.

The GPU is integrated within the SoC and enabled by default.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
Add PowerVR Rogue GPU (BXE-2-32) device tree node for SpacemiT K1 SoC.

This series depends on:
- Yixun Lan's power domain series [1], which provides the genpd-based
  GPU power domain driver required for proper power sequencing.
- Baihui Liang's dt-bindings patch [2], which adds the spacemit,k1-gpu
  compatible string to the img,powervr-rogue binding.

The GPU firmware is not yet available upstream. A copy can be found
at [3].

With this series applied on top of [1] and [2], the full GPU bring-up
path works end-to-end on hardware:
- Power domain: GPU power island on/off via APMU
- Clock: GPU clock enabled/gated through CCU
- Reset: GPU reset line deasserted
- Firmware: PowerVR RISC-V firmware loads and signals ready
- DMA: dma-ranges correctly maps CPU-to-GPU physical addresses
- DRM: kernel exposes /dev/dri/card0 and /dev/dri/renderD128
- IRQ: GPU interrupt registered, firmware watchdog running

Userspace rendering requires Mesa's PowerVR Vulkan driver
(imagination-experimental).

[1] https://lore.kernel.org/linux-riscv/20261008-04-k3-pm-support-v2-0-6f778a53dd2d@kernel.org/
[2] https://lore.kernel.org/linux-riscv/20261015-spacemit-gpu-binding-v1-1-a7a23c7e7788@linux.spacemit.com/
[3] https://gitlab.freedesktop.org/imagination/linux-firmware/-/blob/powervr/powervr/rogue_36.29.52.182_v1.fw
---
Changes in v2:
- Removed board-specific enablement (GPU now enabled by default in SoC)
- Simplified commit message as per maintainer feedback
- Dropped redundant status = "disabled" from GPU node
- Link to v1: https://lore.kernel.org/r/20261015-orangepi-gpu-v1-0-03566a615660@gmail.com
---
 arch/riscv/boot/dts/spacemit/k1.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index 3fabfd34114b..7f2573d869ca 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/clock/spacemit,k1-syscon.h>
 #include <dt-bindings/phy/phy.h>
+#include <dt-bindings/power/spacemit,k1-power.h>
 
 #include "k1-pdma.h"
 
@@ -1119,6 +1120,16 @@ multimedia-bus {
 			#size-cells = <2>;
 			dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
 				     <0x0 0x80000000 0x1 0x00000000 0x3 0x80000000>;
+
+			gpu: gpu@cac00000 {
+				compatible = "spacemit,k1-gpu", "img,img-bxe-2-32", "img,img-rogue";
+				reg = <0x0 0xcac00000 0x0 0x80000>;
+				interrupts = <75>;
+				clocks = <&syscon_apmu CLK_GPU>;
+				clock-names = "core";
+				resets = <&syscon_apmu RESET_GPU>;
+				power-domains = <&syscon_apmu K1_PMDOMAIN_GPU>;
+			};
 		};
 
 		network-bus {

---
base-commit: be95fa81c04dd67616faaa2872babb9ac39d4251
change-id: 20260413-orangepi-gpu-02d839d6506f

Best regards,
-- 
Iker Pedrosa <ikerpedrosam@gmail.com>


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

* Re: [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
  2026-11-18 18:59 [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node Iker Pedrosa
@ 2026-11-18 19:09 ` sashiko-bot
  2026-11-23 18:19   ` Iker Pedrosa
  2026-11-22 18:44 ` Frédéric Mahé
  2026-11-26 12:53 ` Yixun Lan
  2 siblings, 1 reply; 6+ messages in thread
From: sashiko-bot @ 2026-11-18 19:09 UTC (permalink / raw)
  To: Iker Pedrosa; +Cc: dri-devel, devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] riscv: dts: spacemit: build failure from missing
  spacemit,k1-power.h header
--

commit efc5334efe329206674ea5227e542cbbf6e41d33
Author: Iker Pedrosa <ikerpedrosam@gmail.com>

riscv: dts: spacemit: k1: add PowerVR GPU device node

This commit adds the PowerVR Rogue GPU device tree node for the SpacemiT
K1 SoC and enables it by default.

> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index 5d5f7f8a393d3..15bee2137e14e 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/clock/spacemit,k1-syscon.h>
>  #include <dt-bindings/phy/phy.h>
> +#include <dt-bindings/power/spacemit,k1-power.h>
>  
>  #include "k1-pdma.h"
>  
> @@ -1119,6 +1120,16 @@ multimedia-bus {
>  			#size-cells = <2>;
>  			dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
>  				     <0x0 0x80000000 0x1 0x00000000 0x3 0x80000000>;
> +
> +			gpu: gpu@cac00000 {
> +				compatible = "spacemit,k1-gpu", "img,img-bxe-2-32", "img,img-rogue";
> +				reg = <0x0 0xcac00000 0x0 0x80000>;
> +				interrupts = <75>;
> +				clocks = <&syscon_apmu CLK_GPU>;
> +				clock-names = "core";
> +				resets = <&syscon_apmu RESET_GPU>;
> +				power-domains = <&syscon_apmu K1_PMDOMAIN_GPU>;
> +			};
>  		};
>  
>  		network-bus {

[Severity: High]
Does this break the DTB build when CONFIG_ARCH_SPACEMIT is enabled?
Neither include/dt-bindings/power/spacemit,k1-power.h nor K1_PMDOMAIN_GPU
is present in the tree yet, so preprocessing any SpacemiT K1 board DTS
that includes k1.dtsi fails until the prerequisite power-domain series is
applied.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-orangepi-gpu-v2-1-f68676f844eb@gmail.com?part=1

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

* Re: [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
  2026-11-18 18:59 [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node Iker Pedrosa
  2026-11-18 19:09 ` sashiko-bot
@ 2026-11-22 18:44 ` Frédéric Mahé
  2026-11-23 18:41   ` Iker Pedrosa
  2026-11-26 12:53 ` Yixun Lan
  2 siblings, 1 reply; 6+ messages in thread
From: Frédéric Mahé @ 2026-11-22 18:44 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: Frédéric Mahé, Alessio Belle, Luigi Santivetti,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Yixun Lan, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Troy Mitchell, Baihui Liang, imagination,
	dri-devel, devicetree, linux-kernel, linux-riscv, spacemit

Hi Iker,

Tested on a Banana Pi BPI-F3, on v7.4-rc1 plus Yixun's CCU pm-aux
patches and pmdomain v5 (and the riscv reboot fix), with the firmware
from your link:

- the gpu power domain turns on, firmware v1.1 (build 6976702) loads,
  and card0/renderD128 appear. The GPU interrupt (75) fires;
- a reboot afterwards is clean.

Two notes:

- On v7.4-rc1 the driver refuses the GPU ("Unknown GPU! Set
  'exp_hw_support' to bypass this check"); with
  powervr.exp_hw_support=1 it works as above. Is a driver patch
  adding the K1 GPU pending somewhere?
- The GPU never runtime-suspends: after 160 s idle,
  runtime_suspended_time is still 0 and the power domain stays on
  (autosuspend 50 ms). That looks like what Baihui's "drm/imagination:
  re-check firmware idle state before runtime suspend" fixes.

I could not test rendering: Debian 13's Mesa (25.0.7, riscv64) has no
PowerVR Vulkan driver.

Tested-by: Frédéric Mahé <frederic.mahe@cirad.fr> # BPI-F3

Frédéric

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

* Re: [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
  2026-11-18 19:09 ` sashiko-bot
@ 2026-11-23 18:19   ` Iker Pedrosa
  0 siblings, 0 replies; 6+ messages in thread
From: Iker Pedrosa @ 2026-11-23 18:19 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: dri-devel, devicetree, robh, conor+dt

Hi,

> [Severity: High]
> Does this break the DTB build when CONFIG_ARCH_SPACEMIT is enabled?
> Neither include/dt-bindings/power/spacemit,k1-power.h nor K1_PMDOMAIN_GPU
> is present in the tree yet, so preprocessing any SpacemiT K1 board DTS
> that includes k1.dtsi fails until the prerequisite power-domain series is
> applied.

This is expected when testing the patch in isolation: both
include/dt-bindings/power/spacemit,k1-power.h and K1_PMDOMAIN_GPU are
introduced by Yixun Lan's prerequisite K1 power-domain series [1] (noted
in the patch cover notes).

This DTS patch is meant to be applied after that series lands.

[1] https://lore.kernel.org/linux-riscv/20261008-04-k3-pm-support-v2-0-6f778a53dd2d@kernel.org/

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

* Re: [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
  2026-11-22 18:44 ` Frédéric Mahé
@ 2026-11-23 18:41   ` Iker Pedrosa
  0 siblings, 0 replies; 6+ messages in thread
From: Iker Pedrosa @ 2026-11-23 18:41 UTC (permalink / raw)
  To: Frédéric Mahé
  Cc: Alessio Belle, Luigi Santivetti, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	Baihui Liang, imagination, dri-devel, devicetree, linux-kernel,
	linux-riscv, spacemit

Hi Frédéric,

Thanks for testing this on the BPI-F3!

> Two notes:
>
> - On v7.4-rc1 the driver refuses the GPU ("Unknown GPU! Set
>   'exp_hw_support' to bypass this check"); with
>   powervr.exp_hw_support=1 it works as above. Is a driver patch
>   adding the K1 GPU pending somewhere?

You're right. I forgot to mention in the cover letter that I was loading
the module with:
sudo modprobe powervr exp_hw_support=1

I plan to send a separate patch to add K1 GPU support directly in
Imagination's driver.

> - The GPU never runtime-suspends: after 160 s idle,
>   runtime_suspended_time is still 0 and the power domain stays on
>   (autosuspend 50 ms). That looks like what Baihui's "drm/imagination:
>   re-check firmware idle state before runtime suspend" fixes.

I hadn't tested runtime suspend for the driver before, but after you
mentioned it I gave it a try and can confirm it doesn't work properly.
Hopefully Baihui's patch [1] will fix this issue.

[1] https://lore.kernel.org/linux-riscv/20261111-img-pm-autosuspend-v2-1-427689f6f2f9@linux.spacemit.com/

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

* Re: [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node
  2026-11-18 18:59 [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node Iker Pedrosa
  2026-11-18 19:09 ` sashiko-bot
  2026-11-22 18:44 ` Frédéric Mahé
@ 2026-11-26 12:53 ` Yixun Lan
  2 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2026-11-26 12:53 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: Alessio Belle, Luigi Santivetti, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Troy Mitchell, imagination, dri-devel,
	devicetree, linux-kernel, linux-riscv, spacemit

Hi Iker,

On 19:59 Wed 18 Nov     , Iker Pedrosa wrote:
> Add PowerVR Rogue GPU device node for SpacemiT K1 SoC.
> 
> The GPU is integrated within the SoC and enabled by default.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

Reviewed-by: Yixun Lan <dlan@kernel.org>

-- 
Yixun Lan (dlan)

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

end of thread, other threads:[~2026-11-26 12:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 18:59 [PATCH v2] riscv: dts: spacemit: k1: add PowerVR GPU device node Iker Pedrosa
2026-11-18 19:09 ` sashiko-bot
2026-11-23 18:19   ` Iker Pedrosa
2026-11-22 18:44 ` Frédéric Mahé
2026-11-23 18:41   ` Iker Pedrosa
2026-11-26 12:53 ` Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox