Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend ESP image load header #83611

Merged
merged 2 commits into from
Jan 13, 2025
Merged
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
33 changes: 25 additions & 8 deletions soc/espressif/esp32/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,41 @@ SECTIONS
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.end) + SIZEOF(.dram0.end) - LOADADDR(.dram0.data))

/* RTC_TEXT metadata:
* 8. Destination address (VMA) for RTC_TEXT region
* 9. Flash offset (LMA) for start of RTC_TEXT region
* 10. Size of RTC region
/* RTC_IRAM metadata:
* 8. Destination address (VMA) for RTC_IRAM region
* 9. Flash offset (LMA) for start of RTC_IRAM region
* 10. Size of RTC_IRAM region
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))

/* RTC_DATA metadata:
* 11. Destination address (VMA) for RTC_DATA region
* 12. Flash offset (LMA) for start of RTC_DATA region
* 13. Size of RTC region
/* RTC_DRAM metadata:
* 11. Destination address (VMA) for RTC_DRAM region
* 12. Flash offset (LMA) for start of RTC_DRAM region
* 13. Size of RTC_DRAM region
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
40 changes: 38 additions & 2 deletions soc/espressif/esp32c2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ MEMORY
{
#ifdef CONFIG_BOOTLOADER_MCUBOOT
mcuboot_hdr (R): org = 0x0, len = 0x20
metadata (R): org = 0x20, len = 0x20
FLASH (R): org = 0x40, len = FLASH_SIZE - 0x40
metadata (R): org = 0x20, len = 0x60
FLASH (R): org = 0x80, len = FLASH_SIZE - 0x80
#else
/* Make safety margin in the FLASH memory size so the
* (esp_img_header + (n*esp_seg_headers)) would fit */
Expand Down Expand Up @@ -124,6 +124,42 @@ SECTIONS
LONG(ADDR(.dram0.data))
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.end) - LOADADDR(.dram0.data))

/* LP_IRAM metadata - There is no RTC/LP memory!
* 8. Destination address (VMA) for LP_IRAM region
* 9. Flash offset (LMA) for start of LP_IRAM region
* 10. Size of LP_IRAM region
*/
LONG(0x0)
LONG(0x0)
LONG(0x0)

/* LP_DRAM metadata - There is no RTC/LP memory!
* 11. Destination address (VMA) for LP_DRAM region
* 12. Flash offset (LMA) for start of LP_DRAM region
* 13. Size of LP_DRAM region
*/
LONG(0x0)
LONG(0x0)
LONG(0x0)

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
34 changes: 26 additions & 8 deletions soc/espressif/esp32c3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,41 @@ SECTIONS
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.end) - LOADADDR(.dram0.data))

/* RTC_TEXT metadata:
* 8. Destination address (VMA) for RTC_TEXT region
* 9. Flash offset (LMA) for start of RTC_TEXT region
* 10. Size of RTC region
/* RTC_IRAM metadata:
* 8. Destination address (VMA) for RTC_IRAM region
* 9. Flash offset (LMA) for start of RTC_IRAM region
* 10. Size of RTC_IRAM region
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))

/* RTC_DATA metadata:
* 11. Destination address (VMA) for RTC_DATA region
* 12. Flash offset (LMA) for start of RTC_DATA region
* 13. Size of RTC region
/* RTC_DRAM metadata:
* 11. Destination address (VMA) for RTC_DRAM region
* 12. Flash offset (LMA) for start of RTC_DRAM region
* 13. Size of RTC_DRAM region
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
26 changes: 21 additions & 5 deletions soc/espressif/esp32c6/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,41 @@ SECTIONS
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.end) - LOADADDR(.dram0.data))


/* LP_IRAM metadata:
* 8. Destination address (VMA) for LP_IRAM region
* 9. Flash offset (LMA) for start of LP_IRAM region
* 10. Size of RTC region
* 10. Size of LP_IRAM region
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))

/* LP_DATA metadata:
* 11. Destination address (VMA) for LP_DATA region
* 12. Flash offset (LMA) for start of LP_DATA region
* 13. Size of RTC region
* 11. Destination address (VMA) for LP_DRAM region
* 12. Flash offset (LMA) for start of LP_DRAM region
* 13. Size of LP_DRAM region
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
33 changes: 25 additions & 8 deletions soc/espressif/esp32s2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,41 @@ SECTIONS
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.data_end) - LOADADDR(.dram0.data))

/* RTC_TEXT metadata:
* 8. Destination address (VMA) for RTC_TEXT region
* 9. Flash offset (LMA) for start of RTC_TEXT region
* 10. Size of RTC region
/* RTC_IRAM metadata:
* 8. Destination address (VMA) for RTC_IRAM region
* 9. Flash offset (LMA) for start of RTC_IRAM region
* 10. Size of RTC_IRAM region
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))

/* RTC_DATA metadata:
* 11. Destination address (VMA) for RTC_DATA region
* 12. Flash offset (LMA) for start of RTC_DATA region
* 13. Size of RTC region
/* RTC_DRAM metadata:
* 11. Destination address (VMA) for RTC_DRAM region
* 12. Flash offset (LMA) for start of RTC_DRAM region
* 13. Size of RTC_DRAM region
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
41 changes: 29 additions & 12 deletions soc/espressif/esp32s3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ procpu_dram_len = procpu_dram_end - procpu_dram_org;
MEMORY
{
#ifdef CONFIG_BOOTLOADER_MCUBOOT
mcuboot_hdr (R): org = 0x0, len = 0x20
metadata (R): org = 0x20, len = 0x60
FLASH (R): org = 0x80, len = FLASH_SIZE - 0x80
mcuboot_hdr (R): org = 0x0, len = 0x20
metadata (R): org = 0x20, len = 0x60
FLASH (R): org = 0x80, len = FLASH_SIZE - 0x80
#else
/* Make safety margin in the FLASH memory size so the
* (esp_img_header + (n*esp_seg_headers)) would fit */
FLASH (R): org = 0x0, len = FLASH_SIZE - 0x100
FLASH (R): org = 0x0, len = FLASH_SIZE - 0x100
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

iram0_0_seg(RX): org = procpu_iram_org, len = procpu_iram_len
Expand Down Expand Up @@ -149,24 +149,41 @@ SECTIONS
LONG(LOADADDR(.dram0.data))
LONG(LOADADDR(.dram0.end) + SIZEOF(.dram0.end) - LOADADDR(.dram0.data))

/* RTC_TEXT metadata:
* 8. Destination address (VMA) for RTC_TEXT region
* 9. Flash offset (LMA) for start of RTC_TEXT region
* 10. Size of RTC region
/* RTC_IRAM metadata:
* 8. Destination address (VMA) for RTC_IRAM region
* 9. Flash offset (LMA) for start of RTC_IRAM region
* 10. Size of RTC_IRAM region
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))

/* RTC_DATA metadata:
* 11. Destination address (VMA) for RTC_DATA region
* 12. Flash offset (LMA) for start of RTC_DATA region
* 13. Size of RTC region
/* RTC_DRAM metadata:
* 11. Destination address (VMA) for RTC_DRAM region
* 12. Flash offset (LMA) for start of RTC_DRAM region
* 13. Size of RTC_DRAM region
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))

/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))

/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
} > metadata
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ manifest:
groups:
- hal
- name: hal_espressif
revision: 5a10d43ab93cec542e59f0db3e33b60b9c442670
revision: 51bf6d7bb2ee053e52f09709097e2444777c868c
path: modules/hal/espressif
west-commands: west/west-commands.yml
groups:
Expand Down
Loading