Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/espressif/esp32_devkitc/esp32_devkitc_procpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- counter
- entropy
- input
- retained_mem
vendor: espressif
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ supported:
- nvs
- pwm
- i2s
- retained_mem
vendor: espressif
1 change: 1 addition & 0 deletions boards/espressif/esp32c3_devkitc/esp32c3_devkitc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ supported:
- spi
- counter
- entropy
- retained_mem
vendor: espressif
1 change: 1 addition & 0 deletions boards/espressif/esp32c3_devkitm/esp32c3_devkitm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ supported:
- spi
- counter
- entropy
- retained_mem
vendor: espressif
1 change: 1 addition & 0 deletions boards/espressif/esp32c3_rust/esp32c3_rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- spi
- counter
- entropy
- retained_mem
vendor: espressif
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- i2c
- i2s
- netif:openthread
- retained_mem

testing:
ignore_tags:
Expand Down
1 change: 1 addition & 0 deletions boards/espressif/esp32h2_devkitm/esp32h2_devkitm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ supported:
- i2c
- i2s
- netif:openthread
- retained_mem
1 change: 1 addition & 0 deletions boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ supported:
- input
- can
- dma
- retained_mem
testing:
ignore_tags:
- bluetooth
Expand Down
1 change: 1 addition & 0 deletions boards/espressif/esp32s2_saola/esp32s2_saola.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- counter
- entropy
- input
- retained_mem
testing:
ignore_tags:
- bluetooth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ supported:
- pwm
- dma
- input
- retained_mem
vendor: espressif
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- dma
- input
- video
- retained_mem
vendor: espressif
1 change: 1 addition & 0 deletions boards/espressif/esp32s3_eye/esp32s3_eye_procpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- dma
- input
- video
- retained_mem
vendor: espressif
1 change: 1 addition & 0 deletions boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ supported:
- spi
- counter
- entropy
- retained_mem
vendor: espressif
6 changes: 6 additions & 0 deletions dts/riscv/espressif/esp32c3/esp32c3_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
zephyr,memory-region = "SRAM1";
};

rtc_fast_ram: memory@50000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x50000000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_FAST_RAM";
};

intc: interrupt-controller@600c2000 {
compatible = "espressif,esp32-intc";
#address-cells = <0>;
Expand Down
2 changes: 1 addition & 1 deletion dts/riscv/espressif/esp32c6/esp32c6_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#address-cells = <1>;
#size-cells = <1>;
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x50000000 DT_SIZE_K(16)>;
reg = <0x50000000 (DT_SIZE_K(16) - 0x10)>;
zephyr,memory-region = "SRAMLP ";

shmlp: memory@50003fe0 {
Expand Down
12 changes: 12 additions & 0 deletions dts/xtensa/espressif/esp32/esp32_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@
};
};

rtc_fast_ram: memory@3ff80000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x3ff80000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_FAST_RAM";
};

rtc_slow_ram: memory@50000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x50000000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_SLOW_RAM";
};

icache0: icache0@400d0000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x400d0000 DT_SIZE_K(11456)>;
Expand Down
12 changes: 12 additions & 0 deletions dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@
};
};

rtc_fast_ram: memory@3ff9e000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x3ff9e000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_FAST_RAM";
};

rtc_slow_ram: memory@50000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x50000000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_SLOW_RAM";
};

icache0: icache0@40080000 {
compatible = "zephyr,memory-region";
reg = <0x40080000 DT_SIZE_K(7680)>;
Expand Down
12 changes: 12 additions & 0 deletions dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@
#mbox-cells = <1>;
};

rtc_slow_ram: memory@50000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x50000000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_SLOW_RAM";
};

rtc_fast_ram: memory@600fe000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x600fe000 DT_SIZE_K(8)>;
zephyr,memory-region = "RTC_FAST_RAM";
};

intc: interrupt-controller@600c2000 {
#interrupt-cells = <3>;
#address-cells = <0>;
Expand Down
16 changes: 12 additions & 4 deletions soc/espressif/esp32/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ procpu_ext_ram_org = DCACHE1_START;
procpu_ext_ram_len = DCACHE1_SIZE;
#endif

/* RTC RAM memory segments */
rtc_slow_org = RCT_SLOW_RAM_START;
rtc_slow_len = RCT_SLOW_RAM_SIZE;
rtc_data_org = RCT_FAST_RAM_START;
rtc_data_len = RCT_FAST_RAM_SIZE;
rtc_iram_org = RCT_FAST_RAM_START + 0x140000;
rtc_iram_len = RCT_FAST_RAM_SIZE;

/* Aliases */
#define FLASH_CODE_REGION irom0_0_seg
#define RODATA_REGION drom0_0_seg
Expand Down Expand Up @@ -87,9 +95,9 @@ MEMORY
irom0_0_seg(RX): org = procpu_irom_org, len = procpu_irom_len
drom0_0_seg(R): org = procpu_drom_org, len = procpu_drom_len

rtc_iram_seg(RWX): org = 0x400c0000, len = 0x2000
rtc_slow_seg(RW): org = 0x50000000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
rtc_data_seg(RW): org = 0x3ff80000, len = 0x2000
rtc_iram_seg(RWX): org = rtc_iram_org, len = rtc_iram_len
rtc_slow_seg(RW): org = rtc_slow_org, len = rtc_slow_len - CONFIG_RESERVE_RTC_MEM
rtc_data_seg(RW): org = rtc_data_org, len = rtc_data_len

/* We reduced the size of rtc_slow_seg by CONFIG_RESERVE_RTC_MEM value.
* It reserves the amount of RTC slow memory that we use for this memory segment.
Expand All @@ -98,7 +106,7 @@ MEMORY
* org = 0x50000000 + 0x2000 - CONFIG_RESERVE_RTC_MEM
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
rtc_slow_reserved_seg(RW): org = 0x50000000 + 0x2000 - CONFIG_RESERVE_RTC_MEM,
rtc_slow_reserved_seg(RW): org = rtc_slow_org + rtc_slow_len - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif

Expand Down
8 changes: 8 additions & 0 deletions soc/espressif/esp32/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
#define SRAM2_DRAM_USER_START (SRAM2_DRAM_START + SRAM2_DRAM_SHM_SIZE)
#define SRAM2_DRAM_USER_SIZE (SRAM2_DRAM_END - SRAM2_DRAM_USER_START)

/* RTC SLOW RAM (8kB) */
#define RCT_SLOW_RAM_START DT_REG_ADDR(DT_NODELABEL(rtc_slow_ram))
#define RCT_SLOW_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(rtc_slow_ram))

/* RTC FAST RAM (8kB) */
#define RCT_FAST_RAM_START DT_REG_ADDR(DT_NODELABEL(rtc_fast_ram))
#define RCT_FAST_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(rtc_fast_ram))

/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
*
Expand Down
8 changes: 6 additions & 2 deletions soc/espressif/esp32c3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ user_idram_size = (user_dram_end - user_dram_seg_org);
user_iram_seg_len = user_idram_size;
user_dram_seg_len = user_idram_size;

/* RTC RAM memory segment */
rtc_iram_org = RCT_FAST_RAM_START;
rtc_iram_len = RCT_FAST_RAM_SIZE;

/* Aliases */
#define FLASH_CODE_REGION irom0_0_seg
#define RODATA_REGION drom0_0_seg
Expand Down Expand Up @@ -73,7 +77,7 @@ MEMORY
irom0_0_seg(RX): org = IROM_SEG_ORG, len = IROM_SEG_LEN
drom0_0_seg (R): org = DROM_SEG_ORG, len = DROM_SEG_LEN

rtc_iram_seg(RWX): org = 0x50000000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
rtc_iram_seg(RWX): org = rtc_iram_org, len = rtc_iram_len - CONFIG_RESERVE_RTC_MEM

/* We reduced the size of rtc_iram_seg by CONFIG_RESERVE_RTC_MEM value.
It reserves the amount of RTC fast memory that we use for this memory segment.
Expand All @@ -82,7 +86,7 @@ MEMORY
The aim of this is to keep data that will not be moved around and have a fixed address.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
rtc_reserved_seg(RW): org = 0x50000000 + 0x2000 - CONFIG_RESERVE_RTC_MEM,
rtc_reserved_seg(RW): org = rtc_iram_org + rtc_iram_len - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif

Expand Down
3 changes: 3 additions & 0 deletions soc/espressif/esp32c3/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#define SRAM1_SIZE DT_REG_SIZE(DT_NODELABEL(sram1))
/* ICache size is fixed to 16KB on ESP32-C3 */
#define ICACHE_SIZE SRAM0_SIZE
/* RTC FAST RAM (8kB) */
#define RCT_FAST_RAM_START DT_REG_ADDR(DT_NODELABEL(rtc_fast_ram))
#define RCT_FAST_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(rtc_fast_ram))

/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
Expand Down
17 changes: 11 additions & 6 deletions soc/espressif/esp32c6/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ MEMORY
drom0_0_seg(R): org = DROM_SEG_ORG, len = DROM_SEG_LEN

#if CONFIG_ULP_COPROC_ENABLED
lp_ram_seg(RW): org = LPSRAM_IRAM_START + ULP_COPROC_RESERVE_MEM,
len = LPSRAM_SIZE - ULP_COPROC_RESERVE_MEM - CONFIG_RESERVE_RTC_MEM
lp_ram_seg(RW): org = LPSRAM_IRAM_START + ULP_COPROC_RESERVE_MEM,
len = LPSRAM_SIZE - ULP_COPROC_RESERVE_MEM - CONFIG_RESERVE_RTC_MEM
#else
lp_ram_seg(RW): org = LPSRAM_IRAM_START,
len = 0x4000 - CONFIG_RESERVE_RTC_MEM
lp_ram_seg(RW): org = LPSRAM_IRAM_START,
len = LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM
#endif
/* We reduced the size of lp_ram_seg by CONFIG_RESERVE_RTC_MEM value.
It reserves the amount of LP memory that we use for this memory segment.
Expand All @@ -82,8 +82,13 @@ MEMORY
The aim of this is to keep data that will not be moved around and have a fixed address.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
lp_reserved_seg(RW) : org = LPSRAM_IRAM_START + 0x4000 - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#if CONFIG_ULP_COPROC_ENABLED
lp_reserved_seg(RW): org = LPSRAM_IRAM_START + LPSRAM_SIZE - ULP_COPROC_RESERVE_MEM - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#else
lp_reserved_seg(RW): org = LPSRAM_IRAM_START + LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif
#endif

#ifdef CONFIG_GEN_ISR_TABLES
Expand Down
8 changes: 4 additions & 4 deletions soc/espressif/esp32h2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ MEMORY
irom0_0_seg(RX): org = IROM_SEG_ORG, len = IROM_SEG_LEN
drom0_0_seg(R): org = DROM_SEG_ORG, len = DROM_SEG_LEN

lp_ram_seg(RW): org = LPSRAM_IRAM_START,
len = LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM
lp_ram_seg(RW): org = LPSRAM_IRAM_START,
len = LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM

/* We reduced the size of lp_ram_seg by CONFIG_RESERVE_RTC_MEM value.
It reserves the amount of LP memory that we use for this memory segment.
Expand All @@ -78,8 +78,8 @@ MEMORY
The aim of this is to keep data that will not be moved around and have a fixed address.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
lp_reserved_seg(RW) : org = LPSRAM_IRAM_START + LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
lp_reserved_seg(RW): org = LPSRAM_IRAM_START + LPSRAM_SIZE - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif

#ifdef CONFIG_GEN_ISR_TABLES
Expand Down
16 changes: 12 additions & 4 deletions soc/espressif/esp32s2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ ext_ram_org = DCACHE1_START;
ext_ram_len = DCACHE1_SIZE;
#endif

/* RTC RAM memory segments */
rtc_slow_org = RCT_SLOW_RAM_START;
rtc_slow_len = RCT_SLOW_RAM_SIZE;
rtc_data_org = RCT_FAST_RAM_START;
rtc_data_len = RCT_FAST_RAM_SIZE;
rtc_iram_org = RCT_FAST_RAM_START + 0xd2000;
rtc_iram_len = RCT_FAST_RAM_SIZE;

/* Aliases */
#define FLASH_CODE_REGION irom0_0_seg
#define RODATA_REGION drom0_0_seg
Expand Down Expand Up @@ -83,9 +91,9 @@ MEMORY
irom0_0_seg(RX): org = user_irom_org, len = user_irom_len
drom0_0_seg(R): org = user_drom_org, len = user_drom_len

rtc_iram_seg(RWX): org = 0x40070000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
rtc_slow_seg(RW): org = 0x50000000, len = 0x2000
rtc_data_seg(RW) : org = 0x3ff9e000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
rtc_iram_seg(RWX): org = rtc_iram_org, len = rtc_iram_len - CONFIG_RESERVE_RTC_MEM
rtc_slow_seg(RW): org = rtc_slow_org, len = rtc_slow_len
rtc_data_seg(RW): org = rtc_data_org, len = rtc_data_len - CONFIG_RESERVE_RTC_MEM

/* We reduced the size of rtc_data_seg and rtc_iram_seg by CONFIG_RESERVE_RTC_MEM value.
It reserves the amount of RTC fast memory that we use for this memory segment.
Expand All @@ -95,7 +103,7 @@ MEMORY
The aim of this is to keep data that will not be moved around and have a fixed address.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
rtc_reserved_seg(RW): org = 0x3ff9e000 + 0x2000 - CONFIG_RESERVE_RTC_MEM,
rtc_reserved_seg(RW): org = rtc_data_org + rtc_data_len - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif

Expand Down
8 changes: 8 additions & 0 deletions soc/espressif/esp32s2/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
#define SRAM_DRAM_START DT_REG_ADDR(DT_NODELABEL(sram0))
#define SRAM_CACHE_SIZE (CONFIG_ESP32S2_INSTRUCTION_CACHE_SIZE + CONFIG_ESP32S2_DATA_CACHE_SIZE)

/* RTC SLOW RAM (8k) */
#define RCT_SLOW_RAM_START DT_REG_ADDR(DT_NODELABEL(rtc_slow_ram))
#define RCT_SLOW_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(rtc_slow_ram))

/* RTC FAST RAM (8k) */
#define RCT_FAST_RAM_START DT_REG_ADDR(DT_NODELABEL(rtc_fast_ram))
#define RCT_FAST_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(rtc_fast_ram))

/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
*
Expand Down
12 changes: 9 additions & 3 deletions soc/espressif/esp32s3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ procpu_ext_iram_org = procpu_irom_org;
procpu_ext_iram_len = CONFIG_ESP_SPIRAM_SIZE;
#endif

/* RTC RAM memory segments */
rtc_iram_org = RCT_FAST_RAM_START;
rtc_iram_len = RCT_FAST_RAM_SIZE;
rtc_slow_org = RCT_SLOW_RAM_START;
rtc_slow_len = RCT_SLOW_RAM_SIZE;

/* Aliases */
#define FLASH_CODE_REGION irom0_0_seg
#define RODATA_REGION drom0_0_seg
Expand Down Expand Up @@ -95,7 +101,7 @@ MEMORY
#endif

/* RTC fast memory (executable). Persists over deep sleep. */
rtc_iram_seg(RWX): org = 0x600fe000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
rtc_iram_seg(RWX): org = rtc_iram_org, len = rtc_iram_len - CONFIG_RESERVE_RTC_MEM

/* We reduced the size of rtc_iram_seg by CONFIG_RESERVE_RTC_MEM value.
* It reserves the amount of RTC fast memory that we use for this memory segment.
Expand All @@ -105,12 +111,12 @@ MEMORY
* The aim of this is to keep data that will not be moved around and have a fixed address.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
rtc_reserved_seg(RW): org = 0x600fe000 + 0x2000 - CONFIG_RESERVE_RTC_MEM,
rtc_reserved_seg(RW): org = rtc_iram_org + rtc_iram_len - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif

/* RTC slow memory (data accessible). Persists over deep sleep. */
rtc_slow_seg(RW): org = 0x50000000, len = 0x2000
rtc_slow_seg(RW): org = rtc_slow_org, len = rtc_slow_len

#ifdef CONFIG_GEN_ISR_TABLES
IDT_LIST(RW): org = 0x3ebfe010, len = 0x2000
Expand Down
Loading