diff --git a/boards/esp32-ethernet-kit-v1_0/Kconfig b/boards/esp32-ethernet-kit-v1_0/Kconfig index 37e631c4b2..2fa10fd8bf 100644 --- a/boards/esp32-ethernet-kit-v1_0/Kconfig +++ b/boards/esp32-ethernet-kit-v1_0/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_0 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_B - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-ethernet-kit-v1_1/Kconfig b/boards/esp32-ethernet-kit-v1_1/Kconfig index 4c8f8c5bd2..ac1190ce3d 100644 --- a/boards/esp32-ethernet-kit-v1_1/Kconfig +++ b/boards/esp32-ethernet-kit-v1_1/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_1 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_B - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-ethernet-kit-v1_2/Kconfig b/boards/esp32-ethernet-kit-v1_2/Kconfig index b7b8124e0e..2814c5282f 100644 --- a/boards/esp32-ethernet-kit-v1_2/Kconfig +++ b/boards/esp32-ethernet-kit-v1_2/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_2 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_E - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-wemos-lolin-d32-pro/Kconfig b/boards/esp32-wemos-lolin-d32-pro/Kconfig index f06706864a..d7d2e46437 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Kconfig +++ b/boards/esp32-wemos-lolin-d32-pro/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_WEMOS_LOLIN_D32_PRO select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER select HAS_ARDUINO - select HAS_ESP_SPI_RAM select HAS_PERIPH_ADC select HAS_PERIPH_DAC select HAS_PERIPH_I2C diff --git a/boards/esp32-wrover-kit/Kconfig b/boards/esp32-wrover-kit/Kconfig index 2bde4ba541..26b3881075 100644 --- a/boards/esp32-wrover-kit/Kconfig +++ b/boards/esp32-wrover-kit/Kconfig @@ -14,7 +14,7 @@ config BOARD_ESP32_WROVER_KIT select CPU_MODEL_ESP32_WROVER select HAS_ARDUINO select HAS_ESP_RTC_TIMER_32K - select HAS_ESP_SPI_RAM + select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_I2C select HAS_PERIPH_PWM diff --git a/cpu/esp32/Kconfig b/cpu/esp32/Kconfig index 0ad815e2a0..0b9a91a7bc 100644 --- a/cpu/esp32/Kconfig +++ b/cpu/esp32/Kconfig @@ -21,6 +21,14 @@ config CPU_FAM_ESP32 select HAS_PERIPH_RTT_SET_COUNTER select HAS_PERIPH_RTT_OVERFLOW + select MODULE_PERIPH_RTT if HAS_PERIPH_RTT && MODULE_PM_LAYERED + select MODULE_RTT_RTC if HAS_PERIPH_RTT && MODULE_PERIPH_RTC + select MODULE_PS if MODULE_SHELL + select MODULE_ESP_IDF_DRIVER if TEST_KCONFIG + select MODULE_ESP_IDF_ESP32 if TEST_KCONFIG + select MODULE_ESP_IDF_SOC if TEST_KCONFIG + imply MODULE_NEWLIB_NANO + ## CPU Models config CPU_MODEL_ESP32_WROOM_32 bool @@ -29,14 +37,17 @@ config CPU_MODEL_ESP32_WROOM_32 config CPU_MODEL_ESP32_WROVER bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_WROVER_B bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_WROVER_E bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_D0WD bool @@ -76,6 +87,11 @@ config HAS_PERIPH_ADC_CTRL help Indicates that an ESP32 ADC controller peripheral is present. +config HAS_ESP_SPI_RAM + bool + help + Indicates that the a RAM is present on the SPI bus. + ## Common CPU symbols config CPU_CORE default "xtensa-lx6" if CPU_CORE_XTENSA_LX6 @@ -93,4 +109,24 @@ config CPU_MODEL config CPU default "esp32" if CPU_FAM_ESP32 +menu "ESP32 configurations" + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP32 + +config MODULE_ESP_SPI_RAM + bool "SPI RAM support" + select MODULE_ESP_IDF_HEAP + depends on HAS_ESP_SPI_RAM + select MODULE_ESP_IDF_HEAP + help + Say y to use external SPI RAM connected through the FSPI interface. + +config MODULE_ESP_JTAG + bool "Enable JTAG debugging interface" + depends on HAS_ESP_JTAG + +endmenu + +rsource "periph/Kconfig" +rsource "vendor/esp-idf/Kconfig" source "$(RIOTCPU)/esp_common/Kconfig" diff --git a/cpu/esp32/Makefile.features b/cpu/esp32/Makefile.features index a2b3f037b3..d176c596e0 100644 --- a/cpu/esp32/Makefile.features +++ b/cpu/esp32/Makefile.features @@ -11,3 +11,9 @@ FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_rtt_set_counter FEATURES_PROVIDED += periph_rtt_overflow + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp32/esp32.config +endif diff --git a/cpu/esp32/esp32.config b/cpu/esp32/esp32.config new file mode 100644 index 0000000000..811b1f3712 --- /dev/null +++ b/cpu/esp32/esp32.config @@ -0,0 +1 @@ +CONFIG_MODULE_PM_LAYERED=y diff --git a/cpu/esp32/periph/Kconfig b/cpu/esp32/periph/Kconfig new file mode 100644 index 0000000000..d9beb65cac --- /dev/null +++ b/cpu/esp32/periph/Kconfig @@ -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. +# + +if TEST_KCONFIG + +config MODULE_ESP_RTC_TIMER_32K + bool + depends on HAS_ESP_RTC_TIMER_32K + default y if MODULE_PERIPH_RTC + help + Use RTC timer with external 32.768 kHz crystal as RTT. + +config MODULE_PERIPH_ADC_CTRL + bool + depends on HAS_PERIPH_ADC_CTRL + default y if MODULE_PERIPH_ADC || MODULE_PERIPH_DAC + +config MODULE_PERIPH_RTT_HW_SYS + bool + default y if MODULE_PERIPH_RTT + +config MODULE_PERIPH_RTT_HW_RTC + bool + default y if MODULE_PERIPH_RTT + +endif # TEST_KCONFIG diff --git a/cpu/esp32/periph/Kconfig.i2c b/cpu/esp32/periph/Kconfig.i2c new file mode 100644 index 0000000000..9001be216c --- /dev/null +++ b/cpu/esp32/periph/Kconfig.i2c @@ -0,0 +1,34 @@ +# 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 + +choice + bool "I2C implementation" + depends on MODULE_PERIPH_I2C + help + Due to the poor and faulty hardware I2C implementation the software one + is used by default for the moment. + +config MODULE_ESP_I2C_SW + bool "Software" + select MODULE_PERIPH_I2C_SW + +config MODULE_ESP_I2C_HW + bool "Hardware" + select MODULE_CORE_THREAD_FLAGS + select MODULE_XTIMER + select MODULE_PERIPH_I2C_HW + +endchoice + +config MODULE_PERIPH_I2C_HW + bool + help + Hardware implementation of I2C. + +endif # TEST_KCONFIG diff --git a/cpu/esp32/vendor/esp-idf/Kconfig b/cpu/esp32/vendor/esp-idf/Kconfig new file mode 100644 index 0000000000..2758d82bd6 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/Kconfig @@ -0,0 +1,26 @@ +# 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_ESP_IDF + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP32 + default y + select MODULE_ESP_IDF_DRIVER + select MODULE_ESP_IDF_ESP32 + select MODULE_ESP_IDF_SOC + help + Espressif IoT Development Framework. + +rsource "driver/Kconfig" +rsource "esp32/Kconfig" +rsource "ethernet/Kconfig" +rsource "heap/Kconfig" +rsource "nvs_flash/Kconfig" +rsource "soc/Kconfig" +rsource "spi_flash/Kconfig" +rsource "wpa_supplicant/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/driver/Kconfig b/cpu/esp32/vendor/esp-idf/driver/Kconfig new file mode 100644 index 0000000000..e899d2e113 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/driver/Kconfig @@ -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_ESP_IDF_DRIVER + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/esp32/Kconfig b/cpu/esp32/vendor/esp-idf/esp32/Kconfig new file mode 100644 index 0000000000..51eecd083d --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/esp32/Kconfig @@ -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_ESP_IDF_ESP32 + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/ethernet/Kconfig b/cpu/esp32/vendor/esp-idf/ethernet/Kconfig new file mode 100644 index 0000000000..2393058a91 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/ethernet/Kconfig @@ -0,0 +1,13 @@ +# 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_ESP_IDF_ETH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + +rsource "eth_phy/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig b/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig new file mode 100644 index 0000000000..2415096deb --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig @@ -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_ESP_IDF_ETH_PHY + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF_ETH diff --git a/cpu/esp32/vendor/esp-idf/heap/Kconfig b/cpu/esp32/vendor/esp-idf/heap/Kconfig new file mode 100644 index 0000000000..aa89bbed0a --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/heap/Kconfig @@ -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_ESP_IDF_HEAP + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig b/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig new file mode 100644 index 0000000000..13161e1a1c --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig @@ -0,0 +1,14 @@ +# 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_ESP_IDF_NVS_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + select MODULE_MTD + help + Non-volatile storage library. diff --git a/cpu/esp32/vendor/esp-idf/soc/Kconfig b/cpu/esp32/vendor/esp-idf/soc/Kconfig new file mode 100644 index 0000000000..e0f5402607 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/soc/Kconfig @@ -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_ESP_IDF_SOC + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig b/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig new file mode 100644 index 0000000000..09b9aa4295 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig @@ -0,0 +1,12 @@ +# 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_ESP_IDF_SPI_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + default y if MODULE_MTD diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig new file mode 100644 index 0000000000..a065923019 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig @@ -0,0 +1,10 @@ +# 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 "port/Kconfig" +rsource "src/crypto/Kconfig" +rsource "src/wpa2/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig new file mode 100644 index 0000000000..554e8a84ef --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig @@ -0,0 +1,13 @@ +# 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_ESP_IDF_WPA_SUPPLICANT_PORT + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + help + esp-idf WPA supplicant port code. diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig new file mode 100644 index 0000000000..bfc1578c6d --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig @@ -0,0 +1,12 @@ +# 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_ESP_IDF_WPA_SUPPLICANT_CRYPTO + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig new file mode 100644 index 0000000000..fba707c843 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig @@ -0,0 +1,10 @@ +# 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 "eap_peer/Kconfig" +rsource "tls/Kconfig" +rsource "utils/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig new file mode 100644 index 0000000000..8c8f84ce01 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig @@ -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_ESP_IDF_WPA_SUPPLICANT_WPA2_EAP_PEER + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig new file mode 100644 index 0000000000..f1b2623400 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig @@ -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_ESP_IDF_WPA_SUPPLICANT_WPA2_TLS + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig new file mode 100644 index 0000000000..48f6d7ddfe --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig @@ -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_ESP_IDF_WPA_SUPPLICANT_WPA2_UTILS + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/drivers/aip31068/Kconfig b/drivers/aip31068/Kconfig index 4cc2022511..fc53fe3152 100644 --- a/drivers/aip31068/Kconfig +++ b/drivers/aip31068/Kconfig @@ -11,6 +11,3 @@ config MODULE_AIP31068 depends on TEST_KCONFIG select MODULE_XTIMER select MODULE_PERIPH_I2C -# necessary to fix driver initialization on esp32 -# TODO: move this to ESP32 - select MODULE_ESP_I2C_HW if CPU_ESP32 diff --git a/drivers/periph_common/Kconfig.i2c b/drivers/periph_common/Kconfig.i2c index d11237fcf3..f5a081c893 100644 --- a/drivers/periph_common/Kconfig.i2c +++ b/drivers/periph_common/Kconfig.i2c @@ -30,3 +30,5 @@ config MODULE_PERIPH_INIT_I2C_RECONFIGURE depends on MODULE_PERIPH_I2C_RECONFIGURE endif # MODULE_PERIPH_I2C + +osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.i2c"