Skip to content

Commit 49f4eaa

Browse files
committed
modules: Add gigadevice hal module
This add access to modules/hal/gigadevice with three firmware libraries by updating west.yaml file: - GD32E10X ARM (Cortex-M4F) - GD32F403 ARM (Cortex-M4F) - GD32VF103 RISC-V (Nucleisys Bumblebee core) It introduce module/hal_gigadevice, which contains all Cmake and Kconfig rules to build GigaDevice SoCs into zephyr main tree. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent 9c7f790 commit 49f4eaa

File tree

4 files changed

+235
-0
lines changed

4 files changed

+235
-0
lines changed

modules/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ comment "Unavailable modules, please install those via the project manifest."
4646
# config ZEPHYR_<MODULE_NAME_UPPER>_MODULE
4747
# bool
4848

49+
comment "hal_gigadevice module not available."
50+
depends on !ZEPHYR_HAL_GIGADEVICE_MODULE
51+
4952
comment "hal_nordic module not available."
5053
depends on !ZEPHYR_HAL_NORDIC_MODULE
5154

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) 2021 ATL-Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(CONFIG_HAS_GD32_HAL)
5+
6+
zephyr_library_named(hal_gigadevice)
7+
8+
zephyr_library_compile_definitions(${gd32_soc_uc})
9+
10+
set(gd32_soc_dir ${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/${gd32_soc_uc})
11+
set(gd32_cmsis_dir ${gd32_soc_dir}/CMSIS/GD/${gd32_soc_uc})
12+
set(gd32_std_dir ${gd32_soc_dir}/standard_peripheral)
13+
set(gd32_std_src_dir ${gd32_std_dir}/Source)
14+
15+
# Global includes to be used outside hal_gigadevice
16+
zephyr_include_directories(${gd32_cmsis_dir}/Include)
17+
zephyr_include_directories(${gd32_std_dir}/Include)
18+
19+
zephyr_library_sources(${gd32_cmsis_dir}/Source/system_${gd32_soc_lc}.c)
20+
21+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_ADC ${gd32_std_src_dir}/${gd32_soc_lc}_adc.c)
22+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_BKP ${gd32_std_src_dir}/${gd32_soc_lc}_bkp.c)
23+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_CAN ${gd32_std_src_dir}/${gd32_soc_lc}_can.c)
24+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_CRC ${gd32_std_src_dir}/${gd32_soc_lc}_crc.c)
25+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_CTC ${gd32_std_src_dir}/${gd32_soc_lc}_ctc.c)
26+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_DAC ${gd32_std_src_dir}/${gd32_soc_lc}_dac.c)
27+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_DBG ${gd32_std_src_dir}/${gd32_soc_lc}_dbg.c)
28+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_DMA ${gd32_std_src_dir}/${gd32_soc_lc}_dma.c)
29+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_EXMC ${gd32_std_src_dir}/${gd32_soc_lc}_exmc.c)
30+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_EXTI ${gd32_std_src_dir}/${gd32_soc_lc}_exti.c)
31+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_FMC ${gd32_std_src_dir}/${gd32_soc_lc}_fmc.c)
32+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_FWDGT ${gd32_std_src_dir}/${gd32_soc_lc}_fwdgt.c)
33+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_GPIO ${gd32_std_src_dir}/${gd32_soc_lc}_gpio.c)
34+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_I2C ${gd32_std_src_dir}/${gd32_soc_lc}_i2c.c)
35+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_MISC ${gd32_std_src_dir}/${gd32_soc_lc}_misc.c)
36+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_PMU ${gd32_std_src_dir}/${gd32_soc_lc}_pmu.c)
37+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_RCU ${gd32_std_src_dir}/${gd32_soc_lc}_rcu.c)
38+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_RTC ${gd32_std_src_dir}/${gd32_soc_lc}_rtc.c)
39+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_SDIO ${gd32_std_src_dir}/${gd32_soc_lc}_sdio.c)
40+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_SPI ${gd32_std_src_dir}/${gd32_soc_lc}_spi.c)
41+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_TIMER ${gd32_std_src_dir}/${gd32_soc_lc}_timer.c)
42+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_USART ${gd32_std_src_dir}/${gd32_soc_lc}_usart.c)
43+
zephyr_library_sources_ifdef(CONFIG_USE_GD32_WWDGT ${gd32_std_src_dir}/${gd32_soc_lc}_wwdgt.c)
44+
45+
endif()

modules/hal_gigadevice/Kconfig

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Copyright (c) 2021 ATL-Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config ZEPHYR_HAL_GIGADEVICE_MODULE
5+
bool
6+
7+
config HAS_GD32_HAL
8+
bool
9+
10+
if HAS_GD32_HAL
11+
12+
config USE_GD32_ADC
13+
bool
14+
help
15+
Enable GD32 Analog-to-Digital Converter (ADC) HAL module driver
16+
17+
config USE_GD32_BKP
18+
bool
19+
help
20+
Enable GD32 Backup Registers (BKP) HAL module driver
21+
22+
config USE_GD32_CAN
23+
bool
24+
help
25+
Enable GD32 Controller Area Network (CAN) HAL module driver
26+
27+
config USE_GD32_CMP
28+
bool
29+
help
30+
Enable GD32 Comparator (CMP) HAL module driver
31+
32+
config USE_GD32_CRC
33+
bool
34+
help
35+
Enable GD32 Cyclic redundancy check calculation unit (CRC) HAL
36+
module driver
37+
38+
config USE_GD32_CTC
39+
bool
40+
help
41+
Enable GD32 Clock Trim Controller (CTC) HAL module driver
42+
43+
config USE_GD32_DAC
44+
bool
45+
help
46+
Enable GD32 Digital-to-Analog Converter (DAC) HAL module driver
47+
48+
config USE_GD32_DBG
49+
bool
50+
help
51+
Enable GD32 Debug (DBG) HAL module driver
52+
53+
config USE_GD32_DMA
54+
bool
55+
help
56+
Enable GD32 Direct Memory Access controller (DMA) HAL module driver
57+
58+
config USE_GD32_ECLIC
59+
bool
60+
help
61+
Enable GD32 Enhancement Core-Local Interrupt Controller (ECLIC) HAL
62+
module driver
63+
64+
config USE_GD32_ENET
65+
bool
66+
help
67+
Enable GD32 Ethernet (ENET) HAL module driver
68+
69+
config USE_GD32_EXMC
70+
bool
71+
help
72+
Enable GD32 External Memory Controller (EXMC) HAL module driver
73+
74+
config USE_GD32_EXTI
75+
bool
76+
help
77+
Enable GD32 Interrupt/Event controller (EXTI) HAL module driver
78+
79+
config USE_GD32_FMC
80+
bool
81+
help
82+
Enable GD32 Flash Memory Controller (FMC) HAL module driver
83+
84+
config USE_GD32_FWDGT
85+
bool
86+
help
87+
Enable GD32 Free Watchdog Timer (FWDGT) HAL module driver
88+
89+
config USE_GD32_GPIO
90+
bool
91+
default y
92+
help
93+
Enable GD32 General-purpose and Alternate-Function I/Os
94+
(GPIO and AFIO) HAL module driver
95+
96+
config USE_GD32_I2C
97+
bool
98+
help
99+
Enable GD32 Inter-Integrated Circuit Interface (I2C) HAL module driver
100+
101+
config USE_GD32_MISC
102+
bool
103+
help
104+
Enable GD32 System Utilities (MISC) HAL module driver
105+
106+
config USE_GD32_PMU
107+
bool
108+
help
109+
Enable GD32 Power Management Unit (PMU) HAL module driver
110+
111+
config USE_GD32_RCU
112+
bool
113+
default y
114+
help
115+
Enable GD32 Reset and Clock Unit (RCU) HAL module driver
116+
117+
config USE_GD32_RTC
118+
bool
119+
help
120+
Enable GD32 Real-Time Clock (RTC) HAL module driver
121+
122+
config USE_GD32_SDIO
123+
bool
124+
help
125+
Enable GD32 Secure Digital Input/Output interface (SDIO) HAL module
126+
driver
127+
128+
config USE_GD32_SPI
129+
bool
130+
help
131+
Enable GD32 Serial Peripheral Interface(SPI) HAL module driver
132+
133+
config USE_GD32_SQPI
134+
bool
135+
help
136+
Enable GD32 Serial/Quad Parallel Interface (SQPI) HAL module driver
137+
138+
config USE_GD32_SHRTIMER
139+
bool
140+
help
141+
Enable GD32 Super High-Resolution Timer (SHRTIMER) HAL module driver
142+
143+
config USE_GD32_TIMER
144+
bool
145+
help
146+
Enable GD32 Timer (TIMER) HAL module driver
147+
148+
config USE_GD32_TMU
149+
bool
150+
help
151+
Enable GD32 Trigonometric Math Unit (TMU) HAL module driver
152+
153+
config USE_GD32_USART
154+
bool
155+
help
156+
Enable GD32 Universal Synchronous/Asynchronous Receiver/Transmitter
157+
(USART) HAL module driver
158+
159+
config USE_GD32_USBD
160+
bool
161+
help
162+
Enable GD32 Universal Serial Bus full-speed Device interface (USBD)
163+
HAL module driver
164+
165+
config USE_GD32_USBFS
166+
bool
167+
help
168+
Enable GD32 Universal Serial Bus on-the-go Full-Speed (USBFS) HAL
169+
module driver
170+
171+
config USE_GD32_USBHS
172+
bool
173+
help
174+
Enable GD32 Universal Serial Bus High-Speed interface (USBHS) HAL
175+
module driver
176+
177+
config USE_GD32_WWDGT
178+
bool
179+
help
180+
Enable GD32 Window Watchdog Timer (WWDGT) HAL module driver
181+
182+
endif # HAS_GD32_HAL

west.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ manifest:
7272
west-commands: west/west-commands.yml
7373
groups:
7474
- hal
75+
- name: hal_gigadevice
76+
revision: ce323de9655972a545cbdddda813c1576d85d5d1
77+
path: modules/hal/gigadevice
78+
groups:
79+
- hal
7580
- name: hal_infineon
7681
revision: f1fa8241f8786198ba41155413243de36ed878a5
7782
path: modules/hal/infineon

0 commit comments

Comments
 (0)