From 7baa8c29fc8c306d577e88a7b0013d3b7d608bca Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 24 Feb 2019 12:23:49 +0100 Subject: [PATCH] bootloader: move timer_init to jump_to_firmware --- bootloader/bootloader.c | 2 -- util.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootloader/bootloader.c b/bootloader/bootloader.c index 2497b13856..6525ca283b 100644 --- a/bootloader/bootloader.c +++ b/bootloader/bootloader.c @@ -33,7 +33,6 @@ #include "signatures.h" #include "layout.h" #include "rng.h" -#include "timer.h" #include "memory.h" void layoutFirmwareFingerprint(const uint8_t *hash) @@ -133,7 +132,6 @@ int main(void) int signed_firmware = signatures_new_ok(hdr, fingerprint); if (SIG_OK != signed_firmware) { show_unofficial_warning(fingerprint); - timer_init(); } if (SIG_OK != check_firmware_hashes(hdr)) { diff --git a/util.h b/util.h index 31003ed69e..c96a79b6e5 100644 --- a/util.h +++ b/util.h @@ -27,6 +27,7 @@ #if !EMULATOR #include #include +#include "timer.h" #endif // Statement expressions make these macros side-effect safe @@ -68,6 +69,7 @@ static inline void __attribute__((noreturn)) jump_to_firmware(const vector_table // Set stack pointer __asm__ volatile("msr msp, %0" :: "r" (vector_table->initial_sp_value)); } else { // untrusted firmware + timer_init(); mpu_config_firmware(); // * configure MPU for the firmware __asm__ volatile("msr msp, %0" :: "r" (_stack)); }