mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-30 01:01:00 +00:00
refactor(core): remove set_core_clock from emulator
[no changelog]
This commit is contained in:
parent
5845c665af
commit
7670958fc5
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
uint8_t *FIRMWARE_START = 0;
|
uint8_t *FIRMWARE_START = 0;
|
||||||
|
|
||||||
void set_core_clock(int) {}
|
|
||||||
|
|
||||||
// used in fw emulator to raise python exception on exit
|
// used in fw emulator to raise python exception on exit
|
||||||
void __attribute__((noreturn)) main_clean_exit() { exit(3); }
|
void __attribute__((noreturn)) main_clean_exit() { exit(3); }
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef __EMULATOR_H__
|
#ifndef __EMULATOR_H__
|
||||||
#define __EMULATOR_H__
|
#define __EMULATOR_H__
|
||||||
|
|
||||||
#define CLOCK_180_MHZ 0
|
|
||||||
|
|
||||||
#undef FIRMWARE_START
|
#undef FIRMWARE_START
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -11,7 +9,6 @@
|
|||||||
extern uint8_t *FIRMWARE_START;
|
extern uint8_t *FIRMWARE_START;
|
||||||
|
|
||||||
void emulator_poll_events(void);
|
void emulator_poll_events(void);
|
||||||
void set_core_clock(int);
|
|
||||||
__attribute__((noreturn)) void jump_to(uint32_t address);
|
__attribute__((noreturn)) void jump_to(uint32_t address);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -361,10 +361,6 @@ int bootloader_main(void) {
|
|||||||
|
|
||||||
random_delays_init();
|
random_delays_init();
|
||||||
|
|
||||||
#if defined TREZOR_MODEL_T
|
|
||||||
set_core_clock(CLOCK_180_MHZ);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_HASH_PROCESSOR
|
#ifdef USE_HASH_PROCESSOR
|
||||||
hash_processor_init();
|
hash_processor_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,10 +69,6 @@ static void optiga_log_hex(const char *prefix, const uint8_t *data,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void drivers_init() {
|
void drivers_init() {
|
||||||
#if defined TREZOR_MODEL_T
|
|
||||||
set_core_clock(CLOCK_180_MHZ);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STM32U5
|
#ifdef STM32U5
|
||||||
tamper_init();
|
tamper_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,6 +37,4 @@ void jump_to(uint32_t address);
|
|||||||
void jump_to_with_flag(uint32_t address, uint32_t register_flag);
|
void jump_to_with_flag(uint32_t address, uint32_t register_flag);
|
||||||
void clear_otg_hs_memory(void);
|
void clear_otg_hs_memory(void);
|
||||||
|
|
||||||
extern uint32_t __stack_chk_guard;
|
|
||||||
|
|
||||||
#endif // TREZORHAL_STM32_H
|
#endif // TREZORHAL_STM32_H
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "bootutils.h"
|
#include "bootutils.h"
|
||||||
#include "mpu.h"
|
#include "mpu.h"
|
||||||
|
#include "platform.h"
|
||||||
#include "systask.h"
|
#include "systask.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "systick.h"
|
#include "systick.h"
|
||||||
@ -35,6 +36,11 @@
|
|||||||
#ifdef KERNEL_MODE
|
#ifdef KERNEL_MODE
|
||||||
|
|
||||||
void system_init(systask_error_handler_t error_handler) {
|
void system_init(systask_error_handler_t error_handler) {
|
||||||
|
#if defined(TREZOR_MODEL_T) && (!defined(BOARDLOADER))
|
||||||
|
// Early boardloader versions on Model T initialized the CPU clock to 168MHz.
|
||||||
|
// We need to set it to the STM32F429's maximum - 180MHz.
|
||||||
|
set_core_clock(CLOCK_180_MHZ);
|
||||||
|
#endif
|
||||||
mpu_init();
|
mpu_init();
|
||||||
mpu_reconfig(MPU_MODE_DEFAULT);
|
mpu_reconfig(MPU_MODE_DEFAULT);
|
||||||
systask_scheduler_init(error_handler);
|
systask_scheduler_init(error_handler);
|
||||||
|
@ -29,19 +29,11 @@
|
|||||||
#define FLASH_BURST_WORDS (8 * FLASH_QUADWORD_WORDS)
|
#define FLASH_BURST_WORDS (8 * FLASH_QUADWORD_WORDS)
|
||||||
#define FLASH_BURST_SIZE (FLASH_BURST_WORDS * sizeof(uint32_t))
|
#define FLASH_BURST_SIZE (FLASH_BURST_WORDS * sizeof(uint32_t))
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
CLOCK_160_MHZ = 0,
|
|
||||||
} clock_settings_t;
|
|
||||||
|
|
||||||
void set_core_clock(clock_settings_t settings);
|
|
||||||
|
|
||||||
// the following functions are defined in util.s
|
// the following functions are defined in util.s
|
||||||
void memset_reg(volatile void *start, volatile void *stop, uint32_t val);
|
void memset_reg(volatile void *start, volatile void *stop, uint32_t val);
|
||||||
void jump_to(uint32_t address);
|
void jump_to(uint32_t address);
|
||||||
void jump_to_with_flag(uint32_t address, uint32_t register_flag);
|
void jump_to_with_flag(uint32_t address, uint32_t register_flag);
|
||||||
|
|
||||||
extern uint32_t __stack_chk_guard;
|
|
||||||
|
|
||||||
void check_oem_keys(void);
|
void check_oem_keys(void);
|
||||||
|
|
||||||
#endif // TREZORHAL_STM32_H
|
#endif // TREZORHAL_STM32_H
|
||||||
|
Loading…
Reference in New Issue
Block a user