Skip to content

Commit 23f0a01

Browse files
xingrzlenghonglin
andcommitted
dts/soc: sophgo: Add SOPHGO CV1800B
CV180x is a series of RV64 SoCs developed by SOPHGO (formerly CVITEK), based on T-Head C906 CPU. Co-authored-by: honglin leng <[email protected]> Signed-off-by: Chen Xingyu <[email protected]>
1 parent 9010a75 commit 23f0a01

File tree

12 files changed

+251
-0
lines changed

12 files changed

+251
-0
lines changed

dts/riscv/sophgo/cv180x.dtsi

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <mem.h>
7+
#include <freq.h>
8+
9+
#include <sophgo/cv18xx-c906-common.dtsi>
10+
11+
/ {
12+
soc {
13+
compatible = "sophgo,cv180x", "simple-bus";
14+
15+
gpioa: gpio@3020000 {
16+
compatible = "snps,designware-gpio";
17+
reg = <0x3020000 DT_SIZE_K(4)>;
18+
interrupts = <41 1>;
19+
gpio-controller;
20+
#gpio-cells = <2>;
21+
status = "disabled";
22+
};
23+
24+
gpiob: gpio@3021000 {
25+
compatible = "snps,designware-gpio";
26+
reg = <0x3021000 DT_SIZE_K(4)>;
27+
interrupts = <42 1>;
28+
gpio-controller;
29+
#gpio-cells = <2>;
30+
status = "disabled";
31+
};
32+
33+
gpioc: gpio@3022000 {
34+
compatible = "snps,designware-gpio";
35+
reg = <0x3022000 DT_SIZE_K(4)>;
36+
interrupts = <43 1>;
37+
gpio-controller;
38+
#gpio-cells = <2>;
39+
status = "disabled";
40+
};
41+
42+
gpiod: gpio@3023000 {
43+
compatible = "snps,designware-gpio";
44+
reg = <0x3023000 DT_SIZE_K(4)>;
45+
interrupts = <44 1>;
46+
gpio-controller;
47+
#gpio-cells = <2>;
48+
status = "disabled";
49+
};
50+
51+
uart0: uart@4140000 {
52+
compatible = "ns16550";
53+
reg = <0x4140000 DT_SIZE_K(64)>;
54+
interrupts = <30 1>;
55+
reg-shift = <2>;
56+
clock-frequency = <DT_FREQ_M(25)>;
57+
status = "disabled";
58+
};
59+
60+
uart1: uart@4150000 {
61+
compatible = "ns16550";
62+
reg = <0x4150000 DT_SIZE_K(64)>;
63+
interrupts = <31 1>;
64+
reg-shift = <2>;
65+
clock-frequency = <DT_FREQ_M(25)>;
66+
status = "disabled";
67+
};
68+
69+
uart2: uart@4160000 {
70+
compatible = "ns16550";
71+
reg = <0x4160000 DT_SIZE_K(64)>;
72+
/* interrupt is not supported */
73+
reg-shift = <2>;
74+
clock-frequency = <DT_FREQ_M(25)>;
75+
status = "disabled";
76+
};
77+
78+
uart3: uart@4170000 {
79+
compatible = "ns16550";
80+
reg = <0x4170000 DT_SIZE_K(64)>;
81+
/* interrupt is not supported */
82+
reg-shift = <2>;
83+
clock-frequency = <DT_FREQ_M(25)>;
84+
status = "disabled";
85+
};
86+
87+
uart4: uart@41c0000 {
88+
compatible = "ns16550";
89+
reg = <0x41c0000 DT_SIZE_K(64)>;
90+
/* interrupt is not supported */
91+
reg-shift = <2>;
92+
clock-frequency = <DT_FREQ_M(25)>;
93+
status = "disabled";
94+
};
95+
};
96+
};
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <mem.h>
7+
#include <freq.h>
8+
9+
/ {
10+
cpus {
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
14+
cpu0: cpu@0 {
15+
compatible = "thead,c906";
16+
reg = <0>;
17+
clock-frequency = <DT_FREQ_M(700)>;
18+
mmu-type = "riscv,none";
19+
riscv,isa = "rv64imafdc_zicsr_zifencei";
20+
21+
hlic: interrupt-controller {
22+
compatible = "riscv,cpu-intc";
23+
#address-cells = <0>;
24+
#interrupt-cells = <1>;
25+
interrupt-controller;
26+
};
27+
};
28+
};
29+
30+
soc {
31+
#address-cells = <1>;
32+
#size-cells = <1>;
33+
interrupt-parent = <&plic0>;
34+
35+
plic0: interrupt-controller@70000000 {
36+
compatible = "sifive,plic-1.0.0";
37+
reg = <0x70000000 0x4000000>;
38+
interrupts-extended = <&hlic 11>;
39+
interrupt-controller;
40+
riscv,max-priority = <7>;
41+
riscv,ndev = <101>;
42+
#address-cells = <0>;
43+
#interrupt-cells = <2>;
44+
};
45+
46+
systick: systick@74000000 {
47+
compatible = "riscv,machine-timer";
48+
reg = <0x74004000 0x8>;
49+
reg-names = "mtimecmp";
50+
interrupts-extended = <&hlic 7>;
51+
mtime-is-csr;
52+
mtimecmp-is-32bits;
53+
};
54+
};
55+
};

soc/sophgo/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
add_subdirectory(common)
4+
add_subdirectory(${SOC_SERIES})

soc/sophgo/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_SOPHGO
5+
6+
rsource "*/Kconfig"
7+
8+
endif # SOC_FAMILY_SOPHGO

soc/sophgo/Kconfig.defconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_SOPHGO
5+
6+
rsource "*/Kconfig.defconfig"
7+
8+
endif # SOC_FAMILY_SOPHGO

soc/sophgo/Kconfig.soc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_FAMILY_SOPHGO
5+
bool
6+
7+
config SOC_FAMILY
8+
default "sophgo" if SOC_FAMILY_SOPHGO
9+
10+
rsource "*/Kconfig.soc"

soc/sophgo/common/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_include_directories(.)

soc/sophgo/cv180x/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "")

soc/sophgo/cv180x/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_CV180X
5+
select 64BIT
6+
select RISCV
7+
select RISCV_PRIVILEGED
8+
select RISCV_ISA_RV64I
9+
select RISCV_ISA_EXT_M
10+
select RISCV_ISA_EXT_A
11+
select RISCV_ISA_EXT_F
12+
select RISCV_ISA_EXT_D
13+
select RISCV_ISA_EXT_C
14+
select RISCV_ISA_EXT_ZICSR
15+
select RISCV_ISA_EXT_ZIFENCEI
16+
select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING
17+
select INCLUDE_RESET_VECTOR
18+
select ATOMIC_OPERATIONS_C

soc/sophgo/cv180x/Kconfig.defconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_CV180X
5+
6+
config SYS_CLOCK_HW_CYCLES_PER_SEC
7+
default 25000000
8+
9+
config NUM_IRQS
10+
int
11+
default 128
12+
13+
config RISCV_SOC_INTERRUPT_INIT
14+
default y
15+
16+
config RISCV_HAS_PLIC
17+
default y
18+
19+
config 2ND_LVL_INTR_00_OFFSET
20+
default 11
21+
22+
endif # SOC_SERIES_CV180X

0 commit comments

Comments
 (0)