cpu/esp32: model Kconfig

This commit is contained in:
Leandro Lanzieri 2021-11-18 17:17:04 +01:00
parent 7a8f58ac4c
commit bfdfbb1a48
No known key found for this signature in database
GPG Key ID: F4E9A721761C7593
28 changed files with 308 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

1
cpu/esp32/esp32.config Normal file
View File

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

30
cpu/esp32/periph/Kconfig Normal file
View File

@ -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

View File

@ -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

26
cpu/esp32/vendor/esp-idf/Kconfig vendored Normal file
View File

@ -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"

11
cpu/esp32/vendor/esp-idf/driver/Kconfig vendored 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_ESP_IDF_DRIVER
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

11
cpu/esp32/vendor/esp-idf/esp32/Kconfig vendored 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_ESP_IDF_ESP32
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

View File

@ -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"

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_ESP_IDF_ETH_PHY
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF_ETH

11
cpu/esp32/vendor/esp-idf/heap/Kconfig vendored 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_ESP_IDF_HEAP
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

View File

@ -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.

11
cpu/esp32/vendor/esp-idf/soc/Kconfig vendored 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_ESP_IDF_SOC
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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

View File

@ -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"

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_ESP_IDF_WPA_SUPPLICANT_WPA2_EAP_PEER
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

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_ESP_IDF_WPA_SUPPLICANT_WPA2_TLS
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

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_ESP_IDF_WPA_SUPPLICANT_WPA2_UTILS
bool
depends on TEST_KCONFIG
depends on MODULE_ESP_IDF

View File

@ -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

View File

@ -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"