Skip to content

Commit 975e92e

Browse files
committed
soc: arm: Introduce gigadevice soc
Add gigadevice soc initial version. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent aa1524e commit 975e92e

File tree

14 files changed

+189
-0
lines changed

14 files changed

+189
-0
lines changed

modules/hal_gigadevice/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ if(CONFIG_HAS_GD32_HAL)
55

66
zephyr_library_named(hal_gigadevice)
77

8+
if(CONFIG_SOC_SERIES_GD32F403)
9+
set(gd32_soc_uc GD32F403)
10+
set(gd32_soc_lc gd32f403)
11+
endif()
12+
813
zephyr_library_compile_definitions(${gd32_soc_uc})
914

1015
set(gd32_soc_dir ${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/${gd32_soc_uc})

modules/hal_gigadevice/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config ZEPHYR_HAL_GIGADEVICE_MODULE
66

77
config HAS_GD32_HAL
88
bool
9+
select HAS_CMSIS_CORE if SOC_FAMILY_GD32_ARM
910

1011
if HAS_GD32_HAL
1112

soc/arm/gigadevice/CMakeLists.txt

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

soc/arm/gigadevice/Kconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_FAMILY_GD32
5+
bool
6+
select HAS_GD32_HAL
7+
select BUILD_OUTPUT_HEX
8+
9+
config SOC_FAMILY
10+
string
11+
default "gigadevice"
12+
depends on SOC_FAMILY_GD32
13+
14+
config SOC_FAMILY_GD32_ARM
15+
bool
16+
select SOC_FAMILY_GD32
17+
18+
if SOC_FAMILY_GD32_ARM
19+
20+
source "soc/arm/gigadevice/*/Kconfig.soc"
21+
22+
endif # SOC_FAMILY_GD32_ARM
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
source "soc/arm/gigadevice/*/Kconfig.defconfig.series"

soc/arm/gigadevice/Kconfig.soc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
source "soc/arm/gigadevice/*/Kconfig.series"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_include_directories(.)
5+
zephyr_sources(soc.c)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_GD32F403R || SOC_GD32F403V || SOC_GD32F403Z
5+
6+
config SOC
7+
default "gd32f403r" if SOC_GD32F403R
8+
default "gd32f403v" if SOC_GD32F403V
9+
default "gd32f403z" if SOC_GD32F403Z
10+
11+
config SOC_SERIES_GD32F403
12+
bool
13+
default y
14+
15+
config SYS_CLOCK_HW_CYCLES_PER_SEC
16+
default 168000000
17+
18+
config NUM_IRQS
19+
default 68
20+
21+
endif
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_GD32F4
5+
6+
source "soc/arm/gigadevice/gd32f4/Kconfig.defconfig.gd32f4*"
7+
8+
config SOC_SERIES
9+
default "gd32f4"
10+
11+
endif # SOC_SERIES_GD32F4
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_GD32F4
5+
bool "GigaDevice GD32F4xxx series Cortex-M4F MCU"
6+
select ARM
7+
select CPU_HAS_ARM_MPU
8+
select CPU_HAS_FPU
9+
select CPU_CORTEX_M4
10+
select CPU_CORTEX_M_HAS_SYSTICK
11+
select CPU_CORTEX_M_HAS_VTOR
12+
select SOC_FAMILY_GD32_ARM
13+
help
14+
Enable support for GigaDevice GD32F4xxx MCU series

0 commit comments

Comments
 (0)