soc: arm: gigadevice: add initial support for gd32e50x series
Add initial support for GD32E50X series (only GD32507X for now). Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
13a071ea74
commit
ffc90592f8
5
soc/arm/gigadevice/gd32e50x/CMakeLists.txt
Normal file
5
soc/arm/gigadevice/gd32e50x/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_include_directories(.)
|
||||
zephyr_sources(soc.c)
|
15
soc/arm/gigadevice/gd32e50x/Kconfig.defconfig.gd32e507
Normal file
15
soc/arm/gigadevice/gd32e50x/Kconfig.defconfig.gd32e507
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Copyright (c) 2022 Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if SOC_GD32E507
|
||||
|
||||
config SOC
|
||||
default "gd32e507"
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
|
||||
|
||||
config NUM_IRQS
|
||||
default 88
|
||||
|
||||
endif # SOC_GD32E507
|
11
soc/arm/gigadevice/gd32e50x/Kconfig.defconfig.series
Normal file
11
soc/arm/gigadevice/gd32e50x/Kconfig.defconfig.series
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if SOC_SERIES_GD32E50X
|
||||
|
||||
source "soc/arm/gigadevice/gd32e50x/Kconfig.defconfig.gd32*"
|
||||
|
||||
config SOC_SERIES
|
||||
default "gd32e50x"
|
||||
|
||||
endif # SOC_SERIES_GD32E50X
|
13
soc/arm/gigadevice/gd32e50x/Kconfig.series
Normal file
13
soc/arm/gigadevice/gd32e50x/Kconfig.series
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_SERIES_GD32E50X
|
||||
bool "GigaDevice GD32E50X series Cortex-M33 MCU"
|
||||
select ARM
|
||||
select CPU_HAS_ARM_MPU
|
||||
select CPU_HAS_FPU
|
||||
select CPU_CORTEX_M33
|
||||
select SOC_FAMILY_GD32_ARM
|
||||
select GD32_HAS_AFIO_PINMUX
|
||||
help
|
||||
Enable support for GigaDevice GD32E50X MCU series
|
11
soc/arm/gigadevice/gd32e50x/Kconfig.soc
Normal file
11
soc/arm/gigadevice/gd32e50x/Kconfig.soc
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
choice
|
||||
prompt "GigaDevice GD32E50X MCU Selection"
|
||||
depends on SOC_SERIES_GD32E50X
|
||||
|
||||
config SOC_GD32E507
|
||||
bool "gd32e507"
|
||||
|
||||
endchoice
|
6
soc/arm/gigadevice/gd32e50x/linker.ld
Normal file
6
soc/arm/gigadevice/gd32e50x/linker.ld
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld>
|
25
soc/arm/gigadevice/gd32e50x/soc.c
Normal file
25
soc/arm/gigadevice/gd32e50x/soc.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/irq.h>
|
||||
|
||||
static int gd32e50x_soc_init(const struct device *dev)
|
||||
{
|
||||
uint32_t key;
|
||||
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
key = irq_lock();
|
||||
|
||||
SystemInit();
|
||||
NMI_INIT();
|
||||
|
||||
irq_unlock(key);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(gd32e50x_soc_init, PRE_KERNEL_1, 0);
|
15
soc/arm/gigadevice/gd32e50x/soc.h
Normal file
15
soc/arm/gigadevice/gd32e50x/soc.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _SOC_ARM_GIGADEVICE_GD32E50X_SOC_H_
|
||||
#define _SOC_ARM_GIGADEVICE_GD32E50X_SOC_H_
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
#include <gd32e50x.h>
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _SOC_ARM_GIGADEVICE_GD32E50X_SOC_H_ */
|
Loading…
Reference in a new issue