This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 8dca62f8f974a137263f3df64b1b96e9ad1f227d
Author: Tiago Medicci Serrano <[email protected]>
AuthorDate: Mon May 6 09:54:51 2024 -0300

    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.
---
 boards/xtensa/esp32s3/esp32s3-box/Kconfig    | 4 ++++
 boards/xtensa/esp32s3/esp32s3-devkit/Kconfig | 4 ++++
 boards/xtensa/esp32s3/esp32s3-eye/Kconfig    | 4 ++++
 boards/xtensa/esp32s3/esp32s3-lcd-ev/Kconfig | 4 ++++
 boards/xtensa/esp32s3/esp32s3-meadow/Kconfig | 4 ++++
 5 files changed, 20 insertions(+)

diff --git a/boards/xtensa/esp32s3/esp32s3-box/Kconfig 
b/boards/xtensa/esp32s3/esp32s3-box/Kconfig
index 9d021c1718..b47e2effcc 100644
--- a/boards/xtensa/esp32s3/esp32s3-box/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-box/Kconfig
@@ -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.
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/Kconfig 
b/boards/xtensa/esp32s3/esp32s3-devkit/Kconfig
index a16b296840..b468f0fa5a 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/Kconfig
@@ -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.
diff --git a/boards/xtensa/esp32s3/esp32s3-eye/Kconfig 
b/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
index 51df4a13d5..175d4960b8 100644
--- a/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-eye/Kconfig
@@ -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.
diff --git a/boards/xtensa/esp32s3/esp32s3-lcd-ev/Kconfig 
b/boards/xtensa/esp32s3/esp32s3-lcd-ev/Kconfig
index 3d26b68551..bcfaffaf9c 100644
--- a/boards/xtensa/esp32s3/esp32s3-lcd-ev/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-lcd-ev/Kconfig
@@ -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.
diff --git a/boards/xtensa/esp32s3/esp32s3-meadow/Kconfig 
b/boards/xtensa/esp32s3/esp32s3-meadow/Kconfig
index 3d5cc808aa..f4c4c26ade 100644
--- a/boards/xtensa/esp32s3/esp32s3-meadow/Kconfig
+++ b/boards/xtensa/esp32s3/esp32s3-meadow/Kconfig
@@ -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.

Reply via email to