summaryrefslogtreecommitdiffstats
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 @@
#ifndef __ASSEMBLER__
#include <stdint.h>
+#include "system.h"
#endif
/* /!\ This file can be included in assembly files /!\ */
@@ -36,6 +37,7 @@
#define BOOT_DATA_MAGIC0 ('r' | 'b' << 8 | 'm' << 16 | 'a' << 24)
#define BOOT_DATA_MAGIC1 ('g' | 'i' << 8 | 'c' << 16 | '!' << 24)
+#define BOOT_DATA_VERSION 0
/* maximum size of payload */
#define BOOT_DATA_PAYLOAD_SIZE 4
@@ -58,6 +60,7 @@ struct boot_data_t
struct
{
uint8_t boot_volume;
+ uint8_t version;
};
uint8_t payload[BOOT_DATA_PAYLOAD_SIZE];
};
@@ -65,6 +68,9 @@ struct boot_data_t
#if !defined(BOOTLOADER)
extern struct boot_data_t boot_data;
+extern bool boot_data_valid;
+
+void verify_boot_data(void) INIT_ATTR;
#endif
#else /* __ASSEMBLER__ */
@@ -76,7 +82,9 @@ boot_data:
.word BOOT_DATA_MAGIC0
.word BOOT_DATA_MAGIC1
.word BOOT_DATA_PAYLOAD_SIZE
- .space BOOT_DATA_PAYLOAD_SIZE, 0xff /* payload, initialised with value 0xff */
+ .byte 0xff /* boot volume */
+ .byte BOOT_DATA_VERSION /* maximum supported boot protocol version */
+ .space (BOOT_DATA_PAYLOAD_SIZE - 2), 0xff /* remainder of payload */
.endm
#endif