fsl_flexspi_nor_boot.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef __FLEXSPI_NOR_BOOT_H__
9 #define __FLEXSPI_NOR_BOOT_H__
10 
11 #include <stdint.h>
12 #include "board.h"
13 
17 #define FSL_XIP_DEVICE_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
18 
20 /*************************************
21  * IVT Data
22  *************************************/
23 typedef struct _ivt_ {
27  uint32_t hdr;
31  uint32_t entry;
33  uint32_t reserved1;
35  uint32_t dcd;
39  uint32_t boot_data;
41  uint32_t self;
43  uint32_t csf;
45  uint32_t reserved2;
46 } ivt;
47 
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
54 
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))
58 
59 /* IVT header */
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))
64 
65 /* Set resume entry */
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__)
77  extern uint32_t __VECTOR_TABLE[];
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__)
82  extern uint32_t __VECTOR_TABLE[];
83  extern uint32_t __FLASH_BASE[];
84 #define IMAGE_ENTRY_ADDRESS ((uint32_t)__VECTOR_TABLE)
85 #define FLASH_BASE ((uint32_t)__FLASH_BASE)
86 #endif
87 
88 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
89 #define DCD_ADDRESS dcd_data
90 #else
91 #define DCD_ADDRESS 0
92 #endif
93 
94 #define BOOT_DATA_ADDRESS &boot_data
95 #define CSF_ADDRESS 0
96 #define IVT_RSVD (uint32_t)(0x00000000)
97 
98 /*************************************
99  * Boot Data
100  *************************************/
101 typedef struct _boot_data_ {
102  uint32_t start; /* boot start location */
103  uint32_t size; /* size */
104  uint32_t plugin; /* plugin flag - 1 if downloaded application is plugin */
105  uint32_t placeholder; /* placehoder to make even 0x10 size */
107 
108 #if defined(BOARD_FLASH_SIZE)
109 #define FLASH_SIZE BOARD_FLASH_SIZE
110 #else
111 #error "Please define macro BOARD_FLASH_SIZE"
112 #endif
113 #define PLUGIN_FLAG (uint32_t)0
114 
115 /* External Variables */
117 #if defined(XIP_BOOT_HEADER_DCD_ENABLE) && (1 == XIP_BOOT_HEADER_DCD_ENABLE)
118 extern const uint8_t dcd_data[];
119 #endif
120 
121 #endif /* __FLEXSPI_NOR_BOOT_H__ */
122 
_ivt_::csf
uint32_t csf
Definition: fsl_flexspi_nor_boot.h:45
_boot_data_::start
uint32_t start
Definition: fsl_flexspi_nor_boot.h:104
_boot_data_
Definition: fsl_flexspi_nor_boot.h:101
boot_data
const BOOT_DATA_T boot_data
Definition: fsl_flexspi_nor_boot.h:116
_ivt_::reserved1
uint32_t reserved1
Definition: fsl_flexspi_nor_boot.h:35
_ivt_::entry
uint32_t entry
Definition: fsl_flexspi_nor_boot.h:33
_boot_data_::plugin
uint32_t plugin
Definition: fsl_flexspi_nor_boot.h:106
__VECTOR_TABLE
#define __VECTOR_TABLE
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_armcc.h:126
_ivt_::dcd
uint32_t dcd
Definition: fsl_flexspi_nor_boot.h:37
_ivt_
Definition: fsl_flexspi_nor_boot.h:23
_ivt_::hdr
uint32_t hdr
Definition: fsl_flexspi_nor_boot.h:29
_boot_data_::size
uint32_t size
Definition: fsl_flexspi_nor_boot.h:105
board.h
_boot_data_::placeholder
uint32_t placeholder
Definition: fsl_flexspi_nor_boot.h:107
ivt
struct _ivt_ ivt
BOOT_DATA_T
struct _boot_data_ BOOT_DATA_T
_ivt_::boot_data
uint32_t boot_data
Definition: fsl_flexspi_nor_boot.h:41
_ivt_::reserved2
uint32_t reserved2
Definition: fsl_flexspi_nor_boot.h:47


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:56