diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/bootdata.h | 10 | ||||
-rw-r--r-- | firmware/export/multiboot.h | 2 |
2 files changed, 10 insertions, 2 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) |
67 | extern struct boot_data_t boot_data; | 70 | extern struct boot_data_t boot_data; |
71 | extern bool boot_data_valid; | ||
72 | |||
73 | void 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 |
diff --git a/firmware/export/multiboot.h b/firmware/export/multiboot.h index 0132b8531f..4174e71d61 100644 --- a/firmware/export/multiboot.h +++ b/firmware/export/multiboot.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __MULTIBOOT_H__ | 21 | #ifndef __MULTIBOOT_H__ |
22 | #define __MULTIBOOT_H__ | 22 | #define __MULTIBOOT_H__ |
23 | 23 | ||
24 | extern int write_bootdata(unsigned char* buf, int len, unsigned int boot_volume); | 24 | extern bool write_bootdata(unsigned char* buf, int len, unsigned int boot_volume); |
25 | #ifdef HAVE_MULTIBOOT | 25 | #ifdef HAVE_MULTIBOOT |
26 | extern int get_redirect_dir(char* buf, int buffer_size, int volume, | 26 | extern int get_redirect_dir(char* buf, int buffer_size, int volume, |
27 | const char* rootdir, const char* firmware); | 27 | const char* rootdir, const char* firmware); |