From d0679af1d8724f474aa988de28a3f82282332a1e Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Wed, 15 Mar 2023 09:19:35 -0300 Subject: [PATCH] risc-v/espressif: Decouple irom/drom lengths from External Flash size The length of the IROM and DROM segments should be related to the extent of the address space, and not be limited to the capacity of the External Flash device. Signed-off-by: Gustavo Henrique Nihei --- .../common/scripts/esp32c3_flat_memory.ld | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/boards/risc-v/espressif/common/scripts/esp32c3_flat_memory.ld b/boards/risc-v/espressif/common/scripts/esp32c3_flat_memory.ld index 1f49ec2444..68673670eb 100644 --- a/boards/risc-v/espressif/common/scripts/esp32c3_flat_memory.ld +++ b/boards/risc-v/espressif/common/scripts/esp32c3_flat_memory.ld @@ -48,16 +48,6 @@ #define I_D_SRAM_SIZE SRAM_DRAM_END - SRAM_DRAM_ORG -#ifdef CONFIG_ESPRESSIF_FLASH_2M -# define FLASH_SIZE 0x200000 -#elif defined (CONFIG_ESPRESSIF_FLASH_4M) -# define FLASH_SIZE 0x400000 -#elif defined (CONFIG_ESPRESSIF_FLASH_8M) -# define FLASH_SIZE 0x800000 -#elif defined (CONFIG_ESPRESSIF_FLASH_16M) -# define FLASH_SIZE 0x1000000 -#endif - MEMORY { /* Below values assume the flash cache is on, and have the blocks this @@ -77,7 +67,7 @@ MEMORY * constraint that (paddr % 64KB == vaddr % 64KB). */ - irom0_0_seg (RX) : org = 0x42000020, len = FLASH_SIZE - 0x20 + irom0_0_seg (RX) : org = 0x42000020, len = 0x800000 - 0x20 /* Shared data RAM, excluding memory reserved for ROM bss/data/stack. */ @@ -92,7 +82,7 @@ MEMORY * constraint that (paddr % 64KB == vaddr % 64KB). */ - drom0_0_seg (R) : org = 0x3c000020, len = FLASH_SIZE - 0x20 + drom0_0_seg (R) : org = 0x3c000020, len = 0x800000 - 0x20 /* RTC fast memory. Persists over deep sleep. */