diff --git a/cpu/esp_common/Kconfig b/cpu/esp_common/Kconfig index b0dc7df141..3359c8644c 100644 --- a/cpu/esp_common/Kconfig +++ b/cpu/esp_common/Kconfig @@ -59,3 +59,47 @@ config HAS_ARCH_ESP ## Common CPU symbols config CPU_ARCH default "xtensa" if CPU_ARCH_XTENSA + +config MODULE_ESP_COMMON + bool + depends on TEST_KCONFIG + depends on CPU_COMMON_ESP + default y + select MODULE_LOG # override default log implementation by default + select MODULE_PERIPH + select MODULE_ESP_IDF + help + Common code module for ESP SoCs. + +config MODULE_PERIPH_FLASH + bool + depends on TEST_KCONFIG + depends on CPU_COMMON_ESP + default y if MODULE_MTD + help + Low-level MTD flash driver implementation for ESP SoCs. + +if TEST_KCONFIG + +menu "ESP configurations" + +config MODULE_ESP_LOG_COLORED + bool + default y if MODULE_LOG_COLOR + +config MODULE_ESP_LOG_TAGGED + bool "Add additional information to the log output" + help + Adds the type of the message, the system time in ms and a tag (module + or function) to the output. + +config MODULE_ESP_LOG_STARTUP + bool "Add additional startup information to the log output" + +endmenu + +endif # TEST_KCONFIG + +rsource "freertos/Kconfig" +rsource "periph/Kconfig" +rsource "vendor/xtensa/Kconfig" diff --git a/cpu/esp_common/Makefile.features b/cpu/esp_common/Makefile.features index efb55a6e10..9e1858dc87 100644 --- a/cpu/esp_common/Makefile.features +++ b/cpu/esp_common/Makefile.features @@ -19,3 +19,9 @@ FEATURES_PROVIDED += ssp FEATURES_CONFLICT += esp_wifi_ap:esp_now FEATURES_CONFLICT_MSG += "ESP_NOW and ESP_WIFI_AP can not be used at the same time." + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp_common/esp_common.config +endif diff --git a/cpu/esp_common/esp_common.config b/cpu/esp_common/esp_common.config new file mode 100644 index 0000000000..1914c406e8 --- /dev/null +++ b/cpu/esp_common/esp_common.config @@ -0,0 +1,11 @@ +CONFIG_MODULE_RANDOM=y +# Should be autoselecting the MODULE_PRNG_HWRNG if possible +# Since the makefile cannot we have to override until end of migration +# Remove when TEST_KCONFIG is complete +CONFIG_MODULE_PRNG_MUSL_LCG=y +CONFIG_MODULE_PERIPH_HWRNG=y +CONFIG_MODULE_PERIPH_UART=y +CONFIG_MODULE_NEWLIB=y + +# Vendor code uses C++ +CONFIG_MODULE_CPP=y diff --git a/cpu/esp_common/freertos/Kconfig b/cpu/esp_common/freertos/Kconfig new file mode 100644 index 0000000000..fabedae262 --- /dev/null +++ b/cpu/esp_common/freertos/Kconfig @@ -0,0 +1,20 @@ +# 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 && HAS_ARCH_ESP + +config MODULE_ESP_FREERTOS + bool + default y + help + FreeRTOS to RIOT-OS adaption module for ESP SoCs source code compatibility. + +config MODULE_ESP_FREERTOS_COMMON + bool + default MODULE_ESP_FREERTOS + +endif # TEST_KCONFIG && HAS_ARCH_ESP diff --git a/cpu/esp_common/periph/Kconfig b/cpu/esp_common/periph/Kconfig new file mode 100644 index 0000000000..5b9cd63d11 --- /dev/null +++ b/cpu/esp_common/periph/Kconfig @@ -0,0 +1,20 @@ +# 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_ESP_COMMON_PERIPH + bool + depends on HAS_ARCH_ESP + default y + +config MODULE_PERIPH_I2C_SW + bool + help + Software implementation of I2C. + +endif # TEST_KCONFIG diff --git a/cpu/esp_common/vendor/xtensa/Kconfig b/cpu/esp_common/vendor/xtensa/Kconfig new file mode 100644 index 0000000000..0234d0fc33 --- /dev/null +++ b/cpu/esp_common/vendor/xtensa/Kconfig @@ -0,0 +1,15 @@ +# 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_XTENSA + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP + default y + help + Third-party software components used by the RIOT port for ESP32 and + ESP8266.