8 #ifndef __FLEXSPI_NOR_BOOT_H__
9 #define __FLEXSPI_NOR_BOOT_H__
17 #define FSL_XIP_DEVICE_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
48 #define IVT_MAJOR_VERSION 0x4
49 #define IVT_MAJOR_VERSION_SHIFT 0x4
50 #define IVT_MAJOR_VERSION_MASK 0xF
51 #define IVT_MINOR_VERSION 0x1
52 #define IVT_MINOR_VERSION_SHIFT 0x0
53 #define IVT_MINOR_VERSION_MASK 0xF
55 #define IVT_VERSION(major, minor) \
56 ((((major) & IVT_MAJOR_VERSION_MASK) << IVT_MAJOR_VERSION_SHIFT) | \
57 (((minor) & IVT_MINOR_VERSION_MASK) << IVT_MINOR_VERSION_SHIFT))
60 #define IVT_TAG_HEADER 0xD1
61 #define IVT_SIZE 0x2000
62 #define IVT_PAR IVT_VERSION(IVT_MAJOR_VERSION, IVT_MINOR_VERSION)
63 #define IVT_HEADER (IVT_TAG_HEADER | (IVT_SIZE << 8) | (IVT_PAR << 24))
66 #if defined(__CC_ARM) || defined(__ARMCC_VERSION)
67 extern uint32_t __Vectors[];
68 extern uint32_t Image$$RW_m_config_text$$Base[];
69 #define IMAGE_ENTRY_ADDRESS ((uint32_t)__Vectors)
70 #define FLASH_BASE ((uint32_t)Image$$RW_m_config_text$$Base)
71 #elif defined(__MCUXPRESSO)
72 extern uint32_t __Vectors[];
73 extern uint32_t __boot_hdr_start__[];
74 #define IMAGE_ENTRY_ADDRESS ((uint32_t)__Vectors)
75 #define FLASH_BASE ((uint32_t)__boot_hdr_start__)
76 #elif defined(__ICCARM__)
78 extern uint32_t m_boot_hdr_conf_start[];
79 #define IMAGE_ENTRY_ADDRESS ((uint32_t)__VECTOR_TABLE)
80 #define FLASH_BASE ((uint32_t)m_boot_hdr_conf_start)
81 #elif defined(__GNUC__)
83 extern uint32_t __FLASH_BASE[];
84 #define IMAGE_ENTRY_ADDRESS ((uint32_t)__VECTOR_TABLE)
85 #define FLASH_BASE ((uint32_t)__FLASH_BASE)
88 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
89 #define DCD_ADDRESS dcd_data
94 #define BOOT_DATA_ADDRESS &boot_data
96 #define IVT_RSVD (uint32_t)(0x00000000)
108 #if defined(BOARD_FLASH_SIZE)
109 #define FLASH_SIZE BOARD_FLASH_SIZE
111 #error "Please define macro BOARD_FLASH_SIZE"
113 #define PLUGIN_FLAG (uint32_t)0
117 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
118 extern const uint8_t dcd_data[];