Skip to content

Commit a6fafa6

Browse files
Haylen Chudlan17
authored andcommitted
riscv: dts: spacemit: Add clock tree for SpacemiT K1
Describe the PLL and system controllers that're capable of generating clock signals in the devicetree. Signed-off-by: Haylen Chu <[email protected]> Reviewed-by: Alex Elder <[email protected]> Reviewed-by: Yixun Lan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yixun Lan <[email protected]>
1 parent e668858 commit a6fafa6

File tree

1 file changed

+75
-0
lines changed
  • arch/riscv/boot/dts/spacemit

1 file changed

+75
-0
lines changed

arch/riscv/boot/dts/spacemit/k1.dtsi

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright (C) 2024 Yangyu Chen <[email protected]>
44
*/
55

6+
#include <dt-bindings/clock/spacemit,k1-syscon.h>
7+
68
/dts-v1/;
79
/ {
810
#address-cells = <2>;
@@ -306,6 +308,36 @@
306308
};
307309
};
308310

311+
clocks {
312+
vctcxo_1m: clock-1m {
313+
compatible = "fixed-clock";
314+
clock-frequency = <1000000>;
315+
clock-output-names = "vctcxo_1m";
316+
#clock-cells = <0>;
317+
};
318+
319+
vctcxo_24m: clock-24m {
320+
compatible = "fixed-clock";
321+
clock-frequency = <24000000>;
322+
clock-output-names = "vctcxo_24m";
323+
#clock-cells = <0>;
324+
};
325+
326+
vctcxo_3m: clock-3m {
327+
compatible = "fixed-clock";
328+
clock-frequency = <3000000>;
329+
clock-output-names = "vctcxo_3m";
330+
#clock-cells = <0>;
331+
};
332+
333+
osc_32k: clock-32k {
334+
compatible = "fixed-clock";
335+
clock-frequency = <32000>;
336+
clock-output-names = "osc_32k";
337+
#clock-cells = <0>;
338+
};
339+
};
340+
309341
soc {
310342
compatible = "simple-bus";
311343
interrupt-parent = <&plic>;
@@ -314,6 +346,17 @@
314346
dma-noncoherent;
315347
ranges;
316348

349+
syscon_apbc: system-controller@d4015000 {
350+
compatible = "spacemit,k1-syscon-apbc";
351+
reg = <0x0 0xd4015000 0x0 0x1000>;
352+
clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>,
353+
<&vctcxo_24m>;
354+
clock-names = "osc", "vctcxo_1m", "vctcxo_3m",
355+
"vctcxo_24m";
356+
#clock-cells = <1>;
357+
#reset-cells = <1>;
358+
};
359+
317360
uart0: serial@d4017000 {
318361
compatible = "spacemit,k1-uart", "intel,xscale-uart";
319362
reg = <0x0 0xd4017000 0x0 0x100>;
@@ -409,6 +452,38 @@
409452
reg = <0x0 0xd401e000 0x0 0x400>;
410453
};
411454

455+
syscon_mpmu: system-controller@d4050000 {
456+
compatible = "spacemit,k1-syscon-mpmu";
457+
reg = <0x0 0xd4050000 0x0 0x209c>;
458+
clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>,
459+
<&vctcxo_24m>;
460+
clock-names = "osc", "vctcxo_1m", "vctcxo_3m",
461+
"vctcxo_24m";
462+
#clock-cells = <1>;
463+
#power-domain-cells = <1>;
464+
#reset-cells = <1>;
465+
};
466+
467+
pll: clock-controller@d4090000 {
468+
compatible = "spacemit,k1-pll";
469+
reg = <0x0 0xd4090000 0x0 0x1000>;
470+
clocks = <&vctcxo_24m>;
471+
spacemit,mpmu = <&syscon_mpmu>;
472+
#clock-cells = <1>;
473+
};
474+
475+
syscon_apmu: system-controller@d4282800 {
476+
compatible = "spacemit,k1-syscon-apmu";
477+
reg = <0x0 0xd4282800 0x0 0x400>;
478+
clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>,
479+
<&vctcxo_24m>;
480+
clock-names = "osc", "vctcxo_1m", "vctcxo_3m",
481+
"vctcxo_24m";
482+
#clock-cells = <1>;
483+
#power-domain-cells = <1>;
484+
#reset-cells = <1>;
485+
};
486+
412487
plic: interrupt-controller@e0000000 {
413488
compatible = "spacemit,k1-plic", "sifive,plic-1.0.0";
414489
reg = <0x0 0xe0000000 0x0 0x4000000>;

0 commit comments

Comments
 (0)