[PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node

Michal Wilczynski posted 4 patches 1 month, 1 week ago
[PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Michal Wilczynski 1 month, 1 week ago
Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
the GPU using the drm/imagination driver.

By adding this node, the kernel can recognize and initialize the GPU,
providing graphics acceleration capabilities on the Lichee Pi 4A and
other boards based on the TH1520 SoC.

Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
controlled programatically.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Drew Fustini <drew@pdp7.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
 arch/riscv/boot/dts/thead/th1520.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index 42724bf7e90e08fac326c464d0f080e3bd2cd59b..6ae5c632205ba63248c0a119c03bdfc084aac7a0 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -225,6 +225,13 @@ aonsys_clk: clock-73728000 {
 		#clock-cells = <0>;
 	};
 
+	gpu_mem_clk: mem-clk {
+		compatible = "fixed-clock";
+		clock-frequency = <0>;
+		clock-output-names = "gpu_mem_clk";
+		#clock-cells = <0>;
+	};
+
 	stmmac_axi_config: stmmac-axi-config {
 		snps,wr_osr_lmt = <15>;
 		snps,rd_osr_lmt = <15>;
@@ -500,6 +507,20 @@ clk: clock-controller@ffef010000 {
 			#clock-cells = <1>;
 		};
 
+		gpu: gpu@ffef400000 {
+			compatible = "thead,th1520-gpu", "img,img-bxm-4-64",
+				     "img,img-rogue";
+			reg = <0xff 0xef400000 0x0 0x100000>;
+			interrupt-parent = <&plic>;
+			interrupts = <102 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk_vo CLK_GPU_CORE>,
+				 <&gpu_mem_clk>,
+				 <&clk_vo CLK_GPU_CFG_ACLK>;
+			clock-names = "core", "mem", "sys";
+			power-domains = <&aon TH1520_GPU_PD>;
+			resets = <&rst TH1520_RESET_ID_GPU>;
+		};
+
 		rst: reset-controller@ffef528000 {
 			compatible = "thead,th1520-reset";
 			reg = <0xff 0xef528000 0x0 0x4f>;

-- 
2.34.1
Re: [PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Drew Fustini 1 month, 1 week ago
On Fri, Aug 22, 2025 at 12:20:17AM +0200, Michal Wilczynski wrote:
> Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
> TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
> the GPU using the drm/imagination driver.
> 
> By adding this node, the kernel can recognize and initialize the GPU,
> providing graphics acceleration capabilities on the Lichee Pi 4A and
> other boards based on the TH1520 SoC.
> 
> Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
> controlled programatically.
> 
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Drew Fustini <drew@pdp7.com>
> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> Acked-by: Matt Coster <matt.coster@imgtec.com>
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
>  arch/riscv/boot/dts/thead/th1520.dtsi | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)

I've applied this to thead-dt-for-next [1]:

0f78e44fb857 ("riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node")

Thanks,
Drew

[1] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/log/?h=thead-dt-for-next
Re: [PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Drew Fustini 1 month, 1 week ago
On Fri, Aug 22, 2025 at 01:43:53PM -0700, Drew Fustini wrote:
> On Fri, Aug 22, 2025 at 12:20:17AM +0200, Michal Wilczynski wrote:
> > Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
> > TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
> > the GPU using the drm/imagination driver.
> > 
> > By adding this node, the kernel can recognize and initialize the GPU,
> > providing graphics acceleration capabilities on the Lichee Pi 4A and
> > other boards based on the TH1520 SoC.
> > 
> > Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
> > controlled programatically.
> > 
> > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> > Reviewed-by: Drew Fustini <drew@pdp7.com>
> > Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > Acked-by: Matt Coster <matt.coster@imgtec.com>
> > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> > ---
> >  arch/riscv/boot/dts/thead/th1520.dtsi | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> 
> I've applied this to thead-dt-for-next [1]:
> 
> 0f78e44fb857 ("riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node")
> 
> Thanks,
> Drew
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/log/?h=thead-dt-for-next

Hi Matt,

Do you know when the dt binding patch will be applied to
the drm-misc/for-linux-next tree?

I applied the dts patch but it is creating a warning in next right now.
If the binding won't show up soon in drm-misc, then I'll remove this dts
patch from next as dtbs_check is now failing in next. I can add it back
once the binding makes it to next.

Thanks,
Drew
Re: [PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Drew Fustini 1 month ago
On Wed, Aug 27, 2025 at 03:08:01PM -0700, Drew Fustini wrote:
> On Fri, Aug 22, 2025 at 01:43:53PM -0700, Drew Fustini wrote:
> > On Fri, Aug 22, 2025 at 12:20:17AM +0200, Michal Wilczynski wrote:
> > > Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
> > > TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
> > > the GPU using the drm/imagination driver.
> > > 
> > > By adding this node, the kernel can recognize and initialize the GPU,
> > > providing graphics acceleration capabilities on the Lichee Pi 4A and
> > > other boards based on the TH1520 SoC.
> > > 
> > > Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
> > > controlled programatically.
> > > 
> > > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> > > Reviewed-by: Drew Fustini <drew@pdp7.com>
> > > Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > Acked-by: Matt Coster <matt.coster@imgtec.com>
> > > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> > > ---
> > >  arch/riscv/boot/dts/thead/th1520.dtsi | 21 +++++++++++++++++++++
> > >  1 file changed, 21 insertions(+)
> > 
> > I've applied this to thead-dt-for-next [1]:
> > 
> > 0f78e44fb857 ("riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node")
> > 
> > Thanks,
> > Drew
> > 
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/log/?h=thead-dt-for-next
> 
> Hi Matt,
> 
> Do you know when the dt binding patch will be applied to
> the drm-misc/for-linux-next tree?
> 
> I applied the dts patch but it is creating a warning in next right now.
> If the binding won't show up soon in drm-misc, then I'll remove this dts
> patch from next as dtbs_check is now failing in next. I can add it back
> once the binding makes it to next.

I've now removed this patch from thead-dt-for-next and will add it back
once the bindings show up in next.

Thanks,
Drew
Re: [PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Matt Coster 1 month ago
On 28/08/2025 22:56, Drew Fustini wrote:
> On Wed, Aug 27, 2025 at 03:08:01PM -0700, Drew Fustini wrote:
>> On Fri, Aug 22, 2025 at 01:43:53PM -0700, Drew Fustini wrote:
>>> On Fri, Aug 22, 2025 at 12:20:17AM +0200, Michal Wilczynski wrote:
>>>> Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
>>>> TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
>>>> the GPU using the drm/imagination driver.
>>>>
>>>> By adding this node, the kernel can recognize and initialize the GPU,
>>>> providing graphics acceleration capabilities on the Lichee Pi 4A and
>>>> other boards based on the TH1520 SoC.
>>>>
>>>> Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
>>>> controlled programatically.
>>>>
>>>> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
>>>> Reviewed-by: Drew Fustini <drew@pdp7.com>
>>>> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>> Acked-by: Matt Coster <matt.coster@imgtec.com>
>>>> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
>>>> ---
>>>>  arch/riscv/boot/dts/thead/th1520.dtsi | 21 +++++++++++++++++++++
>>>>  1 file changed, 21 insertions(+)
>>>
>>> I've applied this to thead-dt-for-next [1]:
>>>
>>> 0f78e44fb857 ("riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node")
>>>
>>> Thanks,
>>> Drew
>>>
>>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git/log/?h=thead-dt-for-next
>>
>> Hi Matt,
>>
>> Do you know when the dt binding patch will be applied to
>> the drm-misc/for-linux-next tree?
>>
>> I applied the dts patch but it is creating a warning in next right now.
>> If the binding won't show up soon in drm-misc, then I'll remove this dts
>> patch from next as dtbs_check is now failing in next. I can add it back
>> once the binding makes it to next.
> 
> I've now removed this patch from thead-dt-for-next and will add it back
> once the bindings show up in next.

Hi Drew,

Apologies for the delay, I was on holiday last week.

I've just applied the non-dts patches to drm-misc-next [1], would you
mind re-adding the dts patch to thead-dt-for-next?

Cheers,
Matt

[1]: https://lore.kernel.org/r/175672521205.30950.2944854121832397083.b4-ty@imgtec.com

> 
> Thanks,
> Drew


-- 
Matt Coster
E: matt.coster@imgtec.com
Re: [PATCH v13 3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
Posted by Drew Fustini 1 month ago
On Mon, Sep 01, 2025 at 11:16:18AM +0000, Matt Coster wrote:
> Hi Drew,
> 
> Apologies for the delay, I was on holiday last week.
> 
> I've just applied the non-dts patches to drm-misc-next [1], would you
> mind re-adding the dts patch to thead-dt-for-next?

Thanks for the update.

I've now pushed the dts patch back to thead-dt-for-next:

[3/4] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node
      commit: 5052d5cf1359e9057ec311788c12997406fdb2fc

-Drew