soc: arm: gigadevice: add support for GD32F4XX SoCs
Add support for the F4XX series. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
13b011afb9
commit
95fd99aba3
8 changed files with 97 additions and 0 deletions
5
soc/arm/gigadevice/gd32f4xx/CMakeLists.txt
Normal file
5
soc/arm/gigadevice/gd32f4xx/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_include_directories(.)
|
||||
zephyr_sources(soc.c)
|
11
soc/arm/gigadevice/gd32f4xx/Kconfig.defconfig.gd32f450
Normal file
11
soc/arm/gigadevice/gd32f4xx/Kconfig.defconfig.gd32f450
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC
|
||||
default "gd32f450"
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
default 200000000
|
||||
|
||||
config NUM_IRQS
|
||||
default 91
|
11
soc/arm/gigadevice/gd32f4xx/Kconfig.defconfig.series
Normal file
11
soc/arm/gigadevice/gd32f4xx/Kconfig.defconfig.series
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if SOC_SERIES_GD32F4XX
|
||||
|
||||
source "soc/arm/gigadevice/gd32f4xx/Kconfig.defconfig.gd32*"
|
||||
|
||||
config SOC_SERIES
|
||||
default "gd32f4xx"
|
||||
|
||||
endif # SOC_SERIES_GD32F4XX
|
12
soc/arm/gigadevice/gd32f4xx/Kconfig.series
Normal file
12
soc/arm/gigadevice/gd32f4xx/Kconfig.series
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_SERIES_GD32F4XX
|
||||
bool "GigaDevice GD32F4XX series Cortex-M4F MCU"
|
||||
select ARM
|
||||
select CPU_HAS_ARM_MPU
|
||||
select CPU_HAS_FPU
|
||||
select CPU_CORTEX_M4
|
||||
select SOC_FAMILY_GD32_ARM
|
||||
help
|
||||
Enable support for GigaDevice GD32F4XX MCU series
|
11
soc/arm/gigadevice/gd32f4xx/Kconfig.soc
Normal file
11
soc/arm/gigadevice/gd32f4xx/Kconfig.soc
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
choice
|
||||
prompt "GigaDevice GD32F4XX MCU Selection"
|
||||
depends on SOC_SERIES_GD32F4XX
|
||||
|
||||
config SOC_GD32F450
|
||||
bool "gd32f450"
|
||||
|
||||
endchoice
|
6
soc/arm/gigadevice/gd32f4xx/linker.ld
Normal file
6
soc/arm/gigadevice/gd32f4xx/linker.ld
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld>
|
25
soc/arm/gigadevice/gd32f4xx/soc.c
Normal file
25
soc/arm/gigadevice/gd32f4xx/soc.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
|
||||
static int gd32f4xx_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(gd32f4xx_soc_init, PRE_KERNEL_1, 0);
|
16
soc/arm/gigadevice/gd32f4xx/soc.h
Normal file
16
soc/arm/gigadevice/gd32f4xx/soc.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Teslabs Engineering S.L.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _SOC_ARM_GIGADEVICE_GD32F4XX_SOC_H_
|
||||
#define _SOC_ARM_GIGADEVICE_GD32F4XX_SOC_H_
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
#include <devicetree.h>
|
||||
#include <gd32f4xx.h>
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _SOC_ARM_GIGADEVICE_GD32F4XX_SOC_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue