1 /*
2  * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 /* Magic is derived from sha256sum of the string "espmcuboot"
10  * The application header magic must match this number
11  */
12 #define ESP_LOAD_HEADER_MAGIC 0xace637d3
13 
14 /* Load header that should be a part of application image
15  * for MCUboot-Espressif port booting.
16  */
17 typedef struct esp_image_load_header {
18     uint32_t header_magic;             /* Magic for load header */
19     uint32_t entry_addr;               /* Application entry address */
20     uint32_t iram_dest_addr;           /* Destination address(VMA) for IRAM region */
21     uint32_t iram_flash_offset;        /* Flash offset(LMA) for start of IRAM region */
22     uint32_t iram_size;                /* Size of IRAM region */
23     uint32_t dram_dest_addr;           /* Destination address(VMA) for DRAM region */
24     uint32_t dram_flash_offset;        /* Flash offset(LMA) for start of DRAM region */
25     uint32_t dram_size;                /* Size of DRAM region */
26     uint32_t lp_rtc_iram_dest_addr;    /* Destination address (VMA) for LP_IRAM region */
27     uint32_t lp_rtc_iram_flash_offset; /* Flash offset (LMA) for LP_IRAM region */
28     uint32_t lp_rtc_iram_size;         /* Size of LP_IRAM region */
29     uint32_t lp_rtc_dram_dest_addr;    /* Destination address (VMA) for LP_DRAM region */
30     uint32_t lp_rtc_dram_flash_offset; /* Flash offset (LMA) for LP_DRAM region */
31     uint32_t lp_rtc_dram_size;         /* Size of LP_DRAM region */
32     uint32_t irom_map_addr;            /* Mapped address (VMA) for IROM region */
33     uint32_t irom_flash_offset;        /* Flash offset (LMA) for IROM region */
34     uint32_t irom_size;                /* Size of IROM region */
35     uint32_t drom_map_addr;            /* Mapped address (VMA) for DROM region */
36     uint32_t drom_flash_offset;        /* Flash offset (LMA) for DROM region */
37     uint32_t drom_size;                /* Size of DROM region */
38     uint32_t _reserved[4];             /* Up to 24 words reserved for the header */
39 } esp_image_load_header_t;
40