1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #14626 from leandrolanzieri/pr/kconfig/test_modules_kconfig

kconfig: introduce migration test in CI
This commit is contained in:
Cenk Gündoğan 2020-08-13 14:11:00 +02:00 committed by GitHub
commit f64511ddb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 664 additions and 8 deletions

View File

@ -2,6 +2,8 @@
: ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"}
: ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"}
# we can't use '-' in the variable names, convert them to '_' to add new boards
: ${TEST_KCONFIG_samr21_xpro:="examples/hello-world"}
export RIOT_CI_BUILD=1
export STATIC_TESTS=${STATIC_TESTS:-1}
@ -32,6 +34,12 @@ RUN_TESTS=${RUN_TESTS:-${NIGHTLY}}
DWQ_ENV="-E BOARDS -E APPS -E NIGHTLY -E RUN_TESTS -E ENABLE_TEST_CACHE
-E TEST_HASH -E CI_PULL_LABELS"
get_kconfig_test_apps() {
case "$1" in
"samr21_xpro") echo "${TEST_KCONFIG_samr21_xpro}" ;;
esac
}
check_label() {
local label="${1}"
[ -z "${CI_PULL_LABELS}" ] && return 1
@ -236,6 +244,34 @@ compile() {
make -C${appdir} clean all test-input-hash -j${JOBS:-4}
RES=$?
test_hash=$(test_hash_calc "$BINDIR")
# We compile a second time with Kconfig based dependency
# resolution for regression purposes. $TEST_KCONFIG contains a
# list of board-application tuples that are currently modeled to
# run with Kconfig
if [ $RES -eq 0 ]; then
# we can't use '-' in variable names
_board=$(echo ${board} | tr '-' '_')
for app in $(get_kconfig_test_apps "${_board}")
do
if [ "${appdir}" = "${app}" ]; then
BOARD=$board make -C${appdir} clean
CCACHE_BASEDIR="$(pwd)" BOARD=$board TOOLCHAIN=$toolchain RIOT_CI_BUILD=1 TEST_KCONFIG=1 \
make -C${appdir} all test-input-hash -j${JOBS:-4}
RES=$?
if [ $RES -eq 0 ]; then
new_test_hash=$(test_hash_calc "$BINDIR")
if [ ${new_test_hash} != ${test_hash} ]; then
echo "Hashes of binaries mismatch for ${app}";
RES=1
fi
fi
fi
done
fi
# run tests
if [ $RES -eq 0 ]; then
if [ $RUN_TESTS -eq 1 -o "$board" = "native" ]; then
@ -244,7 +280,6 @@ compile() {
BOARD=$board make -C${appdir} test
RES=$?
elif is_in_list "$board" "$TEST_BOARDS_AVAILABLE"; then
test_hash=$(test_hash_calc "$BINDIR")
echo "-- test_hash=$test_hash"
if test_cache_get $test_hash; then
echo "-- skipping test due to positive cache hit"

View File

@ -25,9 +25,18 @@ rsource "$(RIOTCPU)/Kconfig"
# The application may declare new symbols as well
osource "$(APPDIR)/Kconfig"
rsource "core/Kconfig"
rsource "drivers/Kconfig"
rsource "sys/Kconfig"
rsource "pkg/Kconfig"
comment "RIOT is in a migration phase."
comment "Some configuration options may not be here. Use CFLAGS instead."
config TEST_KCONFIG
bool
default y if '$(TEST_KCONFIG)' = '1'
help
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.

View File

@ -212,8 +212,10 @@ include $(RIOTMAKE)/scan-build.inc.mk
export RIOTBUILD_CONFIG_HEADER_C = $(BINDIR)/riotbuild/riotbuild.h
# Include Kconfig functionalities
include $(RIOTMAKE)/kconfig.mk
# When testing Kconfig's module modelling we need to run Kconfig
ifeq (1,$(TEST_KCONFIG))
SHOULD_RUN_KCONFIG = 1
endif
ifeq ($(OS),Darwin)
OPEN := open
@ -361,11 +363,21 @@ include $(RIOTBASE)/Makefile.features
include $(RIOTMAKE)/pseudomodules.inc.mk
include $(RIOTMAKE)/defaultmodules.inc.mk
# handle removal of default modules
USEMODULE += $(filter-out $(DISABLE_MODULE), $(DEFAULT_MODULE))
# Include Kconfig functionalities
include $(RIOTMAKE)/kconfig.mk
# process dependencies
include $(RIOTMAKE)/dependency_resolution.inc.mk
# For testing, use TEST_KCONFIG as a switch between Makefile.dep and Kconfig
ifeq (1,$(TEST_KCONFIG))
$(info === [ATTENTION] Testing Kconfig dependency modelling ===)
KCONFIG_MODULES := $(call lowercase,$(patsubst CONFIG_MOD_%,%,$(filter CONFIG_MOD_%,$(.VARIABLES))))
USEMODULE := $(KCONFIG_MODULES)
else
# handle removal of default modules
USEMODULE += $(filter-out $(DISABLE_MODULE), $(DEFAULT_MODULE))
# process dependencies
include $(RIOTMAKE)/dependency_resolution.inc.mk
endif
# Include Board and CPU configuration
INCLUDES += $(addprefix -I,$(wildcard $(BOARDDIR)/include))

View File

@ -8,3 +8,10 @@ config BOARD
string
help
Name of the currently selected board.
config MOD_BOARD
bool
default y
depends on TEST_KCONFIG
help
Module which holds all board-specific files.

48
core/Kconfig Normal file
View File

@ -0,0 +1,48 @@
# Copyright (c) 2020 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 MOD_CORE
bool "RIOT Core"
default y
depends on TEST_KCONFIG
help
RIOT's core module. Only change this if you know what you are doing. If
unsure, say Y.
if MOD_CORE
config MOD_CORE_IDLE_THREAD
bool
prompt "Use Idle thread" if HAS_NO_IDLE_THREAD
default y if !HAS_NO_IDLE_THREAD
help
Select y to include the Idle thread. This is mandatory for some CPUs.
config MOD_CORE_INIT
bool "Kernel initialization module"
default y
config MOD_CORE_MBOX
bool "Kernel message box module"
config MOD_CORE_MSG
bool "Kernel messaging module"
default y
config MOD_CORE_MSG_BUS
bool "Messaging Bus module"
help
Messaging Bus API for inter process message broadcast.
config MOD_CORE_PANIC
bool "Kernel crash handling module"
default y
config MOD_CORE_THREAD_FLAGS
bool "Thread flags"
endif # MOD_CORE

View File

@ -51,3 +51,16 @@ config CPU_ARCH
string
help
Architecture of the currently selected CPU.
config MOD_CPU
bool
default y
depends on TEST_KCONFIG
help
Module which holds all CPU-specific files.
config MOD_PERIPH
bool
depends on TEST_KCONFIG
help
CPU peripheral implementations module.

View File

@ -4,6 +4,14 @@
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config MOD_CORTEXM_COMMON
bool
default y if CPU_CORE_CORTEX_M
depends on TEST_KCONFIG
select MOD_PERIPH
help
Common code for Cortex-M cores.
config CPU_ARCH_ARMV6M
bool
select HAS_ARCH_ARM
@ -103,3 +111,11 @@ config HAS_CORTEXM_SVC
bool
help
Indicates that ARM Cortex-M Supervisor Calls are available.
config MOD_CORTEXM_FPU
bool "Cortex-M Floating Point Unit (FPU) support"
default y
depends on HAS_CORTEXM_FPU
depends on TEST_KCONFIG
rsource "periph/Kconfig"

View File

@ -36,3 +36,5 @@ endif
ifneq (,$(filter armv7m armv8m,$(CPU_ARCH)))
FEATURES_PROVIDED += no_idle_thread
endif
KCONFIG_ADD_CONFIG += $(RIOTCPU)/cortexm_common/cortexm_common.config

View File

@ -0,0 +1,5 @@
# all cortex MCU's use newlib as libc
CONFIG_MOD_NEWLIB=y
# use the nano-specs of Newlib when available
CONFIG_MOD_NEWLIB_NANO=y

View File

@ -0,0 +1,13 @@
# Copyright (c) 2020 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 MOD_CORTEXM_COMMON_PERIPH
bool
default y if CPU_CORE_CORTEX_M
depends on TEST_KCONFIG
help
Common code for Cortex-M core peripherals.

View File

@ -15,4 +15,9 @@ FEATURES_PROVIDED += periph_wdt periph_wdt_cb periph_wdt_warning_period
FEATURES_CONFLICT += periph_rtc:periph_rtt
FEATURES_CONFLICT_MSG += "The RTC and RTT map to the same hardware peripheral."
KCONFIG_ADD_CONFIG += $(RIOTCPU)/cortexm_common/cortexm_common.config
-include $(RIOTCPU)/cortexm_common/Makefile.features
# add sam0 configurations after including cortexm_common so sam0 takes precendence
KCONFIG_ADD_CONFIG += $(RIOTCPU)/sam0_common/sam0_common.config

View File

@ -7,3 +7,10 @@
config WDT_WARNING_PERIOD
depends on HAS_PERIPH_WDT_WARNING_PERIOD && KCONFIG_MODULE_PERIPH_WDT
default 1
config MOD_SAM0_COMMON_PERIPH
bool
default y
depends on TEST_KCONFIG
help
SAM0 common peripheral code.

View File

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

View File

@ -24,3 +24,163 @@ config HAS_PERIPH_WDT_WARNING_PERIOD
bool
help
Indicates that a CPU provides a warning period configuration option.
menu "Peripheral drivers"
depends on TEST_KCONFIG
config MOD_PERIPH_COMMON
bool
help
Common peripherals module.
config MOD_PERIPH_INIT
bool "Peripherals auto-initialization"
default y
help
Auto-initialization of all used peripherals.
# Common peripheral modules and auto-init
config MOD_PERIPH_ADC
bool "ADC peripheral driver"
depends on HAS_PERIPH_ADC
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_ADC
bool "Auto initialize ADC peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_ADC
config MOD_PERIPH_CPUID
bool "CPU unique ID"
depends on HAS_PERIPH_CPUID
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_CPUID
bool "Auto initialize CPU unique ID driver"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_CPUID
config MOD_PERIPH_DAC
bool "DAC peripheral driver"
depends on HAS_PERIPH_DAC
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_DAC
bool "Auto initialize DAC peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_DAC
config MOD_PERIPH_DMA
bool "DMA peripheral driver"
depends on HAS_PERIPH_DMA
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_DMA
bool "Auto initialize DMA peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_DMA
config MOD_PERIPH_EEPROM
bool "EEPROM peripheral driver"
depends on HAS_PERIPH_EEPROM
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_EEPROM
bool "Auto initialize EEPROM peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_EEPROM
rsource "Kconfig.flashpage"
rsource "Kconfig.gpio"
config MOD_PERIPH_HWRNG
bool "HWRNG peripheral driver"
depends on HAS_PERIPH_HWRNG
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_HWRNG
bool "Auto initialize HWRNG peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_HWRNG
rsource "Kconfig.i2c"
config MOD_PERIPH_PWM
bool "PWM peripheral driver"
depends on HAS_PERIPH_PWM
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_PWM
bool "Auto initialize PWM peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_PWM
config MOD_PERIPH_PM
bool "Power Management (PM) peripheral driver"
default y
depends on HAS_PERIPH_PM
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_PM
bool "Auto initialize Power Management (PM) peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_PM
config MOD_PERIPH_QDEC
bool "Quadrature Decoder (QDEC) peripheral driver"
depends on HAS_PERIPH_QDEC
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_QDEC
bool "Auto initialize Quadrature Decoder (QDEC) peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_QDEC
config MOD_PERIPH_RTC
bool "RTC peripheral driver"
depends on HAS_PERIPH_RTC
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_RTC
bool "Auto initialize RTC peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_RTC
config MOD_PERIPH_RTT
bool "RTT peripheral driver"
depends on HAS_PERIPH_RTT
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_RTT
bool "Auto initialize RTT peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_RTT
rsource "Kconfig.spi"
rsource "Kconfig.timer"
rsource "Kconfig.uart"
config MOD_PERIPH_USBDEV
bool "USBDEV peripheral driver"
depends on HAS_PERIPH_USBDEV
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_USBDEV
bool "Auto initialize USBDEV peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_USBDEV
menuconfig MOD_PERIPH_WDT
bool "Watchdog Timer peripheral driver"
depends on HAS_PERIPH_WDT
select MOD_PERIPH_COMMON
config MOD_PERIPH_INIT_WDT
bool "Auto initialize the Watchdog Timer peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_WDT
endmenu # Peripheral drivers

View File

@ -0,0 +1,40 @@
# Copyright (c) 2020 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 MOD_PERIPH_FLASHPAGE
bool "Flashpage peripheral driver"
depends on HAS_PERIPH_FLASHPAGE
select MOD_PERIPH_COMMON
# TODO: the 'init' modules are actually just artifacts from the way
# periph_init_% modules are handled in Makefile. We need to define them to keep
# the list the same for now. We should be able to remove them later on.
config MOD_PERIPH_INIT_FLASHPAGE
bool "Auto initialize Flashpage peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_FLASHPAGE
config MOD_PERIPH_FLASHPAGE_RAW
bool "Raw writing support"
depends on HAS_PERIPH_FLASHPAGE_RAW
depends on MOD_PERIPH_FLASHPAGE
config MOD_PERIPH_INIT_FLASHPAGE_RAW
bool "Auto initialize Flashpage raw"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_FLASHPAGE_RAW
config MOD_PERIPH_FLASHPAGE_RWEE
bool "Read while Write support"
depends on HAS_PERIPH_FLASHPAGE_RWEE
depends on MOD_PERIPH_FLASHPAGE
config MOD_PERIPH_INIT_FLASHPAGE_RWEE
bool "Auto initialize Flashpage RWEE"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_FLASHPAGE_RWEE

View File

@ -0,0 +1,34 @@
# Copyright (c) 2020 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 MOD_PERIPH_GPIO
bool "GPIO peripheral driver"
default y
depends on HAS_PERIPH_GPIO
select MOD_PERIPH_COMMON
if MOD_PERIPH_GPIO
config MOD_PERIPH_INIT_GPIO
bool "Auto initialize GPIO peripheral"
default y if MOD_PERIPH_INIT
config MOD_PERIPH_GPIO_IRQ
bool "GPIO interrupt peripheral driver"
depends on HAS_PERIPH_GPIO_IRQ
select MOD_PERIPH_COMMON
# TODO: this module is actually just an artifact from the way periph_init_%
# modules are handled in Makefile. We need to define it to keep the list the
# same for now. We should be able to remove it later on.
config MOD_PERIPH_INIT_GPIO_IRQ
bool "Auto initialize GPIO interrupt peripheral"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_GPIO_IRQ
endif # MOD_PERIPH_GPIO

View File

@ -0,0 +1,32 @@
# Copyright (c) 2020 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 MOD_PERIPH_I2C
bool "I2C peripheral driver"
depends on HAS_PERIPH_I2C
select MOD_PERIPH_COMMON
if MOD_PERIPH_I2C
config MOD_PERIPH_INIT_I2C
bool "Auto initialize I2C peripheral"
default y if MOD_PERIPH_INIT
config MOD_PERIPH_I2C_RECONFIGURE
bool "Pin reconfiguration support"
depends on HAS_PERIPH_I2C_RECONFIGURE
# TODO: this module is actually just an artifact from the way periph_init_%
# modules are handled in Makefile. We need to define it to keep the list the
# same for now. We should be able to remove it later on.
config MOD_PERIPH_INIT_I2C_RECONFIGURE
bool "Auto initialize I2C pin reconfiguration support"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_I2C_RECONFIGURE
endif # MOD_PERIPH_I2C

View File

@ -0,0 +1,32 @@
# Copyright (c) 2020 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 MOD_PERIPH_SPI
bool "SPI peripheral driver"
depends on HAS_PERIPH_SPI
select MOD_PERIPH_COMMON
if MOD_PERIPH_SPI
config MOD_PERIPH_INIT_SPI
bool "Auto initialize SPI peripheral"
default y if MOD_PERIPH_INIT
config MOD_PERIPH_SPI_RECONFIGURE
bool "Pin reconfiguration support"
depends on HAS_PERIPH_SPI_RECONFIGURE
# TODO: this module is actually just an artifact from the way periph_init_%
# modules are handled in Makefile. We need to define it to keep the list the
# same for now. We should be able to remove it later on.
config MOD_PERIPH_INIT_SPI_RECONFIGURE
bool "Auto initialize SPI pin reconfiguration support"
default y if MOD_PERIPH_INIT
depends on MOD_PERIPH_SPI_RECONFIGURE
endif # MOD_PERIPH_SPI

View File

@ -0,0 +1,32 @@
# Copyright (c) 2020 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 MOD_PERIPH_TIMER
bool "Timer peripheral driver"
depends on HAS_PERIPH_TIMER
select MOD_PERIPH_COMMON
if MOD_PERIPH_TIMER
# TODO: the 'init' modules are actually just artifacts from the way
# periph_init_% modules are handled in Makefile. We need to define them to keep
# the list the same for now. We should be able to remove them later on.
config MOD_PERIPH_INIT_TIMER
bool "Auto initialize Timer peripheral"
default y if MOD_PERIPH_INIT
config MOD_PERIPH_TIMER_PERIODIC
bool "Periodic timeout support"
depends on HAS_PERIPH_TIMER_PERIODIC
config MOD_PERIPH_INIT_TIMER_PERIODIC
bool
depends on MOD_PERIPH_TIMER_PERIODIC
default y if MOD_PERIPH_INIT
endif # MOD_PERIPH_TIMER

View File

@ -0,0 +1,41 @@
# Copyright (c) 2020 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 MOD_PERIPH_UART
bool "UART peripheral driver"
depends on HAS_PERIPH_UART
select MOD_PERIPH_COMMON
if MOD_PERIPH_UART
# TODO: the 'init' modules are actually just artifacts from the way
# periph_init_% modules are handled in Makefile. We need to define them to keep
# the list the same for now. We should be able to remove them later on.
config MOD_PERIPH_INIT_UART
bool "Auto initialize UART peripheral"
default y if MOD_PERIPH_INIT
config MOD_PERIPH_UART_MODECFG
bool "Mode configuration support"
depends on HAS_PERIPH_UART_MODECFG
config MOD_PERIPH_UART_NONBLOCKING
bool "Non-blocking support"
depends on HAS_PERIPH_UART_NONBLOCKING
config MOD_PERIPH_INIT_UART_MODECFG
bool
depends on MOD_PERIPH_UART_MODECFG
default y if MOD_PERIPH_INIT
config MOD_PERIPH_INIT_UART_NONBLOCKING
bool
depends on MOD_PERIPH_UART_NONBLOCKING
default y if MOD_PERIPH_INIT
endif # MOD_PERIPH_UART

View File

@ -50,6 +50,13 @@ KCONFIG_OUT_DEP = $(KCONFIG_OUT_CONFIG).d
# Add configurations to merge, in ascendent priority (i.e. a file overrides the
# previous ones).
ifeq (1, $(TEST_KCONFIG))
# KCONFIG_ADD_CONFIG holds a list of .config files that are merged for the
# initial configuration. This allows to split configurations in common files
# and share them among boards or cpus.
MERGE_SOURCES += $(KCONFIG_ADD_CONFIG)
endif
MERGE_SOURCES += $(wildcard $(KCONFIG_APP_CONFIG))
MERGE_SOURCES += $(wildcard $(KCONFIG_USER_CONFIG))
@ -98,6 +105,12 @@ menuconfig: $(MENUCONFIG) $(KCONFIG_OUT_CONFIG)
$(Q)KCONFIG_CONFIG=$(KCONFIG_OUT_CONFIG) $(MENUCONFIG) $(KCONFIG)
$(MAKE) $(KCONFIG_GENERATED_AUTOCONF_HEADER_C)
# Variable used to conditionally depend on KCONFIG_GENERATED_DEPDENDENCIES
# When testing Kconfig module modelling this file is not needed
ifneq (1, $(TEST_KCONFIG))
GENERATED_DEPENDENCIES_DEP = $(KCONFIG_GENERATED_DEPENDENCIES)
endif
# These rules are not included when only calling `make clean` in
# order to keep the $(BINDIR) directory clean.
ifneq (clean, $(MAKECMDGOALS))
@ -106,6 +119,7 @@ ifneq (clean, $(MAKECMDGOALS))
# defining symbols like 'MODULE_<MODULE_NAME>' or PKG_<PACKAGE_NAME> which
# default to 'y'. Then, every module and package Kconfig menu will depend on
# that symbol being set to show its options.
# Do nothing when testing Kconfig module dependency modelling.
$(KCONFIG_GENERATED_DEPENDENCIES): FORCE | $(GENERATED_DIR)
$(Q)printf "%s " $(USEMODULE_W_PREFIX) $(USEPKG_W_PREFIX) \
| awk 'BEGIN {RS=" "}{ gsub("-", "_", $$0); \
@ -115,7 +129,7 @@ $(KCONFIG_GENERATED_DEPENDENCIES): FORCE | $(GENERATED_DIR)
# Generates a .config file by merging multiple sources specified in
# MERGE_SOURCES. This will also generate KCONFIG_OUT_DEP with the list of used
# Kconfig files.
$(KCONFIG_OUT_CONFIG): $(KCONFIG_GENERATED_DEPENDENCIES) $(GENCONFIG) $(MERGE_SOURCES) | $(GENERATED_DIR)
$(KCONFIG_OUT_CONFIG): $(GENERATED_DEPENDENCIES_DEP) $(GENCONFIG) $(MERGE_SOURCES) | $(GENERATED_DIR)
$(Q) $(GENCONFIG) \
--config-out=$(KCONFIG_OUT_CONFIG) \
--file-list $(KCONFIG_OUT_DEP) \

View File

@ -118,3 +118,4 @@ export LAZYSPONGE_FLAGS # Parameters supplied to LAZYSPONGE.
export AFL_FLAGS # Additional command-line flags passed to afl during fuzzing.
# LOG_LEVEL # Logging level as integer (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3)
# KCONFIG_ADD_CONFIG # List of .config files to be merged used by Boards and CPUs. See kconfig.mk

View File

@ -6,7 +6,18 @@
#
menu "System"
rsource "auto_init/Kconfig"
rsource "net/Kconfig"
rsource "Kconfig.newlib"
rsource "Kconfig.stdio"
rsource "pm_layered/Kconfig"
rsource "usb/Kconfig"
config MOD_SYS
bool
default y
depends on TEST_KCONFIG
help
System module, it serves to pull in all the rest of system modules.
endmenu # System

30
sys/Kconfig.newlib Normal file
View File

@ -0,0 +1,30 @@
# Copyright (c) 2020 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 MOD_NEWLIB
bool "NewLib"
depends on TEST_KCONFIG
if MOD_NEWLIB
config MOD_NEWLIB_NANO
bool "NewLib Nano"
config MOD_NEWLIB_GNU_SOURCE
bool "NewLib GNU source"
config MOD_NEWLIB_SYSCALLS_DEFAULT
bool "NewLib Syscalls default implementation"
default y
depends on !HAVE_CUSTOM_NEWLIB_SYSCALLS
endif # MOD_NEWLIB
config HAVE_CUSTOM_NEWLIB_SYSCALLS
bool
help
Indicates that a custom newlib syscalls implementation is present.

30
sys/Kconfig.stdio Normal file
View File

@ -0,0 +1,30 @@
# Copyright (c) 2020 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.
#
menu "Standard Input/Ouput (STDIO)"
depends on TEST_KCONFIG
choice
bool "STDIO implementation"
default MOD_STDIO_UART
# TODO: Add MOD_STDIO_CDC_ACM, MOD_STDIO_RTT, MOD_SLIPDEV_STDIO,
# MOD_STDIO_NATIVE and MOD_STDIO_ETHOS
config MOD_STDIO_NULL
bool "Null"
help
Empty implementation.
config MOD_STDIO_UART
bool "UART"
depends on HAS_PERIPH_UART
select MOD_PERIPH_UART
endchoice
endmenu # Standard Input/Ouput (STDIO)

15
sys/auto_init/Kconfig Normal file
View File

@ -0,0 +1,15 @@
# Copyright (c) 2020 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 MOD_AUTO_INIT
bool "Auto-initialization system"
default y
depends on TEST_KCONFIG
help
Auto-initialization module. Can be used to initialize modules (such as
drivers, or network interfaces) on start-up automatically. Disable if a
more custom initialization is required. If unsure, say Y.

11
sys/pm_layered/Kconfig Normal file
View File

@ -0,0 +1,11 @@
# Copyright (c) 2020 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 MOD_PM_LAYERED
bool "Platform-independent Power Management"
depends on MOD_PERIPH_PM
depends on TEST_KCONFIG