esp32s3: Limit MTD partition size according to the flash size

Whenever a MTD partition is set, this change limits its size
according to the flash size, avoiding the MTD partition to be
greater than the actual flash size.
This commit is contained in:
Tiago Medicci Serrano 2024-05-06 09:54:51 -03:00 committed by Xiang Xiao
parent bc4a020146
commit 8dca62f8f9
5 changed files with 20 additions and 0 deletions

View file

@ -27,6 +27,10 @@ config ESP32S3_STORAGE_MTD_OFFSET
config ESP32S3_STORAGE_MTD_SIZE
hex "Storage MTD size in SPI Flash"
default 0x100000
range 0x0 0x400000 if ESP32S3_FLASH_4M
range 0x0 0x800000 if ESP32S3_FLASH_8M
range 0x0 0x1000000 if ESP32S3_FLASH_16M
range 0x0 0x2000000 if ESP32S3_FLASH_32M
depends on ESP32S3_MTD
---help---
MTD size in SPI Flash.

View file

@ -27,6 +27,10 @@ config ESP32S3_STORAGE_MTD_OFFSET
config ESP32S3_STORAGE_MTD_SIZE
hex "Storage MTD size in SPI Flash"
default 0x100000
range 0x0 0x400000 if ESP32S3_FLASH_4M
range 0x0 0x800000 if ESP32S3_FLASH_8M
range 0x0 0x1000000 if ESP32S3_FLASH_16M
range 0x0 0x2000000 if ESP32S3_FLASH_32M
depends on ESP32S3_MTD
---help---
MTD size in SPI Flash.

View file

@ -15,6 +15,10 @@ config ESP32S3_STORAGE_MTD_OFFSET
config ESP32S3_STORAGE_MTD_SIZE
hex "Storage MTD size in SPI Flash"
default 0x100000
range 0x0 0x400000 if ESP32S3_FLASH_4M
range 0x0 0x800000 if ESP32S3_FLASH_8M
range 0x0 0x1000000 if ESP32S3_FLASH_16M
range 0x0 0x2000000 if ESP32S3_FLASH_32M
depends on ESP32S3_MTD
---help---
MTD size in SPI Flash.

View file

@ -16,6 +16,10 @@ config ESP32S3_STORAGE_MTD_OFFSET
config ESP32S3_STORAGE_MTD_SIZE
hex "Storage MTD size in SPI Flash"
default 0x100000
range 0x0 0x400000 if ESP32S3_FLASH_4M
range 0x0 0x800000 if ESP32S3_FLASH_8M
range 0x0 0x1000000 if ESP32S3_FLASH_16M
range 0x0 0x2000000 if ESP32S3_FLASH_32M
depends on ESP32S3_MTD
---help---
MTD size in SPI Flash.

View file

@ -15,6 +15,10 @@ config ESP32S3_STORAGE_MTD_OFFSET
config ESP32S3_STORAGE_MTD_SIZE
hex "Storage MTD size in SPI Flash"
default 0x100000
range 0x0 0x400000 if ESP32S3_FLASH_4M
range 0x0 0x800000 if ESP32S3_FLASH_8M
range 0x0 0x1000000 if ESP32S3_FLASH_16M
range 0x0 0x2000000 if ESP32S3_FLASH_32M
depends on ESP32S3_MTD
---help---
MTD size in SPI Flash.