Skip to content

Commit 384144d

Browse files
recalcikartben
authored andcommitted
soc: wch: reorganize series directories by core
Place ch32v003 under the qingke_v2a series. Place qingke series under the ch32v family. Signed-off-by: Jianxiong Gu <[email protected]>
1 parent a7e1565 commit 384144d

File tree

15 files changed

+78
-26
lines changed

15 files changed

+78
-26
lines changed

modules/hal_wch/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
if(CONFIG_SOC_SERIES_CH32V00X)
1+
if(CONFIG_SOC_CH32V003)
22
zephyr_include_directories(${ZEPHYR_HAL_WCH_MODULE_DIR}/ch32v003fun .)
33
endif()
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Copyright (c) 2024 Michael Hope
22
# SPDX-License-Identifier: Apache-2.0
33

4-
zephyr_sources(
5-
soc_irq.S
6-
vector.S
7-
)
4+
add_subdirectory(${SOC_SERIES})
85

96
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "")

soc/wch/ch32v/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2024 Michael Hope
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_FAMILY_CH32V
5+
select RISCV
6+
select BUILD_OUTPUT_HEX
7+
select CH32V00X_SYSTICK
8+
select ATOMIC_OPERATIONS_C
9+
imply XIP
10+
11+
if SOC_FAMILY_CH32V
12+
13+
rsource "*/Kconfig"
14+
15+
endif # SOC_FAMILY_CH32V

soc/wch/ch32v/Kconfig.defconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2024 Michael Hope
2+
# Copyright (c) 2024 Jianxiong Gu
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if SOC_FAMILY_CH32V
6+
7+
rsource "*/Kconfig.defconfig"
8+
9+
endif # SOC_FAMILY_CH32V

soc/wch/ch32v/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Michael Hope
2+
# Copyright (c) 2024 Jianxiong Gu
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config SOC_FAMILY_CH32V
6+
bool
7+
8+
config SOC_FAMILY
9+
default "ch32v" if SOC_FAMILY_CH32V
10+
11+
rsource "*/Kconfig.soc"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Michael Hope
2+
# Copyright (c) 2024 Jianxiong Gu
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_sources(
6+
soc_irq.S
7+
vector.S
8+
)
9+
10+
zephyr_include_directories(.)
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
# Copyright (c) 2024 Michael Hope
22
# SPDX-License-Identifier: Apache-2.0
33

4-
config SOC_CH32V003
5-
select RISCV
6-
select BUILD_OUTPUT_HEX
4+
config SOC_SERIES_QINGKE_V2A
75
select RISCV_ISA_RV32E
86
select RISCV_ISA_EXT_ZICSR
97
select RISCV_ISA_EXT_ZIFENCEI
108
select RISCV_ISA_EXT_C
11-
select CH32V00X_SYSTICK
12-
select ATOMIC_OPERATIONS_C
13-
imply XIP

soc/wch/ch32v00x/Kconfig.defconfig renamed to soc/wch/ch32v/qingke_v2a/Kconfig.defconfig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Copyright (c) 2024 Michael Hope
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if SOC_CH32V003
5-
6-
config NUM_IRQS
7-
default 48
4+
if SOC_SERIES_QINGKE_V2A
85

96
config SYS_CLOCK_HW_CYCLES_PER_SEC
107
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
@@ -21,4 +18,6 @@ config ISR_STACK_SIZE
2118
config CLOCK_CONTROL
2219
default y
2320

24-
endif # SOC_CH32V003
21+
rsource "Kconfig.defconfig.*"
22+
23+
endif # SOC_SERIES_QINGKE_V2A
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2024 Michael Hope
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_CH32V003
5+
6+
config NUM_IRQS
7+
default 48
8+
9+
endif # SOC_CH32V003
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Jianxiong Gu
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_QINGKE_V2A
5+
bool
6+
select SOC_FAMILY_CH32V
7+
8+
config SOC_SERIES
9+
default "qingke_v2a" if SOC_SERIES_QINGKE_V2A
10+
11+
rsource "Kconfig.soc.*"

0 commit comments

Comments
 (0)