mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-23 06:58:13 +00:00
bootloader: move timer_init to jump_to_firmware
This commit is contained in:
parent
6cda903a1d
commit
7baa8c29fc
@ -33,7 +33,6 @@
|
|||||||
#include "signatures.h"
|
#include "signatures.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "rng.h"
|
#include "rng.h"
|
||||||
#include "timer.h"
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
void layoutFirmwareFingerprint(const uint8_t *hash)
|
void layoutFirmwareFingerprint(const uint8_t *hash)
|
||||||
@ -133,7 +132,6 @@ int main(void)
|
|||||||
int signed_firmware = signatures_new_ok(hdr, fingerprint);
|
int signed_firmware = signatures_new_ok(hdr, fingerprint);
|
||||||
if (SIG_OK != signed_firmware) {
|
if (SIG_OK != signed_firmware) {
|
||||||
show_unofficial_warning(fingerprint);
|
show_unofficial_warning(fingerprint);
|
||||||
timer_init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SIG_OK != check_firmware_hashes(hdr)) {
|
if (SIG_OK != check_firmware_hashes(hdr)) {
|
||||||
|
2
util.h
2
util.h
@ -27,6 +27,7 @@
|
|||||||
#if !EMULATOR
|
#if !EMULATOR
|
||||||
#include <libopencm3/cm3/scb.h>
|
#include <libopencm3/cm3/scb.h>
|
||||||
#include <libopencm3/cm3/vector.h>
|
#include <libopencm3/cm3/vector.h>
|
||||||
|
#include "timer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Statement expressions make these macros side-effect safe
|
// 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
|
// Set stack pointer
|
||||||
__asm__ volatile("msr msp, %0" :: "r" (vector_table->initial_sp_value));
|
__asm__ volatile("msr msp, %0" :: "r" (vector_table->initial_sp_value));
|
||||||
} else { // untrusted firmware
|
} else { // untrusted firmware
|
||||||
|
timer_init();
|
||||||
mpu_config_firmware(); // * configure MPU for the firmware
|
mpu_config_firmware(); // * configure MPU for the firmware
|
||||||
__asm__ volatile("msr msp, %0" :: "r" (_stack));
|
__asm__ volatile("msr msp, %0" :: "r" (_stack));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user