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 <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2023-03-15 09:19:35 -03:00 committed by Alan Carvalho de Assis
parent e205d790ee
commit d0679af1d8

View File

@ -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. */