1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #17235 from leandrolanzieri/cpu/kinetis/model_kconfig

cpu/kinetis: model kconfig
This commit is contained in:
Francisco 2021-12-09 14:22:10 +01:00 committed by GitHub
commit 7362074f49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 244 additions and 19 deletions

View File

@ -26,6 +26,7 @@ hifive1
mbed_lpc1768
mega-xplained
microbit
mulle
native
nrf52840dk
nrf9160dk

View File

@ -14,3 +14,11 @@ config BOARD_COMMON_KW41Z
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO
config MODULE_BOARDS_COMMON_KW41Z
bool
help
Common code for kw41z-based boards.

View File

@ -19,3 +19,6 @@ config BOARD_FRDM_K22F
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO

View File

@ -20,3 +20,5 @@ config BOARD_FRDM_K64F
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
select HAVE_SAUL_ADC

View File

@ -17,3 +17,8 @@ config BOARD_FRDM_KL43Z
select HAS_PERIPH_RTT
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAVE_MAG3110
select HAVE_MMA8X5X
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO

View File

@ -14,4 +14,7 @@ config BOARD_FRDM_KW41Z
select HAS_PERIPH_SPI
select BOARD_COMMON_KW41Z
select MODULE_BOARDS_COMMON_KW41Z if TEST_KCONFIG
select HAVE_FXOS8700
source "$(RIOTBOARD)/common/kw41z/Kconfig"

View File

@ -20,3 +20,7 @@ config BOARD_MULLE
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAVE_LIS3DH
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO

View File

@ -18,3 +18,9 @@ FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(BOARDDIR)/mulle.config
endif

10
boards/mulle/mulle.config Normal file
View File

@ -0,0 +1,10 @@
# The Mulle uses NVRAM to store persistent variables, such as boot count.
CONFIG_MODULE_NVRAM=y
CONFIG_MODULE_NVRAM_SPI=y
CONFIG_MODULE_VFS=y
CONFIG_MODULE_DEVFS=y
CONFIG_MODULE_MTD=y
CONFIG_MODULE_MTD_SPI_NOR=y
# Mulle always uses the RTT for the oscillator
CONFIG_MODULE_PERIPH_RTT=y

View File

@ -20,3 +20,6 @@ config BOARD_OPENLABS_KW41Z_MINI_256KIB
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO

View File

@ -20,3 +20,6 @@ config BOARD_OPENLABS_KW41Z_MINI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
select HAVE_SAUL_ADC
select HAVE_SAUL_GPIO

View File

@ -19,3 +19,11 @@ config BOARD_PBA_D_01_KW2X
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_RIOTBOOT
select HAVE_SAUL_GPIO
select HAVE_HDC1000
select HAVE_MAG3110
select HAVE_MMA8X5X
select HAVE_MPL3115A2
select HAVE_TCS37727
select HAVE_TMP006

View File

@ -14,4 +14,8 @@ config BOARD_PHYNODE_KW41Z
select HAS_PERIPH_I2C
select HAS_PERIPH_SPI
select HAVE_CCS811
select HAVE_MMA8X5X
select HAVE_TCS37727
source "$(RIOTBOARD)/common/kw41z/Kconfig"

View File

@ -12,5 +12,6 @@ config BOARD_USB_KW41Z
default y
select BOARD_COMMON_KW41Z
select HAS_PERIPH_SPI
select MODULE_BOARDS_COMMON_KW41Z if TEST_KCONFIG
source "$(RIOTBOARD)/common/kw41z/Kconfig"

View File

@ -12,6 +12,15 @@ config CPU_COMMON_KINETIS
select HAS_PERIPH_GPIO_IRQ
select HAS_PERIPH_PM
# enable kinetis periph drivers if available
imply MODULE_PERIPH_ICS
imply MODULE_PERIPH_MCG
imply MODULE_PERIPH_MCG_LITE
imply MODULE_PERIPH_WDOG
select MODULE_CORE_THREAD_FLAGS if MODULE_PERIPH_I2C
select MODULE_PERIPH_TIMER if MODULE_PERIPH_RTT && HAS_PERIPH_TIMER
config CPU_FAM_EA
bool
select CPU_COMMON_KINETIS
@ -162,3 +171,5 @@ config CPU
default "kinetis" if CPU_COMMON_KINETIS
source "$(RIOTCPU)/cortexm_common/Kconfig"
rsource "periph/Kconfig"

View File

@ -33,3 +33,9 @@ else
endif
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)/kinetis/kinetis.config
endif

View File

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

View File

@ -0,0 +1,33 @@
# 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.
#
if TEST_KCONFIG
config MODULE_PERIPH_WDOG
bool
help
Low-level WDOG driver.
config MODULE_PERIPH_ICS
bool
depends on HAS_PERIPH_ICS
help
Kinetis internal clock source controller.
config MODULE_PERIPH_MCG
bool
depends on HAS_PERIPH_MCG
help
Kinetis Multipurpose Clock Generator.
config MODULE_PERIPH_MCG_LITE
bool
depends on HAS_PERIPH_MCG_LITE
help
Kinetis Multipurpose Clock Generator (Lite version).
endif # TEST_KCONFIG

View File

@ -13,6 +13,12 @@ config MODULE_FXOS8700
select MODULE_PERIPH_I2C
select MODULE_XTIMER
config HAVE_FXOS8700
bool
select MODULE_FXOS8700 if MODULE_SAUL_DEFAULT
help
Indicates that an fxos8700 accelerometer/magnetometer is present.
menuconfig KCONFIG_USEMODULE_FXOS8700
bool "Configure FXOS8700 driver"
depends on USEMODULE_FXOS8700

View File

@ -12,6 +12,12 @@ config MODULE_HDC1000
select MODULE_PERIPH_I2C
select MODULE_XTIMER
config HAVE_HDC1000
bool
select MODULE_HDC1000 if MODULE_SAUL_DEFAULT
help
Indicates that an hdc1000 humidity and temperature sensor is present.
menuconfig KCONFIG_USEMODULE_HDC1000
bool "Configure HDC1000 driver"
depends on USEMODULE_HDC1000

View File

@ -12,3 +12,9 @@ config MODULE_LIS3DH
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_SPI
config HAVE_LIS3DH
bool
select MODULE_LIS3DH if MODULE_SAUL_DEFAULT
help
Indicates that a lis3dh accelerometer is present.

View File

@ -12,6 +12,12 @@ config MODULE_MAG3110
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
config HAVE_MAG3110
bool
select MODULE_MAG3110 if MODULE_SAUL_DEFAULT
help
Indicates that a mag3110 magnetometer is present.
menuconfig KCONFIG_USEMODULE_MAG3110
bool "Configure MAG3110 driver"
depends on USEMODULE_MAG3110

View File

@ -12,6 +12,12 @@ config MODULE_MMA8X5X
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
config HAVE_MMA8X5X
bool
select MODULE_MMA8X5X if MODULE_SAUL_DEFAULT
help
Indicates that an mma8x5x accelerometer is present.
menuconfig KCONFIG_USEMODULE_MMA8X5X
bool "Configure MMA8X5X driver"
depends on USEMODULE_MMA8X5X

View File

@ -10,3 +10,9 @@ config MODULE_MPL3115A2
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
config HAVE_MPL3115A2
bool
select MODULE_MPL3115A2 if MODULE_SAUL_DEFAULT
help
Indicates that an mpl3115a2 pressure sensor is present.

View File

@ -12,6 +12,12 @@ config MODULE_TCS37727
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
config HAVE_TCS37727
bool
select MODULE_TCS37727 if MODULE_SAUL_DEFAULT
help
Indicates that a tcs37727 rgb light sensor is present.
menuconfig KCONFIG_USEMODULE_TCS37727
bool "Configure TCS37727 driver"
depends on USEMODULE_TCS37727

View File

@ -6,30 +6,45 @@
# directory for more details.
#
if TEST_KCONFIG
choice
bool "TMP006/TMP007 Infrared Thermopile sensors"
optional
depends on HAS_PERIPH_I2C
config MODULE_TMP006
bool "TMP006"
select MODULE_TMP00X
config MODULE_TMP007
bool "TMP007"
select MODULE_TMP00X
endchoice
config MODULE_TMP00X
menuconfig MODULE_TMP00X
bool
prompt "TMP006/TMP007 Infrared Thermopile sensors" if !(HAVE_TMP00X && MODULE_SAUL_DEFAULT)
default y if (HAVE_TMP00X && MODULE_SAUL_DEFAULT)
depends on TEST_KCONFIG
depends on HAS_PERIPH_I2C
select MODULE_PERIPH_I2C
select MODULE_XTIMER
endif # TEST_KCONFIG
choice
bool "Sensor variant"
default MODULE_TMP006 if HAVE_TMP006
default MODULE_TMP007 if HAVE_TMP007
depends on MODULE_TMP00X
config MODULE_TMP006
bool "TMP006"
config MODULE_TMP007
bool "TMP007"
endchoice
config HAVE_TMP006
bool
select HAVE_TMP00X
help
Indicates that a tmp006 infrared sensor is present.
config HAVE_TMP007
bool
select HAVE_TMP00X
help
Indicates that a tmp007 infrared sensor is present.
config HAVE_TMP00X
bool
help
Indicates that a tmp00x infrared sensor is present.
menuconfig KCONFIG_USEMODULE_TMP00X
bool "Configure TMP00X driver"

View File

@ -17,6 +17,8 @@ ifneq (,$(filter periph_init, $(USEMODULE)))
periph_flexcomm \
periph_gpio_mux \
periph_rtc_ms \
periph_mcg \
periph_wdog \
periph_rtc_rtt \
periph_clic \
periph_coretimer \

View File

@ -28,6 +28,7 @@ rsource "event/Kconfig"
rsource "fido2/Kconfig"
rsource "fmt/Kconfig"
rsource "frac/Kconfig"
rsource "fs/Kconfig"
rsource "hashes/Kconfig"
rsource "iolist/Kconfig"
rsource "isrpipe/Kconfig"

9
sys/fs/Kconfig Normal file
View File

@ -0,0 +1,9 @@
# 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.
#
rsource "constfs/Kconfig"
rsource "devfs/Kconfig"

11
sys/fs/constfs/Kconfig Normal file
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_CONSTFS
bool "ConstFS support"
help
ConstFS static file system.

32
sys/fs/devfs/Kconfig Normal file
View File

@ -0,0 +1,32 @@
# 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_DEVFS
bool "DevFS support"
depends on MODULE_VFS
help
This file system implementation allows devices to register file names
for easier access to device drivers from shell commands etc. The idea is
similar to the /dev directory on Unix.
if MODULE_DEVFS
config MODULE_DEVFS_HWRNG
bool "Add HWRNG device"
depends on HAS_PERIPH_HWRNG
select MODULE_PERIPH_HWRNG
help
Adds the hardware random number generator (HWRNG) as a device
(/dev/hwrng).
config MODULE_DEVFS_RANDOM
bool "Add random device"
select MODULE_RANDOM
help
Adds a device to generate random (/dev/urandom).
endif # MODULE_DEVFS

View File

@ -1,4 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_TMP00X=y
CONFIG_MODULE_TMP006=y
CONFIG_MODULE_XTIMER=y