diff --git a/core/embed/boardloader/main.c b/core/embed/boardloader/main.c index c1d7c836d9..adbea6734d 100644 --- a/core/embed/boardloader/main.c +++ b/core/embed/boardloader/main.c @@ -32,6 +32,7 @@ #include "image.h" #include "model.h" #include "mpu.h" +#include "platform.h" #include "rng.h" #include "rsod.h" #include "secret.h" diff --git a/core/embed/kernel/main.c b/core/embed/kernel/main.c index c26e2c7b1b..5f4b54f7ab 100644 --- a/core/embed/kernel/main.c +++ b/core/embed/kernel/main.c @@ -37,6 +37,7 @@ #include "mpu.h" #include "optiga_commands.h" #include "optiga_transport.h" +#include "platform.h" #include "random_delays.h" #include "rsod.h" #include "sdcard.h" diff --git a/core/embed/trezorhal/common.h b/core/embed/trezorhal/common.h index 3c92580c84..c231f82a0c 100644 --- a/core/embed/trezorhal/common.h +++ b/core/embed/trezorhal/common.h @@ -25,7 +25,6 @@ #include "secbool.h" #include "error_handling.h" -#include "platform.h" #include "systick.h" #ifndef MIN_8bits diff --git a/core/embed/trezorhal/flash.h b/core/embed/trezorhal/flash.h index ae0169af78..68159e4e93 100644 --- a/core/embed/trezorhal/flash.h +++ b/core/embed/trezorhal/flash.h @@ -24,9 +24,22 @@ #include #include "flash_ll.h" -#include "platform.h" #include "secbool.h" +#ifndef TREZOR_EMULATOR +#include STM32_HAL_H +#endif + +#ifdef STM32U5 + +#define FLASH_QUADWORD_WORDS (4) +#define FLASH_QUADWORD_SIZE (FLASH_QUADWORD_WORDS * sizeof(uint32_t)) + +#define FLASH_BURST_WORDS (8 * FLASH_QUADWORD_WORDS) +#define FLASH_BURST_SIZE (FLASH_BURST_WORDS * sizeof(uint32_t)) + +#endif + void flash_init(void); #endif // TREZORHAL_FLASH_H diff --git a/core/embed/trezorhal/stm32f4/bootutils.c b/core/embed/trezorhal/stm32f4/bootutils.c index 4f323928d0..7f1f7463b3 100644 --- a/core/embed/trezorhal/stm32f4/bootutils.c +++ b/core/embed/trezorhal/stm32f4/bootutils.c @@ -27,6 +27,7 @@ #include "irq.h" #include "model.h" #include "mpu.h" +#include "platform.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/optiga_hal.c b/core/embed/trezorhal/stm32f4/optiga_hal.c index b3d659fcf1..b1d60acfa5 100644 --- a/core/embed/trezorhal/stm32f4/optiga_hal.c +++ b/core/embed/trezorhal/stm32f4/optiga_hal.c @@ -1,6 +1,7 @@ #include "optiga_hal.h" #include "common.h" #include TREZOR_BOARD +#include STM32_HAL_H #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/systick.c b/core/embed/trezorhal/stm32f4/systick.c index 5bfbe2cac2..359f3e2724 100644 --- a/core/embed/trezorhal/stm32f4/systick.c +++ b/core/embed/trezorhal/stm32f4/systick.c @@ -22,7 +22,6 @@ #include "irq.h" #include "mpu.h" -#include "platform.h" #include "systemview.h" #include "systick.h" diff --git a/core/embed/trezorhal/stm32f4/systimer.c b/core/embed/trezorhal/stm32f4/systimer.c index 10736a5b77..278958af82 100644 --- a/core/embed/trezorhal/stm32f4/systimer.c +++ b/core/embed/trezorhal/stm32f4/systimer.c @@ -21,7 +21,6 @@ #include #include "irq.h" -#include "platform.h" #include "systick_internal.h" #include "systimer.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h index b70b051d1a..a45ce390d6 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h @@ -1,6 +1,8 @@ #ifndef TREZORHAL_DISPLAY_INTERNAL_H #define TREZORHAL_DISPLAY_INTERNAL_H +#include STM32_HAL_H + #include #ifdef XFRAMEBUFFER diff --git a/core/embed/trezorhal/stm32u5/common.c b/core/embed/trezorhal/stm32u5/common.c index 5efbb40887..15cd44460d 100644 --- a/core/embed/trezorhal/stm32u5/common.c +++ b/core/embed/trezorhal/stm32u5/common.c @@ -26,7 +26,6 @@ #include "error_handling.h" #include "flash_otp.h" #include "model.h" -#include "platform.h" #include "rand.h" #include "secret.h" diff --git a/core/embed/trezorhal/stm32u5/platform.h b/core/embed/trezorhal/stm32u5/platform.h index 0b24be25d7..ff990e12c2 100644 --- a/core/embed/trezorhal/stm32u5/platform.h +++ b/core/embed/trezorhal/stm32u5/platform.h @@ -20,15 +20,8 @@ #ifndef TREZORHAL_STM32_H #define TREZORHAL_STM32_H -#include STM32_HAL_H #include -#define FLASH_QUADWORD_WORDS (4) -#define FLASH_QUADWORD_SIZE (FLASH_QUADWORD_WORDS * sizeof(uint32_t)) - -#define FLASH_BURST_WORDS (8 * FLASH_QUADWORD_WORDS) -#define FLASH_BURST_SIZE (FLASH_BURST_WORDS * sizeof(uint32_t)) - // the following functions are defined in util.s void memset_reg(volatile void *start, volatile void *stop, uint32_t val); void jump_to(uint32_t address); diff --git a/core/embed/trezorhal/stm32u5/secret.c b/core/embed/trezorhal/stm32u5/secret.c index 933f9ca7d9..fba10c91bb 100644 --- a/core/embed/trezorhal/stm32u5/secret.c +++ b/core/embed/trezorhal/stm32u5/secret.c @@ -1,3 +1,5 @@ +#include STM32_HAL_H + #include "secret.h" #include #include diff --git a/core/embed/trezorhal/unix/button.c b/core/embed/trezorhal/unix/button.c index 3ff9cd4b6f..9ab6731e0a 100644 --- a/core/embed/trezorhal/unix/button.c +++ b/core/embed/trezorhal/unix/button.c @@ -23,7 +23,6 @@ #include "button.h" #include "common.h" -#include "platform.h" static char last_left = 0, last_right = 0; diff --git a/core/embed/trezorhal/unix/touch.c b/core/embed/trezorhal/unix/touch.c index d2aa918e1f..6c4f34f5c3 100644 --- a/core/embed/trezorhal/unix/touch.c +++ b/core/embed/trezorhal/unix/touch.c @@ -24,7 +24,6 @@ #include #include "common.h" -#include "platform.h" #include "touch.h" extern int sdl_display_res_x, sdl_display_res_y;