Skip to content

Commit 0212bd4

Browse files
committed
riscv: dts: sophgo: Move riscv cpu definition to a separate file
As sg2000 and sg2002 can boot from an arm a53 core, it is not suitable to left the riscv cpu definition in the common peripheral header. Move the riscv related device into a separate header file, so the arm subsystem can reuse the common peripheral header. Signed-off-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 33da812 commit 0212bd4

File tree

5 files changed

+39
-29
lines changed

5 files changed

+39
-29
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <dt-bindings/pinctrl/pinctrl-cv1800b.h>
7+
#include "cv180x-cpus.dtsi"
78
#include "cv18xx.dtsi"
89

910
/ {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
/*
3+
* Copyright (C) 2023 Jisheng Zhang <[email protected]>
4+
* Copyright (C) 2023 Inochi Amaoto <[email protected]>
5+
*/
6+
7+
/ {
8+
cpus: cpus {
9+
#address-cells = <1>;
10+
#size-cells = <0>;
11+
timebase-frequency = <25000000>;
12+
13+
cpu0: cpu@0 {
14+
compatible = "thead,c906", "riscv";
15+
device_type = "cpu";
16+
reg = <0>;
17+
d-cache-block-size = <64>;
18+
d-cache-sets = <512>;
19+
d-cache-size = <65536>;
20+
i-cache-block-size = <64>;
21+
i-cache-sets = <128>;
22+
i-cache-size = <32768>;
23+
mmu-type = "riscv,sv39";
24+
riscv,isa = "rv64imafdc";
25+
riscv,isa-base = "rv64i";
26+
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
27+
"zifencei", "zihpm";
28+
29+
cpu0_intc: interrupt-controller {
30+
compatible = "riscv,cpu-intc";
31+
interrupt-controller;
32+
#interrupt-cells = <1>;
33+
};
34+
};
35+
};
36+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <dt-bindings/interrupt-controller/irq.h>
77
#include <dt-bindings/pinctrl/pinctrl-cv1812h.h>
8+
#include "cv180x-cpus.dtsi"
89
#include "cv18xx.dtsi"
910
#include "cv181x.dtsi"
1011

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,6 @@
1212
#address-cells = <1>;
1313
#size-cells = <1>;
1414

15-
cpus: cpus {
16-
#address-cells = <1>;
17-
#size-cells = <0>;
18-
timebase-frequency = <25000000>;
19-
20-
cpu0: cpu@0 {
21-
compatible = "thead,c906", "riscv";
22-
device_type = "cpu";
23-
reg = <0>;
24-
d-cache-block-size = <64>;
25-
d-cache-sets = <512>;
26-
d-cache-size = <65536>;
27-
i-cache-block-size = <64>;
28-
i-cache-sets = <128>;
29-
i-cache-size = <32768>;
30-
mmu-type = "riscv,sv39";
31-
riscv,isa = "rv64imafdc";
32-
riscv,isa-base = "rv64i";
33-
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
34-
"zifencei", "zihpm";
35-
36-
cpu0_intc: interrupt-controller {
37-
compatible = "riscv,cpu-intc";
38-
interrupt-controller;
39-
#interrupt-cells = <1>;
40-
};
41-
};
42-
};
43-
4415
osc: oscillator {
4516
compatible = "fixed-clock";
4617
clock-output-names = "osc_25m";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <dt-bindings/interrupt-controller/irq.h>
77
#include <dt-bindings/pinctrl/pinctrl-sg2002.h>
8+
#include "cv180x-cpus.dtsi"
89
#include "cv18xx.dtsi"
910
#include "cv181x.dtsi"
1011

0 commit comments

Comments
 (0)