The T-Head TH1520 SoC contains a GC620 2D graphics accelerator.

Enable it in the devicetree to allow using etnaviv driver with it.

This patch is currently very dirty because it relies on the bootloader
leaving the clocks enabled, and the core clock is a fake one.

Signed-off-by: Icenowy Zheng <u...@icenowy.me>
---
No changes in v2.

 arch/riscv/boot/dts/thead/th1520.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi 
b/arch/riscv/boot/dts/thead/th1520.dtsi
index 03f1d73190499..bc7dd7ee59dd5 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>;
        };
 
+       gc620_cclk: clk-gc620-fake {
+               compatible = "fixed-clock";
+               clock-frequency = <264000000>;
+               clock-output-names = "gc620_cclk";
+               #clock-cells = <0>;
+       };
+
        stmmac_axi_config: stmmac-axi-config {
                snps,wr_osr_lmt = <15>;
                snps,rd_osr_lmt = <15>;
@@ -495,6 +502,18 @@ uart2: serial@ffec010000 {
                        status = "disabled";
                };
 
+               /* Vivante GC620, 2D only */
+               g2d: gpu@ffecc80000 {
+                       compatible = "vivante,gc";
+                       reg = <0xff 0xecc80000 0x0 0x40000>;
+                       interrupt-parent = <&plic>;
+                       interrupts = <101 IRQ_TYPE_LEVEL_HIGH>;
+
+                       clocks = <&gc620_cclk>;
+                       clock-names = "core";
+                       status = "okay";
+               };
+
                clk: clock-controller@ffef010000 {
                        compatible = "thead,th1520-clk-ap";
                        reg = <0xff 0xef010000 0x0 0x1000>;
-- 
2.51.0

Reply via email to