1 /* 2 * Copyright (c) 2021 HPMicro 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #include "hpm_bootheader.h" 9 10 /* symbol exported from startup.S */ 11 extern uint32_t _start[]; 12 13 /* following symbols exported from linker script */ 14 extern uint32_t __app_load_addr__[]; 15 extern uint32_t __app_offset__[]; 16 extern uint32_t __fw_size__[]; 17 18 #define FW_SIZE (32768) 19 __attribute__ ((section(".fw_info_table"))) const fw_info_table_t fw_info = { 20 (uint32_t)__app_offset__, /* offset */ 21 (uint32_t)__fw_size__, /* size */ 22 0, /* flags */ 23 0, /* reserved0 */ 24 (uint32_t) &__app_load_addr__, /* load_addr */ 25 0, /* reserved1 */ 26 (uint32_t) _start, /* entry_point */ 27 0, /* reserved2 */ 28 {0}, /* hash */ 29 {0}, /* iv */ 30 }; 31 32 __attribute__ ((section(".boot_header"))) const boot_header_t header = { 33 HPM_BOOTHEADER_TAG, /* tag */ 34 0x10, /* version*/ 35 sizeof(header) + sizeof(fw_info), 36 0, /* flags */ 37 0, /* sw_version */ 38 0, /* fuse_version */ 39 1, /* fw_count */ 40 0, 41 0, /* sig_block_offset */ 42 }; 43