-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ARM: Introduce gigadevice gd32f403 #38661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
carlescufi
merged 7 commits into
zephyrproject-rtos:main
from
nandojve:gd32_zephyr_arm_minimal
Oct 28, 2021
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
49f4eaa
modules: Add gigadevice hal module
nandojve 10f6599
dts: bindings: vendor-prefixes: Add gigadevice prefix
nandojve aa1524e
dts: arm: Introduce gigadevice soc bindings
nandojve 975e92e
soc: arm: Introduce gigadevice soc
nandojve 3c6bb1a
drivers: serial: Add gd32 uart driver
nandojve 094434f
boards: arm: Introduce gd32f403z_eval board
nandojve ddb2422
CODEOWNERS: Add nandojve for gigadevices
nandojve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| add_subdirectory(${SOC_SERIES}) |
This file contains hidden or 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,22 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config SOC_FAMILY_GD32 | ||
| bool | ||
| select HAS_GD32_HAL | ||
| select BUILD_OUTPUT_HEX | ||
|
|
||
| config SOC_FAMILY | ||
| string | ||
| default "gigadevice" | ||
| depends on SOC_FAMILY_GD32 | ||
|
|
||
| config SOC_FAMILY_GD32_ARM | ||
| bool | ||
| select SOC_FAMILY_GD32 | ||
|
|
||
| if SOC_FAMILY_GD32_ARM | ||
|
|
||
| source "soc/arm/gigadevice/*/Kconfig.soc" | ||
|
|
||
| endif # SOC_FAMILY_GD32_ARM | ||
This file contains hidden or 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,4 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| source "soc/arm/gigadevice/*/Kconfig.defconfig.series" |
This file contains hidden or 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,4 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| source "soc/arm/gigadevice/*/Kconfig.series" |
This file contains hidden or 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, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| zephyr_include_directories(.) | ||
| zephyr_sources(soc.c) |
This file contains hidden or 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,21 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if SOC_GD32F403R || SOC_GD32F403V || SOC_GD32F403Z | ||
|
|
||
| config SOC | ||
| default "gd32f403r" if SOC_GD32F403R | ||
| default "gd32f403v" if SOC_GD32F403V | ||
| default "gd32f403z" if SOC_GD32F403Z | ||
|
|
||
| config SOC_SERIES_GD32F403 | ||
| bool | ||
| default y | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
| default 168000000 | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| config NUM_IRQS | ||
| default 68 | ||
|
|
||
| endif | ||
This file contains hidden or 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, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if SOC_SERIES_GD32F4 | ||
|
|
||
| source "soc/arm/gigadevice/gd32f4/Kconfig.defconfig.gd32f4*" | ||
|
|
||
| config SOC_SERIES | ||
| default "gd32f4" | ||
|
|
||
| endif # SOC_SERIES_GD32F4 |
This file contains hidden or 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,14 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config SOC_SERIES_GD32F4 | ||
| bool "GigaDevice GD32F4xxx series Cortex-M4F MCU" | ||
| select ARM | ||
| select CPU_HAS_ARM_MPU | ||
| select CPU_HAS_FPU | ||
| select CPU_CORTEX_M4 | ||
| select CPU_CORTEX_M_HAS_SYSTICK | ||
| select CPU_CORTEX_M_HAS_VTOR | ||
| select SOC_FAMILY_GD32_ARM | ||
| help | ||
| Enable support for GigaDevice GD32F4xxx MCU series |
This file contains hidden or 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,17 @@ | ||
| # Copyright (c) 2021, ATL Electronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| choice | ||
| prompt "GigaDevice GD32F4xx MCU Selection" | ||
| depends on SOC_SERIES_GD32F4 | ||
|
|
||
| config SOC_GD32F403R | ||
| bool "gd32f403r" | ||
|
|
||
| config SOC_GD32F403V | ||
| bool "gd32f403v" | ||
|
|
||
| config SOC_GD32F403Z | ||
| bool "gd32f403z" | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| endchoice | ||
This file contains hidden or 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,9 @@ | ||
| /* linker.ld - Linker command/script file */ | ||
|
|
||
| /* | ||
| * Copyright (c) 2014 Wind River Systems, Inc. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <arch/arm/aarch32/cortex_m/scripts/linker.ld> |
This file contains hidden or 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,41 @@ | ||
| /* | ||
| * Copyright (c) 2021, ATL Electronics | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /** | ||
| * @file | ||
| * @brief GD32 MCU series initialization code | ||
| * | ||
| * This module provides routines to initialize and support board-level | ||
| * hardware for the GigaDevice GD32 SoC. | ||
| */ | ||
|
|
||
| #include <device.h> | ||
| #include <init.h> | ||
|
|
||
| /** | ||
| * @brief Perform basic hardware initialization at boot. | ||
| * | ||
| * This needs to be run from the very beginning. | ||
| * So the init priority has to be 0 (zero). | ||
| * | ||
| * @return 0 | ||
| */ | ||
| static int gigadevice_gd32_soc_init(const struct device *arg) | ||
| { | ||
| uint32_t key; | ||
|
|
||
| ARG_UNUSED(arg); | ||
|
|
||
| key = irq_lock(); | ||
|
|
||
| SystemInit(); | ||
| NMI_INIT(); | ||
|
|
||
| irq_unlock(key); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| SYS_INIT(gigadevice_gd32_soc_init, PRE_KERNEL_1, 0); |
This file contains hidden or 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,31 @@ | ||
| /* | ||
| * Copyright (c) 2021, ATL Electronics | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /** | ||
| * @file | ||
| * @brief Board configuration macros | ||
| * | ||
| * This header file is used to specify and describe board-level aspects | ||
| */ | ||
|
|
||
| #ifndef _SOC__H_ | ||
| #define _SOC__H_ | ||
|
|
||
| #include <sys/util.h> | ||
|
|
||
| #ifndef _ASMLANGUAGE | ||
|
|
||
| /* Add include for DTS generated information */ | ||
| #include <devicetree.h> | ||
|
|
||
| #if defined(CONFIG_SOC_SERIES_GD32F403) | ||
| #include <gd32f403.h> | ||
| #else | ||
| #error Library does not support the specified device. | ||
| #endif | ||
|
|
||
| #endif /* !_ASMLANGUAGE */ | ||
|
|
||
| #endif /* _SOC__H_ */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.