From 4e8bc78307887a861bde369389205609e9015f3c Mon Sep 17 00:00:00 2001 From: Filipe Cavalcanti Date: Mon, 16 Mar 2026 16:31:22 -0300 Subject: [PATCH] boards/risc-v: add option to disable SPI Flash MTD automatic bringup The ESPRESSIF_SPIFLASH_AUTO_BRINGUP option allows disabling automatic bringup. This causes /dev/mtdblock0 to show up instead of always mounting a file system. Signed-off-by: Filipe Cavalcanti --- boards/risc-v/esp32c3/common/Kconfig | 14 +++++++++++--- boards/risc-v/esp32c6/common/Kconfig | 14 +++++++++++--- boards/risc-v/esp32h2/common/Kconfig | 14 +++++++++++--- boards/risc-v/esp32p4/common/Kconfig | 14 +++++++++++--- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/boards/risc-v/esp32c3/common/Kconfig b/boards/risc-v/esp32c3/common/Kconfig index c55d3ebfbe4..6d2c5f9495e 100644 --- a/boards/risc-v/esp32c3/common/Kconfig +++ b/boards/risc-v/esp32c3/common/Kconfig @@ -12,10 +12,18 @@ config ESPRESSIF_MERGE_BINS This is only useful when the path to binary files (e.g. bootloader) is provided via the ESPTOOL_BINDIR variable. -choice ESPRESSIF_SPIFLASH_FS - prompt "Mount SPI Flash MTD on bring-up" - default ESPRESSIF_SPIFLASH_SMARTFS +config ESPRESSIF_SPIFLASH_AUTO_BRINGUP + bool "Automatic mount of SPI Flash MTD" + default y depends on ESPRESSIF_MTD + ---help--- + Auto bring-up the SPI Flash MTD on board bring-up. + If not selected, the MTD will be registered as a device node on /dev. + +choice ESPRESSIF_SPIFLASH_FS + prompt "File system to mount on SPI Flash MTD" + default ESPRESSIF_SPIFLASH_SMARTFS + depends on ESPRESSIF_SPIFLASH_AUTO_BRINGUP optional ---help--- Mount the SPI Flash MTD with the selected File System format on board diff --git a/boards/risc-v/esp32c6/common/Kconfig b/boards/risc-v/esp32c6/common/Kconfig index 7bd5f5ccbf5..d3be4c5db47 100644 --- a/boards/risc-v/esp32c6/common/Kconfig +++ b/boards/risc-v/esp32c6/common/Kconfig @@ -12,10 +12,18 @@ config ESPRESSIF_MERGE_BINS This is only useful when the path to binary files (e.g. bootloader) is provided via the ESPTOOL_BINDIR variable. -choice ESPRESSIF_SPIFLASH_FS - prompt "Mount SPI Flash MTD on bring-up" - default ESPRESSIF_SPIFLASH_SMARTFS +config ESPRESSIF_SPIFLASH_AUTO_BRINGUP + bool "Automatic mount of SPI Flash MTD" + default y depends on ESPRESSIF_MTD + ---help--- + Auto bring-up the SPI Flash MTD on board bring-up. + If not selected, the MTD will be registered as a device node on /dev. + +choice ESPRESSIF_SPIFLASH_FS + prompt "File system to mount on SPI Flash MTD" + default ESPRESSIF_SPIFLASH_SMARTFS + depends on ESPRESSIF_SPIFLASH_AUTO_BRINGUP optional ---help--- Mount the SPI Flash MTD with the selected File System format on board diff --git a/boards/risc-v/esp32h2/common/Kconfig b/boards/risc-v/esp32h2/common/Kconfig index c55d3ebfbe4..6d2c5f9495e 100644 --- a/boards/risc-v/esp32h2/common/Kconfig +++ b/boards/risc-v/esp32h2/common/Kconfig @@ -12,10 +12,18 @@ config ESPRESSIF_MERGE_BINS This is only useful when the path to binary files (e.g. bootloader) is provided via the ESPTOOL_BINDIR variable. -choice ESPRESSIF_SPIFLASH_FS - prompt "Mount SPI Flash MTD on bring-up" - default ESPRESSIF_SPIFLASH_SMARTFS +config ESPRESSIF_SPIFLASH_AUTO_BRINGUP + bool "Automatic mount of SPI Flash MTD" + default y depends on ESPRESSIF_MTD + ---help--- + Auto bring-up the SPI Flash MTD on board bring-up. + If not selected, the MTD will be registered as a device node on /dev. + +choice ESPRESSIF_SPIFLASH_FS + prompt "File system to mount on SPI Flash MTD" + default ESPRESSIF_SPIFLASH_SMARTFS + depends on ESPRESSIF_SPIFLASH_AUTO_BRINGUP optional ---help--- Mount the SPI Flash MTD with the selected File System format on board diff --git a/boards/risc-v/esp32p4/common/Kconfig b/boards/risc-v/esp32p4/common/Kconfig index c55d3ebfbe4..6d2c5f9495e 100644 --- a/boards/risc-v/esp32p4/common/Kconfig +++ b/boards/risc-v/esp32p4/common/Kconfig @@ -12,10 +12,18 @@ config ESPRESSIF_MERGE_BINS This is only useful when the path to binary files (e.g. bootloader) is provided via the ESPTOOL_BINDIR variable. -choice ESPRESSIF_SPIFLASH_FS - prompt "Mount SPI Flash MTD on bring-up" - default ESPRESSIF_SPIFLASH_SMARTFS +config ESPRESSIF_SPIFLASH_AUTO_BRINGUP + bool "Automatic mount of SPI Flash MTD" + default y depends on ESPRESSIF_MTD + ---help--- + Auto bring-up the SPI Flash MTD on board bring-up. + If not selected, the MTD will be registered as a device node on /dev. + +choice ESPRESSIF_SPIFLASH_FS + prompt "File system to mount on SPI Flash MTD" + default ESPRESSIF_SPIFLASH_SMARTFS + depends on ESPRESSIF_SPIFLASH_AUTO_BRINGUP optional ---help--- Mount the SPI Flash MTD with the selected File System format on board