Merge pull request #15421 from leandrolanzieri/pr/kconfig/native/hello_world
Kconfig: add modules to test on native
This commit is contained in:
commit
e322bfbd47
4
.murdock
4
.murdock
@ -3,6 +3,7 @@
|
|||||||
: ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"}
|
: ${TEST_BOARDS_AVAILABLE:="esp32-wroom-32 samr21-xpro"}
|
||||||
: ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"}
|
: ${TEST_BOARDS_LLVM_COMPILE:="iotlab-m3 native nrf52dk mulle nucleo-f401re samr21-xpro slstk3402a"}
|
||||||
: ${TEST_KCONFIG_samr21_xpro:="examples/hello-world tests/periph_*"}
|
: ${TEST_KCONFIG_samr21_xpro:="examples/hello-world tests/periph_*"}
|
||||||
|
: ${TEST_KCONFIG_native:="examples/hello-world tests/periph_*"}
|
||||||
|
|
||||||
export RIOT_CI_BUILD=1
|
export RIOT_CI_BUILD=1
|
||||||
export CC_NOCOLOR=1
|
export CC_NOCOLOR=1
|
||||||
@ -38,6 +39,9 @@ get_kconfig_test_apps() {
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
"samr21-xpro") echo "${TEST_KCONFIG_samr21_xpro}" ;;
|
"samr21-xpro") echo "${TEST_KCONFIG_samr21_xpro}" ;;
|
||||||
esac
|
esac
|
||||||
|
case "$1" in
|
||||||
|
"native") echo "${TEST_KCONFIG_native}" ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
check_label() {
|
check_label() {
|
||||||
|
|||||||
@ -24,3 +24,5 @@ config BOARD_NATIVE
|
|||||||
# Various other features (if any)
|
# Various other features (if any)
|
||||||
select HAS_ETHERNET
|
select HAS_ETHERNET
|
||||||
select HAS_MOTOR_DRIVER
|
select HAS_MOTOR_DRIVER
|
||||||
|
|
||||||
|
rsource "drivers/Kconfig"
|
||||||
|
|||||||
@ -19,4 +19,4 @@ ifneq (,$(filter socket_zep,$(USEMODULE)))
|
|||||||
USEMODULE += random
|
USEMODULE += random
|
||||||
endif
|
endif
|
||||||
|
|
||||||
USEMODULE += native-drivers
|
USEMODULE += native_drivers
|
||||||
|
|||||||
14
boards/native/drivers/Kconfig
Normal file
14
boards/native/drivers/Kconfig
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# 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 MODULE_NATIVE_DRIVERS
|
||||||
|
bool
|
||||||
|
depends on BOARD_NATIVE
|
||||||
|
depends on TEST_KCONFIG
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Drivers for Native board.
|
||||||
@ -1,3 +1,3 @@
|
|||||||
MODULE = native-drivers
|
MODULE = native_drivers
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.base
|
include $(RIOTBASE)/Makefile.base
|
||||||
|
|||||||
@ -19,6 +19,9 @@ config CPU_ARCH_NATIVE
|
|||||||
select HAS_PERIPH_PWM
|
select HAS_PERIPH_PWM
|
||||||
select HAS_SSP
|
select HAS_SSP
|
||||||
|
|
||||||
|
# needed modules
|
||||||
|
select MODULE_PERIPH if TEST_KCONFIG
|
||||||
|
|
||||||
config CPU_CORE_NATIVE
|
config CPU_CORE_NATIVE
|
||||||
bool
|
bool
|
||||||
select CPU_ARCH_NATIVE
|
select CPU_ARCH_NATIVE
|
||||||
@ -74,3 +77,12 @@ config CPU_MODEL
|
|||||||
|
|
||||||
config CPU
|
config CPU
|
||||||
default "native" if CPU_MODEL_NATIVE
|
default "native" if CPU_MODEL_NATIVE
|
||||||
|
|
||||||
|
menu "Native modules"
|
||||||
|
depends on CPU_ARCH_NATIVE
|
||||||
|
|
||||||
|
rsource "backtrace/Kconfig"
|
||||||
|
|
||||||
|
endmenu # Native modules
|
||||||
|
|
||||||
|
rsource "periph/Kconfig"
|
||||||
|
|||||||
@ -25,3 +25,9 @@ ifeq ($(OS),Linux)
|
|||||||
# CAN is only supported on Linux through socketCAN
|
# CAN is only supported on Linux through socketCAN
|
||||||
FEATURES_PROVIDED += periph_can
|
FEATURES_PROVIDED += periph_can
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# This configuration enables modules that are only available when using Kconfig
|
||||||
|
# module modelling
|
||||||
|
ifeq (1, $(TEST_KCONFIG))
|
||||||
|
KCONFIG_ADD_CONFIG += $(RIOTCPU)/native/native.config
|
||||||
|
endif
|
||||||
|
|||||||
11
cpu/native/backtrace/Kconfig
Normal file
11
cpu/native/backtrace/Kconfig
Normal 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 MODULE_BACKTRACE
|
||||||
|
bool "Stack backtrace"
|
||||||
|
depends on CPU_ARCH_NATIVE
|
||||||
|
depends on TEST_KCONFIG
|
||||||
2
cpu/native/native.config
Normal file
2
cpu/native/native.config
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# UART is needed by startup.c
|
||||||
|
CONFIG_MODULE_PERIPH_UART=y
|
||||||
16
cpu/native/periph/Kconfig
Normal file
16
cpu/native/periph/Kconfig
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# 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 MODULE_PERIPH_SPIDEV_LINUX
|
||||||
|
bool
|
||||||
|
default y if MODULE_PERIPH_SPI
|
||||||
|
depends on NATIVE_OS_LINUX
|
||||||
|
|
||||||
|
config MODULE_PERIPH_INIT_SPIDEV_LINUX
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
depends on MODULE_PERIPH_SPIDEV_LINUX
|
||||||
36
cpu/native/periph/Kconfig.gpio
Normal file
36
cpu/native/periph/Kconfig.gpio
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
choice NATIVE_GPIO_IMPLEMENTATION
|
||||||
|
bool "Native GPIO peripheral implementation"
|
||||||
|
depends on MODULE_PERIPH_GPIO
|
||||||
|
depends on CPU_ARCH_NATIVE
|
||||||
|
depends on TEST_KCONFIG
|
||||||
|
default MODULE_PERIPH_GPIO_LINUX if NATIVE_OS_LINUX
|
||||||
|
|
||||||
|
config MODULE_PERIPH_GPIO_LINUX
|
||||||
|
bool "Linux GPIO"
|
||||||
|
depends on NATIVE_OS_LINUX
|
||||||
|
|
||||||
|
config MODULE_PERIPH_GPIO_MOCK
|
||||||
|
bool "Mock"
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
# TODO: these 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 MODULE_PERIPH_INIT_GPIO_LINUX
|
||||||
|
bool
|
||||||
|
default y if MODULE_PERIPH_INIT
|
||||||
|
depends on MODULE_PERIPH_GPIO_LINUX
|
||||||
|
|
||||||
|
config MODULE_PERIPH_INIT_GPIO_MOCK
|
||||||
|
bool
|
||||||
|
default y if MODULE_PERIPH_INIT
|
||||||
|
depends on MODULE_PERIPH_GPIO_MOCK
|
||||||
10
cpu/native/periph/Kconfig.rtc
Normal file
10
cpu/native/periph/Kconfig.rtc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# 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 MODULE_PERIPH_RTC
|
||||||
|
select MODULE_XTIMER if CPU_ARCH_NATIVE
|
||||||
|
depends on HAS_PERIPH_RTC
|
||||||
@ -115,15 +115,7 @@ config MODULE_PERIPH_INIT_QDEC
|
|||||||
default y if MODULE_PERIPH_INIT
|
default y if MODULE_PERIPH_INIT
|
||||||
depends on MODULE_PERIPH_QDEC
|
depends on MODULE_PERIPH_QDEC
|
||||||
|
|
||||||
config MODULE_PERIPH_RTC
|
rsource "Kconfig.rtc"
|
||||||
bool "RTC peripheral driver"
|
|
||||||
depends on HAS_PERIPH_RTC
|
|
||||||
select MODULE_PERIPH_COMMON
|
|
||||||
|
|
||||||
config MODULE_PERIPH_INIT_RTC
|
|
||||||
bool "Auto initialize RTC peripheral"
|
|
||||||
default y if MODULE_PERIPH_INIT
|
|
||||||
depends on MODULE_PERIPH_RTC
|
|
||||||
|
|
||||||
config MODULE_PERIPH_RTT
|
config MODULE_PERIPH_RTT
|
||||||
bool "RTT peripheral driver"
|
bool "RTT peripheral driver"
|
||||||
|
|||||||
@ -44,3 +44,5 @@ config MODULE_PERIPH_INIT_GPIO_FAST_READ
|
|||||||
depends on MODULE_PERIPH_GPIO_FAST_READ
|
depends on MODULE_PERIPH_GPIO_FAST_READ
|
||||||
|
|
||||||
endif # MODULE_PERIPH_GPIO
|
endif # MODULE_PERIPH_GPIO
|
||||||
|
|
||||||
|
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.gpio"
|
||||||
|
|||||||
19
drivers/periph_common/Kconfig.rtc
Normal file
19
drivers/periph_common/Kconfig.rtc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# 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 MODULE_PERIPH_RTC
|
||||||
|
bool "RTC peripheral driver"
|
||||||
|
depends on HAS_PERIPH_RTC
|
||||||
|
select MODULE_PERIPH_COMMON
|
||||||
|
|
||||||
|
config MODULE_PERIPH_INIT_RTC
|
||||||
|
bool "Auto initialize RTC peripheral"
|
||||||
|
default y if MODULE_PERIPH_INIT
|
||||||
|
depends on MODULE_PERIPH_RTC
|
||||||
|
|
||||||
|
# Include CPU specific configurations
|
||||||
|
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.rtc"
|
||||||
@ -10,10 +10,11 @@ menu "Standard Input/Output (STDIO)"
|
|||||||
|
|
||||||
choice
|
choice
|
||||||
bool "STDIO implementation"
|
bool "STDIO implementation"
|
||||||
|
default MODULE_STDIO_NATIVE if CPU_ARCH_NATIVE
|
||||||
default MODULE_STDIO_UART
|
default MODULE_STDIO_UART
|
||||||
|
|
||||||
# TODO: Add MODULE_STDIO_CDC_ACM, MODULE_STDIO_RTT, MODULE_SLIPDEV_STDIO,
|
# TODO: Add MODULE_STDIO_CDC_ACM, MODULE_STDIO_RTT, MODULE_SLIPDEV_STDIO,
|
||||||
# MODULE_STDIO_NATIVE and MODULE_STDIO_ETHOS
|
# and MODULE_STDIO_ETHOS
|
||||||
|
|
||||||
config MODULE_STDIO_NULL
|
config MODULE_STDIO_NULL
|
||||||
bool "Null"
|
bool "Null"
|
||||||
@ -25,6 +26,10 @@ config MODULE_STDIO_UART
|
|||||||
depends on HAS_PERIPH_UART
|
depends on HAS_PERIPH_UART
|
||||||
select MODULE_PERIPH_UART
|
select MODULE_PERIPH_UART
|
||||||
|
|
||||||
|
config MODULE_STDIO_NATIVE
|
||||||
|
bool "Native"
|
||||||
|
depends on CPU_ARCH_NATIVE
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config MODULE_STDIN
|
config MODULE_STDIN
|
||||||
|
|||||||
@ -12,6 +12,10 @@ USEMODULE += benchmark
|
|||||||
# disable native GPIOs for automatic test
|
# disable native GPIOs for automatic test
|
||||||
ifeq (native,$(BOARD))
|
ifeq (native,$(BOARD))
|
||||||
USEMODULE += periph_gpio_mock
|
USEMODULE += periph_gpio_mock
|
||||||
|
# the same for Kconfig
|
||||||
|
ifeq (1,$(TEST_KCONFIG))
|
||||||
|
KCONFIG_ADD_CONFIG += $(APPDIR)/app.config.test.native
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BOARDS_BENCH_PORT_1 = \
|
BOARDS_BENCH_PORT_1 = \
|
||||||
|
|||||||
2
tests/periph_gpio/app.config.test.native
Normal file
2
tests/periph_gpio/app.config.test.native
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# disable native GPIOs for automatic test
|
||||||
|
CONFIG_MODULE_PERIPH_GPIO_MOCK=y
|
||||||
Loading…
x
Reference in New Issue
Block a user