forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soc: arm: gigadevice: add support for GD32F3X0 SoCs
Add support for GigaDevice GD32F3X0 series. Signed-off-by: HaiLong Yang <[email protected]>
- Loading branch information
Showing
9 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2021 BrainCo Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_include_directories(.) | ||
zephyr_sources(soc.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2021 BrainCo Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC | ||
default "gd32f350" | ||
|
||
config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) | ||
|
||
config NUM_IRQS | ||
default 68 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2021 BrainCo Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_SERIES_GD32F3X0 | ||
|
||
source "soc/arm/gigadevice/gd32f3x0/Kconfig.defconfig.gd32*" | ||
|
||
config SOC_SERIES | ||
default "gd32f3x0" | ||
|
||
endif # SOC_SERIES_GD32F3X0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2021 BrainCo Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_GD32F3X0 | ||
bool "GigaDevice GD32F3X0 series Cortex-M4F MCU" | ||
select ARM | ||
select CPU_HAS_FPU | ||
select CPU_CORTEX_M4 | ||
select SOC_FAMILY_GD32_ARM | ||
select GD32_HAS_AF_PINMUX | ||
help | ||
Enable support for GigaDevice GD32F3X0 MCU series |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2021 BrainCo Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice | ||
prompt "GigaDevice GD32F3X0 MCU Selection" | ||
depends on SOC_SERIES_GD32F3X0 | ||
|
||
config SOC_GD32F350 | ||
bool "gd32f350" | ||
endchoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright (c) 2021 BrainCo Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) Copyright (c) 2021 BrainCo Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <device.h> | ||
#include <init.h> | ||
#include <soc.h> | ||
|
||
static int gd32f3x0_init(const struct device *dev) | ||
{ | ||
uint32_t key; | ||
|
||
ARG_UNUSED(dev); | ||
|
||
key = irq_lock(); | ||
|
||
SystemInit(); | ||
NMI_INIT(); | ||
|
||
irq_unlock(key); | ||
|
||
return 0; | ||
} | ||
|
||
SYS_INIT(gd32f3x0_init, PRE_KERNEL_1, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2021 BrainCo Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef _SOC_ARM_GIGADEVICE_GD32F3X0_SOC_H_ | ||
#define _SOC_ARM_GIGADEVICE_GD32F3X0_SOC_H_ | ||
|
||
#ifndef _ASMLANGUAGE | ||
|
||
#include <devicetree.h> | ||
#include <gd32f3x0.h> | ||
|
||
#endif /* _ASMLANGUAGE */ | ||
|
||
#endif /* _SOC_ARM_GIGADEVICE_GD32F3X0_SOC_H_ */ |