|
9 | 9 |
|
10 | 10 | #include <stdint.h> |
11 | 11 |
|
12 | | -#define SOFTPERIPHERAL_META_HEADER_VERSION (1) |
13 | | - |
14 | 12 | #define SOFTPERIPHERAL_META_SOFTPERIPHERAL_ID_SQSPI 0x45b1 |
15 | 13 |
|
16 | 14 | #if (SOFTPERIPHERAL_META_HEADER_VERSION == 1) |
@@ -124,6 +122,111 @@ typedef struct |
124 | 122 | }; |
125 | 123 | } softperipheral_metadata_t; |
126 | 124 |
|
127 | | -#endif // (SOFTPERIPHERAL_META_HEADER_VERSION == 1) |
| 125 | +#elif (SOFTPERIPHERAL_META_HEADER_VERSION == 2) |
| 126 | + |
| 127 | +#define SOFTPERIPHERAL_META_COMM_ID_REGIF (1) |
| 128 | +#define SOFTPERIPHERAL_META_COMM_ID_JOBLIST (2) |
| 129 | + |
| 130 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_05 (1) |
| 131 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_09 (2) |
| 132 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_10 (4) |
| 133 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_15 (8) |
| 134 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_20 (16) |
| 135 | +#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_ANY (31) |
| 136 | + |
| 137 | +#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_L (1) |
| 138 | +#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_H (2) |
| 139 | +#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_ANY (3) |
| 140 | + |
| 141 | +#define SOFTPERIPHERAL_META_PLATFORM_SERIES_54 (1) |
| 142 | +#define SOFTPERIPHERAL_META_PLATFORM_SERIES_ANY (1) |
| 143 | + |
| 144 | +#ifndef SOFTPERIPHERAL_META_SELF_BOOTING |
| 145 | +#define SOFTPERIPHERAL_META_SELF_BOOTING (0) |
| 146 | +#endif |
| 147 | + |
| 148 | +typedef struct |
| 149 | +{ |
| 150 | + union |
| 151 | + { |
| 152 | + struct |
| 153 | + { |
| 154 | + uint32_t magic : 16; |
| 155 | + uint32_t header_version : 4; |
| 156 | + uint32_t comm_id : 8; |
| 157 | + uint32_t reserved0 : 3; |
| 158 | + uint32_t self_boot : 1; // If True, set INITPC to NVM address. |
| 159 | + // If False, copy fw_code_size bytes from NVM to fw_ram_base_addr |
| 160 | + }; |
| 161 | + |
| 162 | + uint32_t w0_raw; |
| 163 | + }; |
| 164 | + |
| 165 | + union |
| 166 | + { |
| 167 | + struct |
| 168 | + { |
| 169 | + uint16_t softperiph_id; |
| 170 | + |
| 171 | + union |
| 172 | + { |
| 173 | + struct |
| 174 | + { |
| 175 | + uint16_t device : 9; |
| 176 | + uint16_t platform : 4; |
| 177 | + uint16_t series : 3; |
| 178 | + }; |
| 179 | + |
| 180 | + uint16_t raw; |
| 181 | + } platform; |
| 182 | + }; |
| 183 | + |
| 184 | + uint32_t w1_raw; |
| 185 | + }; |
| 186 | + |
| 187 | + union |
| 188 | + { |
| 189 | + struct |
| 190 | + { |
| 191 | + uint32_t patch : 16; |
| 192 | + uint32_t minor : 8; |
| 193 | + uint32_t major : 8; |
| 194 | + } version; |
| 195 | + |
| 196 | + uint32_t w2_raw; |
| 197 | + }; |
| 198 | + |
| 199 | + union |
| 200 | + { |
| 201 | + struct |
| 202 | + { |
| 203 | + uint16_t fw_code_size; // size / 16 |
| 204 | + uint16_t |
| 205 | + fw_ram_total_size; // size / 16. Must also include code (RAM CODE region), code RAM (.data/.bss/.stack/.heap), shared and/or allocatable RAM from the FW. |
| 206 | + }; |
| 207 | + |
| 208 | + uint32_t w3_raw; |
| 209 | + }; |
| 210 | + |
| 211 | + union |
| 212 | + { |
| 213 | + uint32_t |
| 214 | + fw_ram_base_addr; // Dest address for code in case self_boot = False. Also, the RAM start address set by the FW in case of any RAM it needs. |
| 215 | + uint32_t w5_raw; |
| 216 | + }; |
| 217 | + |
| 218 | + union |
| 219 | + { |
| 220 | + struct |
| 221 | + { |
| 222 | + uint16_t fw_shared_ram_size; // size / 16 |
| 223 | + uint16_t fw_shared_ram_addr_offset; |
| 224 | + }; |
| 225 | + |
| 226 | + uint32_t w6_raw; |
| 227 | + }; |
| 228 | +} softperipheral_metadata_t; |
| 229 | + |
| 230 | +#endif //SOFTPERIPHERAL_META_HEADER_VERSION |
128 | 231 |
|
129 | 232 | #endif // SOFTPERIPHEREAL_META_H__ |
0 commit comments