summaryrefslogtreecommitdiff
path: root/firmware/export/bootdata.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/bootdata.h')
-rw-r--r--firmware/export/bootdata.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/export/bootdata.h b/firmware/export/bootdata.h
index 322d50c20d..319f442511 100644
--- a/firmware/export/bootdata.h
+++ b/firmware/export/bootdata.h
@@ -22,6 +22,7 @@
22 22
23#ifndef __ASSEMBLER__ 23#ifndef __ASSEMBLER__
24#include <stdint.h> 24#include <stdint.h>
25#include "system.h"
25#endif 26#endif
26 27
27/* /!\ This file can be included in assembly files /!\ */ 28/* /!\ This file can be included in assembly files /!\ */
@@ -36,6 +37,7 @@
36 37
37#define BOOT_DATA_MAGIC0 ('r' | 'b' << 8 | 'm' << 16 | 'a' << 24) 38#define BOOT_DATA_MAGIC0 ('r' | 'b' << 8 | 'm' << 16 | 'a' << 24)
38#define BOOT_DATA_MAGIC1 ('g' | 'i' << 8 | 'c' << 16 | '!' << 24) 39#define BOOT_DATA_MAGIC1 ('g' | 'i' << 8 | 'c' << 16 | '!' << 24)
40#define BOOT_DATA_VERSION 0
39 41
40/* maximum size of payload */ 42/* maximum size of payload */
41#define BOOT_DATA_PAYLOAD_SIZE 4 43#define BOOT_DATA_PAYLOAD_SIZE 4
@@ -58,6 +60,7 @@ struct boot_data_t
58 struct 60 struct
59 { 61 {
60 uint8_t boot_volume; 62 uint8_t boot_volume;
63 uint8_t version;
61 }; 64 };
62 uint8_t payload[BOOT_DATA_PAYLOAD_SIZE]; 65 uint8_t payload[BOOT_DATA_PAYLOAD_SIZE];
63 }; 66 };
@@ -65,6 +68,9 @@ struct boot_data_t
65 68
66#if !defined(BOOTLOADER) 69#if !defined(BOOTLOADER)
67extern struct boot_data_t boot_data; 70extern struct boot_data_t boot_data;
71extern bool boot_data_valid;
72
73void verify_boot_data(void) INIT_ATTR;
68#endif 74#endif
69#else /* __ASSEMBLER__ */ 75#else /* __ASSEMBLER__ */
70 76
@@ -76,7 +82,9 @@ boot_data:
76 .word BOOT_DATA_MAGIC0 82 .word BOOT_DATA_MAGIC0
77 .word BOOT_DATA_MAGIC1 83 .word BOOT_DATA_MAGIC1
78 .word BOOT_DATA_PAYLOAD_SIZE 84 .word BOOT_DATA_PAYLOAD_SIZE
79 .space BOOT_DATA_PAYLOAD_SIZE, 0xff /* payload, initialised with value 0xff */ 85 .byte 0xff /* boot volume */
86 .byte BOOT_DATA_VERSION /* maximum supported boot protocol version */
87 .space (BOOT_DATA_PAYLOAD_SIZE - 2), 0xff /* remainder of payload */
80.endm 88.endm
81 89
82#endif 90#endif