[PATCH v2 7/8] LoongArch: dts: Add clock tree for Loongson 2K0300

From: Yao Zi
Date: Tue Jun 17 2025 - 12:47:12 EST


Describe the clock controller integrated in Loongson 2K0300 SoC and
clocks for UARTs.

Signed-off-by: Yao Zi <ziyao@xxxxxxxxxxx>
---
arch/loongarch/boot/dts/loongson-2k0300.dtsi | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/loongarch/boot/dts/loongson-2k0300.dtsi b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
index ce3574691aa9..44e37d6f8e98 100644
--- a/arch/loongarch/boot/dts/loongson-2k0300.dtsi
+++ b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
@@ -6,6 +6,7 @@

/dts-v1/;

+#include <dt-bindings/clock/loongson,ls2k0300-clk.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
@@ -21,7 +22,7 @@ cpu0: cpu@0 {
compatible = "loongson,la264";
reg = <0>;
device_type = "cpu";
- clocks = <&cpu_clk>;
+ clocks = <&clk LS2K0300_CLK_NODE_GATE>;
};

};
@@ -32,9 +33,10 @@ cpuintc: interrupt-controller {
#interrupt-cells = <1>;
};

- cpu_clk: clock-1000m {
+ refclk: clock-120m {
compatible = "fixed-clock";
- clock-frequency = <1000000000>;
+ clock-frequency = <120000000>;
+ clock-output-names = "refclk_120m";
#clock-cells = <0>;
};

@@ -46,6 +48,14 @@ soc@10000000 {
<0x00 0x02000000 0x00 0x02000000 0x0 0x04000000>,
<0x00 0x40000000 0x00 0x40000000 0x0 0x40000000>;

+ clk: clock-controller@16000400 {
+ compatible = "loongson,ls2k0300-clk";
+ reg = <0x0 0x16000400 0x0 0x100>;
+ clocks = <&refclk>;
+ clock-names = "ref_120m";
+ #clock-cells = <1>;
+ };
+
liointc0: interrupt-controller@16001400 {
compatible = "loongson,liointc-2.0";
reg = <0x0 0x16001400 0x0 0x40>,
@@ -87,6 +97,7 @@ liointc1: interrupt-controller@16001440 {
uart0: serial@16100000 {
compatible = "ns16550a";
reg = <0 0x16100000 0 0x10>;
+ clocks = <&clk LS2K0300_CLK_APB_GATE>;
interrupt-parent = <&liointc0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
--
2.49.0