Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 95ab7b2

Browse files
committed
Merge tag 'riscv-sophgo-dt-for-v6.11' of https://github.com/sophgo/linux into soc/dt
RISC-V Devicetrees for v6.11 Sopgho: Add clock support for SG2042. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> * tag 'riscv-sophgo-dt-for-v6.11' of https://github.com/sophgo/linux: riscv: dts: add clock generator for Sophgo SG2042 SoC Link: https://lore.kernel.org/r/PN1P287MB281861EA2B1706B430D2FA3EFEDB2@PN1P287MB2818.INDP287.PROD.OUTLOOK.COM Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents ad82829 + b1240a3 commit 95ab7b2

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
};
1515
};
1616

17+
&cgi_main {
18+
clock-frequency = <25000000>;
19+
};
20+
21+
&cgi_dpll0 {
22+
clock-frequency = <25000000>;
23+
};
24+
25+
&cgi_dpll1 {
26+
clock-frequency = <25000000>;
27+
};
28+
1729
&uart0 {
1830
status = "okay";
1931
};

arch/riscv/boot/dts/sophgo/sg2042.dtsi

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
*/
55

66
/dts-v1/;
7+
#include <dt-bindings/clock/sophgo,sg2042-clkgen.h>
8+
#include <dt-bindings/clock/sophgo,sg2042-pll.h>
9+
#include <dt-bindings/clock/sophgo,sg2042-rpgate.h>
710
#include <dt-bindings/interrupt-controller/irq.h>
8-
911
#include <dt-bindings/reset/sophgo,sg2042-reset.h>
1012

1113
#include "sg2042-cpus.dtsi"
@@ -20,12 +22,60 @@
2022
serial0 = &uart0;
2123
};
2224

25+
cgi_main: oscillator0 {
26+
compatible = "fixed-clock";
27+
clock-output-names = "cgi_main";
28+
#clock-cells = <0>;
29+
};
30+
31+
cgi_dpll0: oscillator1 {
32+
compatible = "fixed-clock";
33+
clock-output-names = "cgi_dpll0";
34+
#clock-cells = <0>;
35+
};
36+
37+
cgi_dpll1: oscillator2 {
38+
compatible = "fixed-clock";
39+
clock-output-names = "cgi_dpll1";
40+
#clock-cells = <0>;
41+
};
42+
2343
soc: soc {
2444
compatible = "simple-bus";
2545
#address-cells = <2>;
2646
#size-cells = <2>;
2747
ranges;
2848

49+
pllclk: clock-controller@70300100c0 {
50+
compatible = "sophgo,sg2042-pll";
51+
reg = <0x70 0x300100c0 0x0 0x40>;
52+
clocks = <&cgi_main>, <&cgi_dpll0>, <&cgi_dpll1>;
53+
clock-names = "cgi_main", "cgi_dpll0", "cgi_dpll1";
54+
#clock-cells = <1>;
55+
};
56+
57+
rpgate: clock-controller@7030010368 {
58+
compatible = "sophgo,sg2042-rpgate";
59+
reg = <0x70 0x30010368 0x0 0x98>;
60+
clocks = <&clkgen GATE_CLK_RP_CPU_NORMAL>;
61+
clock-names = "rpgate";
62+
#clock-cells = <1>;
63+
};
64+
65+
clkgen: clock-controller@7030012000 {
66+
compatible = "sophgo,sg2042-clkgen";
67+
reg = <0x70 0x30012000 0x0 0x1000>;
68+
clocks = <&pllclk MPLL_CLK>,
69+
<&pllclk FPLL_CLK>,
70+
<&pllclk DPLL0_CLK>,
71+
<&pllclk DPLL1_CLK>;
72+
clock-names = "mpll",
73+
"fpll",
74+
"dpll0",
75+
"dpll1";
76+
#clock-cells = <1>;
77+
};
78+
2979
clint_mswi: interrupt-controller@7094000000 {
3080
compatible = "sophgo,sg2042-aclint-mswi", "thead,c900-aclint-mswi";
3181
reg = <0x00000070 0x94000000 0x00000000 0x00004000>;
@@ -341,6 +391,9 @@
341391
interrupt-parent = <&intc>;
342392
interrupts = <112 IRQ_TYPE_LEVEL_HIGH>;
343393
clock-frequency = <500000000>;
394+
clocks = <&clkgen GATE_CLK_UART_500M>,
395+
<&clkgen GATE_CLK_APB_UART>;
396+
clock-names = "baudclk", "apb_pclk";
344397
reg-shift = <2>;
345398
reg-io-width = <4>;
346399
resets = <&rstgen RST_UART0>;

0 commit comments

Comments
 (0)