From f6b9637c8254558de1999c2cf5f4d3e54cee5f87 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 24 Nov 2021 08:37:15 +0100 Subject: [PATCH 1/7] boards/same54-xpro: Add SAUL_GPIO to kconfig --- boards/same54-xpro/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/same54-xpro/Kconfig b/boards/same54-xpro/Kconfig index 253bf99466..9d0802241c 100644 --- a/boards/same54-xpro/Kconfig +++ b/boards/same54-xpro/Kconfig @@ -23,3 +23,4 @@ config BOARD_SAME54_XPRO select HAS_PERIPH_UART select HAS_PERIPH_USBDEV select HAS_RIOTBOOT + select HAVE_SAUL_GPIO From 51f92fa8163a814ce9dc94d2ce78628a5eff023f Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 24 Nov 2021 08:52:19 +0100 Subject: [PATCH 2/7] drivers/periph_spi: Kconfig SPI_ON_QSPI model --- drivers/periph_common/Kconfig.spi | 4 ++++ makefiles/features_modules.inc.mk | 3 ++- tests/periph_spi/Kconfig | 1 + tests/periph_spi_dma/Kconfig | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/periph_common/Kconfig.spi b/drivers/periph_common/Kconfig.spi index 9ad5562add..d928196d78 100644 --- a/drivers/periph_common/Kconfig.spi +++ b/drivers/periph_common/Kconfig.spi @@ -20,6 +20,10 @@ config MODULE_PERIPH_SPI_RECONFIGURE bool "Pin reconfiguration support" depends on HAS_PERIPH_SPI_RECONFIGURE +config MODULE_PERIPH_SPI_ON_QSPI + bool "Use QSPI peripherial in SPI mode" + depends on HAS_PERIPH_SPI_ON_QSPI + config MODULE_PERIPH_SPI_GPIO_MODE bool "Support initializing SPI pins with adapted GPIO modes" depends on HAS_PERIPH_SPI_GPIO_MODE diff --git a/makefiles/features_modules.inc.mk b/makefiles/features_modules.inc.mk index b0e055b2b6..1b6b248544 100644 --- a/makefiles/features_modules.inc.mk +++ b/makefiles/features_modules.inc.mk @@ -18,7 +18,8 @@ ifneq (,$(filter periph_init, $(USEMODULE))) periph_rtc_rtt \ periph_clic \ periph_coretimer \ - periph_plic + periph_plic \ + periph_spi_on_qspi # PERIPH_MODULES := $(filter-out $(PERIPH_IGNORE_MODULES),\ $(filter periph_%,$(USEMODULE))) diff --git a/tests/periph_spi/Kconfig b/tests/periph_spi/Kconfig index 8e259953d9..bf2aa74643 100644 --- a/tests/periph_spi/Kconfig +++ b/tests/periph_spi/Kconfig @@ -9,4 +9,5 @@ config APPLICATION bool default y imply MODULE_PERIPH_SPI_RECONFIGURE + imply MODULE_PERIPH_SPI_ON_QSPI depends on TEST_KCONFIG diff --git a/tests/periph_spi_dma/Kconfig b/tests/periph_spi_dma/Kconfig index 8e259953d9..bf2aa74643 100644 --- a/tests/periph_spi_dma/Kconfig +++ b/tests/periph_spi_dma/Kconfig @@ -9,4 +9,5 @@ config APPLICATION bool default y imply MODULE_PERIPH_SPI_RECONFIGURE + imply MODULE_PERIPH_SPI_ON_QSPI depends on TEST_KCONFIG From f98128f0fbc9e8057968fc0cbbdb509260ffb9ff Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 24 Nov 2021 09:18:42 +0100 Subject: [PATCH 3/7] boards/same54-xpro: Kconfig mtd model --- boards/same54-xpro/Kconfig | 5 +++++ drivers/at24mac/Kconfig | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/boards/same54-xpro/Kconfig b/boards/same54-xpro/Kconfig index 9d0802241c..371d51cf14 100644 --- a/boards/same54-xpro/Kconfig +++ b/boards/same54-xpro/Kconfig @@ -23,4 +23,9 @@ config BOARD_SAME54_XPRO select HAS_PERIPH_UART select HAS_PERIPH_USBDEV select HAS_RIOTBOOT + select HAVE_SAUL_GPIO + select HAVE_MTD_SPI_NOR + select HAVE_AT24MAC + # This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR + select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR diff --git a/drivers/at24mac/Kconfig b/drivers/at24mac/Kconfig index 9883d8ecd4..407fe24fc4 100644 --- a/drivers/at24mac/Kconfig +++ b/drivers/at24mac/Kconfig @@ -10,8 +10,8 @@ comment "AT24MAC unique ID chip enabled as default EUI-48/64 provider" config MODULE_AT24MAC bool - prompt "AT24MAC unique ID chip" if !(MODULE_EUI_PROVIDER && HAVE_AT24MAC) - default (MODULE_EUI_PROVIDER && HAVE_AT24MAC) + prompt "AT24MAC unique ID chip" if !((MODULE_EUI_PROVIDER || MODULE_MTD) && HAVE_AT24MAC) + default ((MODULE_EUI_PROVIDER || MODULE_MTD) && HAVE_AT24MAC) select MODULE_AT24CXXX depends on HAS_PERIPH_I2C depends on TEST_KCONFIG From fba9cad9873cdbf36c9e76aa17b80132c7dec23b Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 24 Nov 2021 11:22:25 +0100 Subject: [PATCH 4/7] periph/gpio: Model TAMPER_WAKE for kconfig --- cpu/sam0_common/periph/Kconfig | 2 +- drivers/periph_common/Kconfig.gpio | 15 ++++++++++++++- tests/periph_gpio/Kconfig | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cpu/sam0_common/periph/Kconfig b/cpu/sam0_common/periph/Kconfig index b8a673789e..db82e7e99f 100644 --- a/cpu/sam0_common/periph/Kconfig +++ b/cpu/sam0_common/periph/Kconfig @@ -18,7 +18,7 @@ config MODULE_SAM0_COMMON_PERIPH config MODULE_PERIPH_RTC_RTT bool - default y if MODULE_PERIPH_RTT || MODULE_PERIPH_RTC + default y if MODULE_PERIPH_RTT || MODULE_PERIPH_RTC || MODULE_PERIPH_GPIO_TAMPER_WAKE config MODULE_PERIPH_UART_NONBLOCKING depends on HAS_PERIPH_UART_NONBLOCKING diff --git a/drivers/periph_common/Kconfig.gpio b/drivers/periph_common/Kconfig.gpio index 8c7aa4cbfe..33a2f6d37f 100644 --- a/drivers/periph_common/Kconfig.gpio +++ b/drivers/periph_common/Kconfig.gpio @@ -29,7 +29,15 @@ config MODULE_PERIPH_GPIO_FAST_READ This trades an increase in power consumption for a decrease in GPIO pin read latency. -# TODO: this module is actually just an artifact from the way periph_init_% +config MODULE_PERIPH_GPIO_TAMPER_WAKE + bool "enable wake from Deep Sleep by RTC tamper pins" + depends on HAS_PERIPH_GPIO_TAMPER_WAKE + help + If you enable this, a RTC tamper pin that has been configured as an + interrupt can wake the CPU from Deep Sleep. Only RTC tamper pins + (and the RTC alarm) can wake the CPU from Deep Sleep. + +# TODO: this module is actually jus t an artifact from the way periph_init_% # modules are handled in Makefile. We need to define it to keep the list the # same for now. We should be able to remove it later on. @@ -43,6 +51,11 @@ config MODULE_PERIPH_INIT_GPIO_FAST_READ default y if MODULE_PERIPH_INIT depends on MODULE_PERIPH_GPIO_FAST_READ +config MODULE_PERIPH_INIT_GPIO_TAMPER_WAKE + bool "Auto initialize tamper detection" + default y if MODULE_PERIPH_INIT + depends on MODULE_PERIPH_GPIO_TAMPER_WAKE + endif # MODULE_PERIPH_GPIO osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.gpio" diff --git a/tests/periph_gpio/Kconfig b/tests/periph_gpio/Kconfig index 7bb0ceb3d3..6afcd6bde7 100644 --- a/tests/periph_gpio/Kconfig +++ b/tests/periph_gpio/Kconfig @@ -10,4 +10,5 @@ config APPLICATION default y imply MODULE_PERIPH_GPIO_IRQ imply MODULE_PERIPH_GPIO_FAST_READ + imply MODULE_PERIPH_GPIO_TAMPER_WAKE depends on TEST_KCONFIG From 9d5e2b808cb059a1cbe3851e6952b29b2d0ca6be Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Fri, 26 Nov 2021 09:20:56 +0100 Subject: [PATCH 5/7] boards/avr_rss2: Use at24mac for mtd in make --- boards/avr-rss2/Makefile.dep | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/avr-rss2/Makefile.dep b/boards/avr-rss2/Makefile.dep index b0be5a94c2..0face22e34 100644 --- a/boards/avr-rss2/Makefile.dep +++ b/boards/avr-rss2/Makefile.dep @@ -7,6 +7,10 @@ ifneq (,$(filter eui_provider,$(USEMODULE))) USEMODULE += at24mac endif +ifneq (,$(filter mtd,$(USEMODULE))) + USEMODULE += mtd_at24cxxx at24mac +endif + ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += bme280_i2c USEMODULE += saul_gpio From c26640e82de3fa418056fb7c9e73dbb3de814fc2 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Fri, 26 Nov 2021 09:22:47 +0100 Subject: [PATCH 6/7] boards/adafruit-itsybitsy-m4: Model mtd_spi_nor in kconfig --- boards/adafruit-itsybitsy-m4/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/adafruit-itsybitsy-m4/Kconfig b/boards/adafruit-itsybitsy-m4/Kconfig index f20e9f900c..1a1ff60fb4 100644 --- a/boards/adafruit-itsybitsy-m4/Kconfig +++ b/boards/adafruit-itsybitsy-m4/Kconfig @@ -22,3 +22,7 @@ config BOARD_ADAFRUIT_ITSYBITSY_M4 select HAS_PERIPH_TIMER select HAS_PERIPH_UART select HAS_PERIPH_USBDEV + + select HAVE_MTD_SPI_NOR + # This specific board requires SPI_ON_QSPI for the MTD_SPI_NOR + select MODULE_PERIPH_SPI_ON_QSPI if MODULE_MTD_SPI_NOR From 1b3374ca25a522af2dd12c8cb2e246141e2fac48 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Fri, 26 Nov 2021 11:05:32 +0100 Subject: [PATCH 7/7] .murdock: Add same54-xpro to kconfig test --- .murdock | 1 + 1 file changed, 1 insertion(+) diff --git a/.murdock b/.murdock index 83e9af110c..f53826b666 100755 --- a/.murdock +++ b/.murdock @@ -39,6 +39,7 @@ nucleo-l433rc nucleo-l552ze-q p-nucleo-wb55 remote-revb +same54-xpro samr21-xpro seeedstudio-gd32 slstk3400a