diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-22 19:23:29 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2024-03-31 16:57:19 +0100 |
commit | 6ffd42548bf10cda13a01555ff4fa56d4213cdf2 (patch) | |
tree | 975d6a4f88a0a3469c1450476e841ef0bf8fbb85 /apps/main.c | |
parent | af644e02a151bb6d4c229cc1d4846c7ffe952135 (diff) | |
download | rockbox-6ffd42548bf10cda13a01555ff4fa56d4213cdf2.tar.gz rockbox-6ffd42548bf10cda13a01555ff4fa56d4213cdf2.zip |
multiboot: Refactor boot data validation, add version numbers
Instead of verifying the CRC before every access of the boot data,
verify the CRC once at startup and set a flag to indicate the boot
data is valid.
Also add a framework to support multiple boot protocol versions.
Firmware declares the maximum supported protocol version using a
version byte in the boot data header. The bootloader chooses the
highest version supported by it and the firmware when deciding
what boot protocol to use.
Change-Id: I810194625dc0833f026d2a23b8d64ed467fa6aca
Diffstat (limited to 'apps/main.c')
-rw-r--r-- | apps/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/main.c b/apps/main.c index 1e012efb3c..cf7d302fc9 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #include "statusbar-skinned.h" | 77 | #include "statusbar-skinned.h" |
78 | #include "bootchart.h" | 78 | #include "bootchart.h" |
79 | #include "logdiskf.h" | 79 | #include "logdiskf.h" |
80 | #include "bootdata.h" | ||
80 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) | 81 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) |
81 | #include "notification.h" | 82 | #include "notification.h" |
82 | #endif | 83 | #endif |
@@ -445,6 +446,10 @@ static void init(void) | |||
445 | core_allocator_init(); | 446 | core_allocator_init(); |
446 | kernel_init(); | 447 | kernel_init(); |
447 | 448 | ||
449 | #if defined(HAVE_BOOTDATA) && !defined(BOOTLOADER) | ||
450 | verify_boot_data(); | ||
451 | #endif | ||
452 | |||
448 | /* early early early! */ | 453 | /* early early early! */ |
449 | filesystem_init(); | 454 | filesystem_init(); |
450 | 455 | ||