Skip to content

Commit 1630b48

Browse files
fdcavalcantixiaoxiang781216
authored andcommitted
boards/xtensa: add option to disable SPI Flash MTD automatic bringup
The ESP32*_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 <filipe.cavalcanti@espressif.com>
1 parent 4e8bc78 commit 1630b48

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

boards/xtensa/esp32/common/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ config ESP32_QEMU_IMAGE
1919
---help---
2020
Create a binary flash image used for QEMU.
2121

22+
config ESP32_SPIFLASH_AUTO_BRINGUP
23+
bool "Automatic mount of SPI Flash MTD"
24+
default y
25+
depends on ESP32_SPIFLASH
26+
---help---
27+
Auto bring-up the SPI Flash MTD on board bring-up.
28+
If not selected, the MTD will be registered as a device node on /dev.
29+
2230
choice ESP32_SPIFLASH_FS
23-
prompt "Mount SPI Flash MTD on bring-up"
31+
prompt "File system to mount on SPI Flash MTD"
2432
default ESP32_SPIFLASH_SMARTFS
25-
depends on ESP32_SPIFLASH
33+
depends on ESP32_SPIFLASH_AUTO_BRINGUP
2634
optional
2735
---help---
2836
Mount the SPI Flash MTD with the selected File System format on board

boards/xtensa/esp32s2/common/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ config ESP32S2_MERGE_BINS
1212
This is only useful when the path to binary files (e.g. bootloader)
1313
is provided via the ESPTOOL_BINDIR variable.
1414

15+
config ESP32S2_SPIFLASH_AUTO_BRINGUP
16+
bool "Automatic mount of SPI Flash MTD"
17+
default y
18+
depends on ESP32S2_SPIFLASH
19+
---help---
20+
Auto bring-up the SPI Flash MTD on board bring-up.
21+
If not selected, the MTD will be registered as a device node on /dev.
22+
1523
choice ESP32S2_SPIFLASH_FS
16-
prompt "Mount SPI Flash MTD on bring-up"
24+
prompt "File system to mount on SPI Flash MTD"
1725
default ESP32S2_SPIFLASH_SMARTFS
18-
depends on ESPRESSIF_SPIFLASH
26+
depends on ESP32S2_SPIFLASH_AUTO_BRINGUP
1927
optional
2028
---help---
2129
Mount the SPI Flash MTD with the selected File System format on board

boards/xtensa/esp32s2/esp32s2-saola-1/configs/spiflash/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ CONFIG_ARCH_STACKDUMP=y
1919
CONFIG_ARCH_XTENSA=y
2020
CONFIG_BOARD_LOOPSPERMSEC=16717
2121
CONFIG_BUILTIN=y
22-
CONFIG_ESP32S2_SPIFLASH_SMARTFS=y
2322
CONFIG_ESP32S2_UART0=y
2423
CONFIG_ESPRESSIF_SPIFLASH=y
2524
CONFIG_FS_PROCFS=y

boards/xtensa/esp32s2/esp32s2-saola-1/configs/sta_softap/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ CONFIG_BOARD_LOOPSPERMSEC=16717
2222
CONFIG_BUILTIN=y
2323
CONFIG_DRIVERS_IEEE80211=y
2424
CONFIG_DRIVERS_WIRELESS=y
25-
CONFIG_ESP32S2_SPIFLASH_SPIFFS=y
2625
CONFIG_ESP32S2_UART0=y
2726
CONFIG_ESPRESSIF_SPIFLASH=y
2827
CONFIG_ESPRESSIF_WIFI=y

boards/xtensa/esp32s2/esp32s2-saola-1/configs/wifi/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ CONFIG_BOARD_LOOPSPERMSEC=16717
2222
CONFIG_BUILTIN=y
2323
CONFIG_DRIVERS_IEEE80211=y
2424
CONFIG_DRIVERS_WIRELESS=y
25-
CONFIG_ESP32S2_SPIFLASH_SPIFFS=y
2625
CONFIG_ESP32S2_UART0=y
2726
CONFIG_ESPRESSIF_SPIFLASH=y
2827
CONFIG_ESPRESSIF_WIFI=y

boards/xtensa/esp32s3/common/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,18 @@ config ESP32S3_STORAGE_MTD_SIZE
4949
---help---
5050
MTD size in SPI Flash.
5151

52+
config ESP32S3_SPIFLASH_AUTO_BRINGUP
53+
bool "Automatic mount of SPI Flash MTD"
54+
default y
55+
depends on ESP32S3_MTD
56+
---help---
57+
Auto bring-up the SPI Flash MTD on board bring-up.
58+
If not selected, the MTD will be registered as a device node on /dev.
59+
5260
choice ESP32S3_SPIFLASH_FS
53-
prompt "Mount SPI Flash MTD on bring-up"
61+
prompt "File system to mount on SPI Flash MTD"
5462
default ESP32S3_SPIFLASH_SMARTFS
55-
depends on ESP32S3_MTD
63+
depends on ESP32S3_SPIFLASH_AUTO_BRINGUP
5664
optional
5765
---help---
5866
Mount the SPI Flash MTD with the selected File System format on board

0 commit comments

Comments
 (0)