Merge pull request #16719 from MrKevinWeiss/pr/kconfig/cc2538

cpu/cc2538: Add Kconfig support
This commit is contained in:
Kevin "Tristate Tom" Weiss 2021-09-09 08:21:09 +02:00 committed by GitHub
commit 4c6dc973c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 133 additions and 1 deletions

View File

@ -11,6 +11,7 @@
native
samr21-xpro
nucleo-f103rb
remote-revb
"}
: ${TEST_KCONFIG_ENFORCE_APP_GROUPS:="
@ -35,6 +36,8 @@ tests/periph_*
tests/prng_*
tests/xtimer_*
tests/ztimer_*
examples/hello-world
tests/ieee802154_hal
"}
: ${TEST_WITH_CONFIG_SUPPORTED:="examples/suit_update tests/driver_at86rf2xx_aes"}

View File

@ -50,3 +50,10 @@ config TEST_KCONFIG
This is used during the Kconfig migration to test the module dependency
modelling. Don't change the default value unless you know what you are
doing.
config DEVELHELP
bool "Development Help"
help
Set to enable code in RIOT that does safety checking which might not be
needed in a production environment but helps in the development
process.

View File

@ -16,3 +16,8 @@ config BOARD_COMMON_REMOTE
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
config MODULE_BOARDS_COMMON_REMOTE
bool
default y
depends on TEST_KCONFIG

View File

@ -11,5 +11,7 @@ config BOARD_FIREFLY
bool
default y
select BOARD_COMMON_REMOTE
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO
source "$(RIOTBOARD)/common/remote/Kconfig"

View File

@ -11,5 +11,7 @@ config BOARD_REMOTE_REVA
bool
default y
select BOARD_COMMON_REMOTE
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO
source "$(RIOTBOARD)/common/remote/Kconfig"

View File

@ -12,5 +12,7 @@ config BOARD_REMOTE_REVB
default y
select BOARD_COMMON_REMOTE
select HAS_ARDUINO
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO
source "$(RIOTBOARD)/common/remote/Kconfig"

View File

@ -21,6 +21,7 @@ config CPU_FAM_CC2538
select HAS_PERIPH_UART_NONBLOCKING
select HAS_PERIPH_RTT_OVERFLOW
select HAS_PERIPH_WDT
select HAVE_CC2538_RF
## CPU Models
config CPU_MODEL_CC2538NF53
@ -48,4 +49,9 @@ config CPU_MODEL
config CPU
default "cc2538" if CPU_FAM_CC2538
config MODULE_PERIPH_UART_NONBLOCKING
bool
depends on HAS_PERIPH_UART_NONBLOCKING
select MODULE_TSRB
source "$(RIOTCPU)/cortexm_common/Kconfig"

View File

@ -15,3 +15,9 @@ FEATURES_PROVIDED += periph_wdt
FEATURES_PROVIDED += cortexm_mpu
include $(RIOTCPU)/cortexm_common/Makefile.features
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(RIOTCPU)/cc2538/cc2538.config
endif

1
cpu/cc2538/cc2538.config Normal file
View File

@ -0,0 +1 @@
CONFIG_MODULE_PM_LAYERED=y

30
cpu/cc2538/radio/Kconfig Normal file
View File

@ -0,0 +1,30 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig MODULE_CC2538_RF
bool "CC2538 IEEE 802.15.4 radio"
depends on TEST_KCONFIG
depends on CPU_FAM_CC2538
if MODULE_CC2538_RF
config MODULE_CC2538_RF_OBS_SIG
bool "Output observation signals"
help
Say y to output different observation signals from the RF Core
to GPIO pins. These signals can be useful for debugging of
low-level protocols or control of external PA, LNA, or switches.
For more information check section 9.2.4 of the CC2538 User's Manual.
endif # MODULE_CC2538_RF
config HAVE_CC2538_RF
bool
select MODULE_CC2538_RF if MODULE_NETDEV_DEFAULT
help
Indicates that a cc2538 radio is present.

View File

@ -124,10 +124,20 @@ config HAS_CORTEXM_SVC
help
Indicates that ARM Cortex-M Supervisor Calls are available.
menu "Cortex-M"
depends on TEST_KCONFIG
depends on CPU_CORE_CORTEX_M
config MODULE_CORTEXM_FPU
bool "Cortex-M Floating Point Unit (FPU) support"
default y
depends on HAS_CORTEXM_FPU
depends on TEST_KCONFIG
config MODULE_MPU_STACK_GUARD
bool "Memory Protection Unit (MPU) stack guard"
default y if DEVELHELP
depends on HAS_CORTEXM_MPU
endmenu # Cortex-M
rsource "periph/Kconfig"

View File

@ -6,6 +6,9 @@
menu "Drivers"
config MODULE_NETDEV_DEFAULT
bool "Enable default network devices on the platform"
rsource "saul/Kconfig"
menu "Actuator Device Drivers"

View File

@ -9,6 +9,7 @@ rsource "at86rf215/Kconfig"
rsource "ata8520e/Kconfig"
rsource "can_trx/Kconfig"
rsource "cc110x/Kconfig"
source "$(RIOTCPU)/cc2538/radio/Kconfig"
rsource "dose/Kconfig"
rsource "mcp2515/Kconfig"
rsource "mrf24j40/Kconfig"

View File

@ -112,6 +112,11 @@ ifeq (1,$(TEST_KCONFIG))
SHOULD_RUN_KCONFIG := 1
endif
# Expose DEVELHELP to kconfig
ifeq (1,$(DEVELHELP))
RIOT_CONFIG_DEVELHELP ?= y
endif
# export variable to make it visible in other Makefiles
export SHOULD_RUN_KCONFIG

View File

@ -5,6 +5,7 @@
# directory for more details.
rsource "csma_sender/Kconfig"
rsource "eui_provider/Kconfig"
rsource "ieee802154/Kconfig"
rsource "l2filter/Kconfig"
rsource "Kconfig.lorawan"

View File

@ -0,0 +1,11 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_EUI_PROVIDER
bool "IEEE EUI-48/64 provider"
depends on TEST_KCONFIG
select MODULE_LUID

View File

@ -4,6 +4,27 @@
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
menuconfig MODULE_IEEE802154
bool "IEEE 802.15.4 support"
depends on TEST_KCONFIG
if MODULE_IEEE802154
config MODULE_IEEE802154_SECURITY
bool "IEEE 802.15.4 security"
select MODULE_CRYPTO
select MODULE_CIPHER_MODES
help
IEEE 802.15.4 security interface
config MODULE_IEEE802154_SUBMAC
bool "IEEE 802.15.4 submac"
select MODULE_XTIMER
help
This module defines a common layer for handling the lower part of the IEEE 802.15.4 MAC layer.
endif # MODULE_IEEE802154
menuconfig KCONFIG_USEMODULE_IEEE802154
bool "Configure IEEE802.15.4"
depends on USEMODULE_IEEE802154

View File

@ -0,0 +1,15 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_OD=y
CONFIG_MODULE_LUID=y
CONFIG_MODULE_IEEE802154=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_PS=y
CONFIG_MODULE_EVENT=y
CONFIG_MODULE_EVENT_THREAD=y
CONFIG_MODULE_EVENT_THREAD_HIGHEST=y
CONFIG_MODULE_EVENT_CALLBACK=y
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_NETDEV_DEFAULT=y

View File

@ -1,6 +1,7 @@
BOARD_INSUFFICIENT_MEMORY := \
arduino-duemilanove \
arduino-leonardo \
arduino-mega2560 \
arduino-nano \
arduino-uno \
atmega328p \