Skip to content

Commit 964f09e

Browse files
committed
soc: wch: Reorganize Qingke V4 Socs for future
Reorganization for deduplication. Signed-off-by: Camille BAUD <mail@massdriver.space>
1 parent 8ae6dfa commit 964f09e

26 files changed

+28
-173
lines changed

drivers/clock_control/clock_control_wch_rcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void clock_control_wch_rcc_setup_flash(void)
9090
} else {
9191
latency = FLASH_ACTLR_LATENCY_1;
9292
}
93-
#elif defined(CONFIG_SOC_SERIES_CH32V00X)
93+
#elif defined(CONFIG_SOC_SERIES_QINGKE_V2A)
9494
if (WCH_RCC_SYSCLK <= 15000000) {
9595
latency = FLASH_ACTLR_LATENCY_0;
9696
} else if (WCH_RCC_SYSCLK <= 24000000) {

drivers/timer/Kconfig.wch_ch32v00x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
config CH32V00X_SYSTICK
55
bool "CH32V QingKe core systick timer"
6-
depends on SOC_SERIES_QINGKE_V2A || SOC_SERIES_QINGKE_V4C || SOC_SERIES_CH32V00X
6+
depends on SOC_SERIES_QINGKE_V2A || SOC_SERIES_QINGKE_V4
77
default y
88
depends on DT_HAS_WCH_SYSTICK_ENABLED

modules/hal_wch/ch32fun.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@
77
#ifndef _CH32FUN_H
88
#define _CH32FUN_H
99

10-
#if defined(CONFIG_SOC_CH32V003)
10+
#if defined(CONFIG_SOC_CH32V003) || defined(CONFIG_SOC_CH32V006)
1111
#define CH32V003 1
1212
#include <ch32v003fun.h>
1313
#endif
1414

15-
#if defined(CONFIG_SOC_SERIES_CH32V00X)
16-
#define CH32V003 1
17-
#include <ch32v003fun.h>
18-
#endif
19-
20-
#if defined(CONFIG_SOC_SERIES_QINGKE_V4C)
15+
#if defined(CONFIG_SOC_CH32V208)
2116
#define CH32V20x 1
17+
#define CH32V20x_D8W 1
2218
#include <ch32v003fun.h>
2319
#endif
2420

soc/wch/ch32v/ch32v00x/Kconfig

Lines changed: 0 additions & 9 deletions
This file was deleted.

soc/wch/ch32v/ch32v00x/Kconfig.defconfig

Lines changed: 0 additions & 14 deletions
This file was deleted.

soc/wch/ch32v/ch32v00x/Kconfig.soc

Lines changed: 0 additions & 11 deletions
This file was deleted.

soc/wch/ch32v/ch32v00x/soc_irq.S

Lines changed: 0 additions & 20 deletions
This file was deleted.

soc/wch/ch32v/ch32v00x/vector.S

Lines changed: 0 additions & 29 deletions
This file was deleted.

soc/wch/ch32v/qingke_v2a/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config SOC_SERIES_QINGKE_V2A
66
select RISCV_ISA_EXT_ZICSR
77
select RISCV_ISA_EXT_ZIFENCEI
88
select RISCV_ISA_EXT_C
9+
select RISCV_ISA_EXT_ZMMUL

soc/wch/ch32v/qingke_v2a/Kconfig.defconfig

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

44
if SOC_SERIES_QINGKE_V2A
55

66
config SYS_CLOCK_HW_CYCLES_PER_SEC
77
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
88

9-
config MAIN_STACK_SIZE
10-
default 512
11-
12-
config IDLE_STACK_SIZE
13-
default 256
14-
15-
config ISR_STACK_SIZE
16-
default 256
17-
189
config CLOCK_CONTROL
1910
default y
2011

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (c) 2025 Michael Hope <michaelh@juju.nz>
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if SOC_SERIES_CH32V00X
4+
if SOC_CH32V006
55

66
config VECTOR_TABLE_SIZE
77
default 41
88

99
config NUM_IRQS
1010
default 41
1111

12-
endif # SOC_SERIES_CH32V00X
12+
endif # SOC_CH32V006

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
config SOC_CH32V006
55
bool
6-
select SOC_SERIES_CH32V00X
6+
select SOC_SERIES_QINGKE_V2A
77

88
config SOC
99
default "ch32v006" if SOC_CH32V006

soc/wch/ch32v/qingke_v2a/soc_irq.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2024 Michael Hope
1+
/*
2+
* Copyright (c) 2024 Michael Hope
23
*
34
* SPDX-License-Identifier: Apache-2.0
45
*/

soc/wch/ch32v/ch32v00x/CMakeLists.txt renamed to soc/wch/ch32v/qingke_v4/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Copyright (c) 2024 Michael Hope
2-
# Copyright (c) 2024 Jianxiong Gu
1+
# Copyright (c) 2025 MASSDRIVER EI
32
# SPDX-License-Identifier: Apache-2.0
43

54
zephyr_sources(

soc/wch/ch32v/qingke_v4/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
rsource "*/Kconfig"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if SOC_SERIES_QINGKE_V4C
4+
if SOC_SERIES_QINGKE_V4
55

66
config SYS_CLOCK_HW_CYCLES_PER_SEC
77
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
88

99
config CLOCK_CONTROL
1010
default y
1111

12-
rsource "Kconfig.defconfig.*"
12+
rsource "*/Kconfig.defconfig.*"
1313

14-
endif # SOC_SERIES_QINGKE_V4C
14+
endif # SOC_SERIES_QINGKE_V4
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
22
# SPDX-License-Identifier: Apache-2.0
33

4-
config SOC_SERIES_QINGKE_V4C
4+
config SOC_SERIES_QINGKE_V4
55
bool
66
select SOC_FAMILY_CH32V
77

88
config SOC_SERIES
9-
default "qingke_v4c" if SOC_SERIES_QINGKE_V4C
9+
default "qingke_v4" if SOC_SERIES_QINGKE_V4
1010

11-
rsource "Kconfig.soc.*"
11+
rsource "*/Kconfig.soc.*"

soc/wch/ch32v/ch32v00x/pinctrl_soc.h renamed to soc/wch/ch32v/qingke_v4/pinctrl_soc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* @brief Type to hold a pin's pinctrl configuration.
1212
*/
13-
struct ch32v00x_pinctrl_soc_pin {
13+
struct qingke_v4_pinctrl_soc_pin {
1414
uint32_t config: 22;
1515
bool bias_pull_up: 1;
1616
bool bias_pull_down: 1;
@@ -21,7 +21,7 @@ struct ch32v00x_pinctrl_soc_pin {
2121
uint8_t slew_rate: 2;
2222
};
2323

24-
typedef struct ch32v00x_pinctrl_soc_pin pinctrl_soc_pin_t;
24+
typedef struct qingke_v4_pinctrl_soc_pin pinctrl_soc_pin_t;
2525

2626
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
2727
{ \

soc/wch/ch32v/qingke_v4c/Kconfig renamed to soc/wch/ch32v/qingke_v4/qingke_v4c/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
22
# SPDX-License-Identifier: Apache-2.0
33

4-
config SOC_SERIES_QINGKE_V4C
4+
config SOC_CH32V208
55
select RISCV_ISA_RV32I
66
select RISCV_ISA_EXT_M
77
select RISCV_ISA_EXT_A

soc/wch/ch32v/qingke_v4c/Kconfig.soc.ch32v208 renamed to soc/wch/ch32v/qingke_v4/qingke_v4c/Kconfig.soc.ch32v208

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
config SOC_CH32V208
55
bool
6-
select SOC_SERIES_QINGKE_V4C
6+
select SOC_SERIES_QINGKE_V4
77

88
config SOC
99
default "ch32v208" if SOC_CH32V208
File renamed without changes.

soc/wch/ch32v/qingke_v4c/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

soc/wch/ch32v/qingke_v4c/pinctrl_soc.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

soc/wch/ch32v/soc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ family:
77
- name: qingke-v2a
88
socs:
99
- name: ch32v003
10-
- name: ch32v00x
11-
socs:
1210
- name: ch32v006
13-
- name: qingke-v4c
11+
- name: qingke-v4
1412
socs:
1513
- name: ch32v208

0 commit comments

Comments
 (0)