Skip to content

Commit 33da812

Browse files
committed
riscv: dts: sophgo: Move all soc specific device into soc dtsi file
Although the cv1800b/cv1812h/sg2000/sg2002 share most peripherals, some basic peripherals, like clock, pinctrl, clint and plint, are not shared. These are caused by not only historical reason (plic, clint), but also the fact the device is not the same (clock, pinctrl). It is good to override device compatible when the SoC number is small, but now it is a burden for maintenance, and it is kind of annoyed to explain why using override. So it is time to move this out of the common peripheral header. Move all soc related peripheral device from common peripheral header to the soc specific header to get rid of most compatible override. Reviewed-by: Yixun Lan <[email protected]> Reviewed-by: Alexander Sverdlin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Inochi Amaoto <[email protected]> Signed-off-by: Chen Wang <[email protected]> Signed-off-by: Chen Wang <[email protected]>
1 parent 73ab31a commit 33da812

File tree

4 files changed

+72
-52
lines changed

4 files changed

+72
-52
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,37 @@
1515
};
1616

1717
soc {
18+
interrupt-parent = <&plic>;
19+
dma-noncoherent;
20+
1821
pinctrl: pinctrl@3001000 {
1922
compatible = "sophgo,cv1800b-pinctrl";
2023
reg = <0x03001000 0x1000>,
2124
<0x05027000 0x1000>;
2225
reg-names = "sys", "rtc";
2326
};
24-
};
25-
};
2627

27-
&plic {
28-
compatible = "sophgo,cv1800b-plic", "thead,c900-plic";
29-
};
28+
clk: clock-controller@3002000 {
29+
compatible = "sophgo,cv1800-clk";
30+
reg = <0x03002000 0x1000>;
31+
clocks = <&osc>;
32+
#clock-cells = <1>;
33+
};
3034

31-
&clint {
32-
compatible = "sophgo,cv1800b-clint", "thead,c900-clint";
33-
};
35+
plic: interrupt-controller@70000000 {
36+
compatible = "sophgo,cv1800b-plic", "thead,c900-plic";
37+
reg = <0x70000000 0x4000000>;
38+
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>;
39+
interrupt-controller;
40+
#address-cells = <0>;
41+
#interrupt-cells = <2>;
42+
riscv,ndev = <101>;
43+
};
3444

35-
&clk {
36-
compatible = "sophgo,cv1800-clk";
45+
clint: timer@74000000 {
46+
compatible = "sophgo,cv1800b-clint", "thead,c900-clint";
47+
reg = <0x74000000 0x10000>;
48+
interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>;
49+
};
50+
};
3751
};

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,37 @@
1717
};
1818

1919
soc {
20+
interrupt-parent = <&plic>;
21+
dma-noncoherent;
22+
2023
pinctrl: pinctrl@3001000 {
2124
compatible = "sophgo,cv1812h-pinctrl";
2225
reg = <0x03001000 0x1000>,
2326
<0x05027000 0x1000>;
2427
reg-names = "sys", "rtc";
2528
};
26-
};
27-
};
2829

29-
&plic {
30-
compatible = "sophgo,cv1812h-plic", "thead,c900-plic";
31-
};
30+
clk: clock-controller@3002000 {
31+
compatible = "sophgo,cv1810-clk";
32+
reg = <0x03002000 0x1000>;
33+
clocks = <&osc>;
34+
#clock-cells = <1>;
35+
};
3236

33-
&clint {
34-
compatible = "sophgo,cv1812h-clint", "thead,c900-clint";
35-
};
37+
plic: interrupt-controller@70000000 {
38+
compatible = "sophgo,cv1812h-plic", "thead,c900-plic";
39+
reg = <0x70000000 0x4000000>;
40+
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>;
41+
interrupt-controller;
42+
#address-cells = <0>;
43+
#interrupt-cells = <2>;
44+
riscv,ndev = <101>;
45+
};
3646

37-
&clk {
38-
compatible = "sophgo,cv1810-clk";
47+
clint: timer@74000000 {
48+
compatible = "sophgo,cv1812h-clint", "thead,c900-clint";
49+
reg = <0x74000000 0x10000>;
50+
interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>;
51+
};
52+
};
3953
};

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,10 @@
4949

5050
soc {
5151
compatible = "simple-bus";
52-
interrupt-parent = <&plic>;
5352
#address-cells = <1>;
5453
#size-cells = <1>;
55-
dma-noncoherent;
5654
ranges;
5755

58-
clk: clock-controller@3002000 {
59-
reg = <0x03002000 0x1000>;
60-
clocks = <&osc>;
61-
#clock-cells = <1>;
62-
};
63-
6456
gpio0: gpio@3020000 {
6557
compatible = "snps,dw-apb-gpio";
6658
reg = <0x3020000 0x1000>;
@@ -344,19 +336,5 @@
344336
snps,data-width = <2>;
345337
status = "disabled";
346338
};
347-
348-
plic: interrupt-controller@70000000 {
349-
reg = <0x70000000 0x4000000>;
350-
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>;
351-
interrupt-controller;
352-
#address-cells = <0>;
353-
#interrupt-cells = <2>;
354-
riscv,ndev = <101>;
355-
};
356-
357-
clint: timer@74000000 {
358-
reg = <0x74000000 0x10000>;
359-
interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>;
360-
};
361339
};
362340
};

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,39 @@
1717
};
1818

1919
soc {
20+
interrupt-parent = <&plic>;
21+
dma-noncoherent;
22+
2023
pinctrl: pinctrl@3001000 {
2124
compatible = "sophgo,sg2002-pinctrl";
2225
reg = <0x03001000 0x1000>,
2326
<0x05027000 0x1000>;
2427
reg-names = "sys", "rtc";
2528
};
26-
};
27-
};
2829

29-
&plic {
30-
compatible = "sophgo,sg2002-plic", "thead,c900-plic";
31-
};
30+
clk: clock-controller@3002000 {
31+
compatible = "sophgo,sg2000-clk";
32+
reg = <0x03002000 0x1000>;
33+
clocks = <&osc>;
34+
#clock-cells = <1>;
35+
};
3236

33-
&clint {
34-
compatible = "sophgo,sg2002-clint", "thead,c900-clint";
35-
};
37+
plic: interrupt-controller@70000000 {
38+
compatible = "sophgo,sg2002-plic", "thead,c900-plic";
39+
reg = <0x70000000 0x4000000>;
40+
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>;
41+
interrupt-controller;
42+
#address-cells = <0>;
43+
#interrupt-cells = <2>;
44+
riscv,ndev = <101>;
45+
};
3646

37-
&clk {
38-
compatible = "sophgo,sg2000-clk";
47+
clint: timer@74000000 {
48+
compatible = "sophgo,sg2002-clint", "thead,c900-clint";
49+
reg = <0x74000000 0x10000>;
50+
interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>;
51+
};
52+
};
3953
};
4054

4155
&sdhci0 {

0 commit comments

Comments
 (0)