From 8c7a3ab0e6d93b6c5865fd6e4914f216f568ef40 Mon Sep 17 00:00:00 2001 From: cepetr Date: Fri, 1 Nov 2024 12:55:31 +0100 Subject: [PATCH] refactor(core): introduce global trezor_rtl/bsp/model headers [no changelog] --- core/embed/boardloader/main.c | 8 ++--- core/embed/bootloader/bootui.c | 4 +-- core/embed/bootloader/bootui.h | 5 ++- core/embed/bootloader/emulator.c | 8 ++--- core/embed/bootloader/emulator.h | 5 ++- core/embed/bootloader/main.c | 9 ++--- core/embed/bootloader/messages.c | 6 ++-- core/embed/bootloader/messages.h | 5 ++- core/embed/bootloader/version_check.c | 6 ++-- core/embed/bootloader/version_check.h | 3 +- core/embed/bootloader_ci/bootui.c | 2 +- core/embed/bootloader_ci/bootui.h | 2 +- core/embed/bootloader_ci/main.c | 9 +++-- core/embed/bootloader_ci/messages.c | 6 ++-- core/embed/bootloader_ci/messages.h | 4 +-- .../extmod/modtrezorconfig/modtrezorconfig.c | 3 +- .../extmod/modtrezorconfig/norcow_config.h | 5 +-- core/embed/extmod/modtrezorcrypto/crc.h | 2 +- .../extmod/modtrezorcrypto/modtrezorcrypto.c | 8 +---- core/embed/extmod/modtrezorio/ff.c | 3 +- .../extmod/modtrezorio/modtrezorio-poll.h | 5 +-- core/embed/extmod/modtrezorio/modtrezorio.c | 7 ++-- core/embed/extmod/modtrezorui/modtrezorui.c | 4 +-- .../modtrezorutils/modtrezorutils-meminfo.h | 5 ++- .../extmod/modtrezorutils/modtrezorutils.c | 7 ++-- core/embed/extmod/trezorobj.c | 2 +- core/embed/firmware/main.c | 8 +---- core/embed/firmware/mphalport.c | 3 +- core/embed/firmware/systemview.c | 5 +-- core/embed/kernel/main.c | 2 +- core/embed/lib/bl_check.c | 7 ++-- core/embed/lib/buffers.c | 3 +- core/embed/lib/buffers.h | 7 ++-- core/embed/lib/colors.h | 3 +- core/embed/lib/common.h | 31 ++++++++++++++++ core/embed/lib/display_draw.c | 19 +++++----- core/embed/lib/display_draw.h | 5 +-- core/embed/lib/display_utils.c | 4 ++- core/embed/lib/error_handling.c | 4 +-- core/embed/lib/flash_utils.c | 8 ++--- core/embed/lib/flash_utils.h | 2 +- core/embed/lib/fonts/font_bitmap.h | 2 +- core/embed/lib/fonts/fonts.c | 6 ++-- core/embed/lib/fonts/fonts.h | 1 - core/embed/lib/gfx_bitblt.h | 3 +- core/embed/lib/gfx_color.h | 2 +- core/embed/lib/gfx_draw.c | 3 +- core/embed/lib/image.c | 5 ++- core/embed/lib/image.h | 6 ++-- core/embed/lib/image_hash_conf.h | 4 +-- core/embed/lib/mini_printf.c | 4 +-- core/embed/lib/mini_printf.h | 6 ++-- core/embed/lib/terminal.c | 7 ++-- core/embed/lib/translations.c | 10 +++--- core/embed/lib/translations.h | 3 +- .../{trezorhal/common.h => lib/trezor_rtl.h} | 21 +++++++---- core/embed/lib/trezor_types.h | 35 ++++++++++++++++++ core/embed/models/trezor_bsp.h | 36 +++++++++++++++++++ core/embed/models/{model.h => trezor_model.h} | 0 core/embed/prodtest/main.c | 11 +++--- core/embed/prodtest/optiga_prodtest.c | 4 +-- core/embed/prodtest/optiga_prodtest.h | 4 +-- core/embed/prodtest/prodtest_common.h | 3 +- core/embed/reflash/main.c | 12 +++---- core/embed/rust/rust_ui.h | 4 --- core/embed/rust/rust_ui_bootloader.h | 2 +- core/embed/rust/rust_ui_common.h | 2 +- core/embed/rust/trezorhal.h | 6 ++-- core/embed/trezorhal/applet.h | 3 +- core/embed/trezorhal/bg_copy.h | 4 +-- core/embed/trezorhal/board_capabilities.h | 2 +- core/embed/trezorhal/bootargs.h | 3 +- core/embed/trezorhal/bootutils.h | 3 +- core/embed/trezorhal/button.h | 2 +- core/embed/trezorhal/display.h | 6 ++-- core/embed/trezorhal/dma2d.h | 2 +- core/embed/trezorhal/entropy.h | 2 +- core/embed/trezorhal/flash.h | 4 +-- core/embed/trezorhal/flash_otp.h | 2 +- core/embed/trezorhal/fwutils.h | 4 +-- core/embed/trezorhal/haptic.h | 3 +- core/embed/trezorhal/hash_processor.h | 2 +- core/embed/trezorhal/i2c_bus.h | 4 +-- core/embed/trezorhal/monoctr.h | 5 ++- core/embed/trezorhal/mpu.h | 2 +- core/embed/trezorhal/optiga.h | 5 ++- core/embed/trezorhal/optiga/optiga.c | 5 +-- core/embed/trezorhal/optiga/optiga_commands.c | 5 +-- .../embed/trezorhal/optiga/optiga_transport.c | 10 +++--- core/embed/trezorhal/optiga_commands.h | 5 ++- core/embed/trezorhal/optiga_common.h | 2 +- core/embed/trezorhal/optiga_hal.h | 3 +- core/embed/trezorhal/optiga_transport.h | 5 ++- core/embed/trezorhal/option_bytes.h | 2 +- core/embed/trezorhal/random_delays.h | 2 +- core/embed/trezorhal/reset_flags.h | 2 +- core/embed/trezorhal/rgb_led.h | 2 +- core/embed/trezorhal/rng.h | 2 +- core/embed/trezorhal/sbu.h | 2 +- core/embed/trezorhal/sdcard.h | 3 +- core/embed/trezorhal/secret.h | 3 +- core/embed/trezorhal/secure_aes.h | 4 +-- core/embed/trezorhal/stm32f4/applet.c | 2 +- core/embed/trezorhal/stm32f4/backlight_pwm.c | 9 ++--- .../trezorhal/stm32f4/board_capabilities.c | 5 ++- core/embed/trezorhal/stm32f4/bootutils.c | 8 ++--- core/embed/trezorhal/stm32f4/button.c | 6 ++-- .../trezorhal/stm32f4/consumption_mask.c | 4 ++- .../trezorhal/stm32f4/displays/ili9341_spi.c | 6 ++-- core/embed/trezorhal/stm32f4/displays/ltdc.c | 9 +++-- core/embed/trezorhal/stm32f4/displays/ltdc.h | 2 +- .../trezorhal/stm32f4/displays/st7789v.c | 8 ++--- .../trezorhal/stm32f4/displays/st7789v.h | 5 ++- .../stm32f4/displays/ug-2828tswig01.c | 6 ++-- .../stm32f4/displays/vg-2864ksweg01.c | 7 ++-- core/embed/trezorhal/stm32f4/dma2d.c | 5 +-- core/embed/trezorhal/stm32f4/dma2d_bitblt.c | 5 ++- core/embed/trezorhal/stm32f4/entropy.c | 6 ++-- core/embed/trezorhal/stm32f4/flash.c | 6 ++-- core/embed/trezorhal/stm32f4/flash_otp.c | 6 ++-- core/embed/trezorhal/stm32f4/fwutils.c | 10 ++---- core/embed/trezorhal/stm32f4/i2c_bus.c | 8 ++--- core/embed/trezorhal/stm32f4/irq.h | 4 +-- core/embed/trezorhal/stm32f4/layout.c | 6 ++-- core/embed/trezorhal/stm32f4/monoctr.c | 7 ++-- core/embed/trezorhal/stm32f4/mpu.c | 9 ++--- core/embed/trezorhal/stm32f4/optiga_hal.c | 7 ++-- core/embed/trezorhal/stm32f4/option_bytes.c | 4 +-- core/embed/trezorhal/stm32f4/pvd.c | 4 +-- core/embed/trezorhal/stm32f4/random_delays.c | 5 ++- core/embed/trezorhal/stm32f4/reset_flags.c | 2 +- core/embed/trezorhal/stm32f4/rgb_led.c | 5 ++- core/embed/trezorhal/stm32f4/rng.c | 2 +- core/embed/trezorhal/stm32f4/sbu.c | 2 +- core/embed/trezorhal/stm32f4/sdcard.c | 6 ++-- core/embed/trezorhal/stm32f4/sdram.h | 2 +- core/embed/trezorhal/stm32f4/secret.c | 8 ++--- core/embed/trezorhal/stm32f4/startup_init.c | 6 ++-- core/embed/trezorhal/stm32f4/syscall.h | 2 +- .../trezorhal/stm32f4/syscall_dispatch.c | 4 +-- core/embed/trezorhal/stm32f4/syscall_probe.c | 5 +-- core/embed/trezorhal/stm32f4/syscall_probe.h | 3 +- .../trezorhal/stm32f4/syscall_verifiers.c | 3 +- core/embed/trezorhal/stm32f4/systask.c | 7 ++-- core/embed/trezorhal/stm32f4/system.c | 5 ++- core/embed/trezorhal/stm32f4/systick.c | 3 +- .../trezorhal/stm32f4/systick_internal.h | 2 +- core/embed/trezorhal/stm32f4/systimer.c | 3 +- core/embed/trezorhal/stm32f4/touch/ft6x36.c | 11 ++---- .../stm32f4/touch/panels/lhs200kb-if21.c | 6 ++-- .../stm32f4/touch/panels/lhs200kb-if21.h | 2 +- .../stm32f4/touch/panels/lx154a2422cpt23.c | 6 ++-- .../stm32f4/touch/panels/lx154a2422cpt23.h | 2 +- core/embed/trezorhal/stm32f4/touch/stmpe811.c | 9 ++--- .../embed/trezorhal/stm32f4/unit_properties.c | 7 ++-- core/embed/trezorhal/stm32f4/usb/usb.c | 8 ++--- .../trezorhal/stm32f4/usb/usb_class_hid.c | 4 +-- .../trezorhal/stm32f4/usb/usb_class_vcp.c | 2 +- .../trezorhal/stm32f4/usb/usb_class_webusb.c | 4 +-- .../trezorhal/stm32f4/usb/usb_internal.h | 3 +- core/embed/trezorhal/stm32f4/usb/usbd_conf.c | 4 ++- core/embed/trezorhal/stm32f4/usb/usbd_conf.h | 6 ++-- .../stm32f4/xdisplay/st-7789/display_driver.c | 2 +- .../stm32f4/xdisplay/st-7789/display_fb.c | 8 ++--- .../stm32f4/xdisplay/st-7789/display_fb.h | 2 +- .../xdisplay/st-7789/display_internal.h | 5 ++- .../stm32f4/xdisplay/st-7789/display_io.c | 4 +-- .../stm32f4/xdisplay/st-7789/display_io.h | 4 +-- .../stm32f4/xdisplay/st-7789/display_nofb.c | 3 +- .../stm32f4/xdisplay/st-7789/display_panel.h | 3 +- .../xdisplay/st-7789/panels/lhs200kb-if21.c | 4 +-- .../xdisplay/st-7789/panels/lx154a2422.c | 3 +- .../xdisplay/st-7789/panels/lx154a2482.c | 4 +-- .../xdisplay/st-7789/panels/tf15411a.c | 5 +-- .../stm32f429i-disc1/display_driver.c | 7 ++-- .../stm32f429i-disc1/display_internal.h | 4 +-- .../xdisplay/stm32f429i-disc1/display_ltdc.c | 7 ++-- .../xdisplay/stm32f429i-disc1/ili9341_spi.c | 6 ++-- .../stm32f4/xdisplay/ug-2828/display_driver.c | 7 ++-- .../stm32f4/xdisplay/vg-2864/display_driver.c | 9 ++--- core/embed/trezorhal/stm32u5/bg_copy.c | 4 +-- .../trezorhal/stm32u5/consumption_mask.c | 3 +- core/embed/trezorhal/stm32u5/displays/dsi.c | 6 ++-- core/embed/trezorhal/stm32u5/displays/dsi.h | 3 +- core/embed/trezorhal/stm32u5/entropy.c | 4 +-- core/embed/trezorhal/stm32u5/flash.c | 9 ++--- core/embed/trezorhal/stm32u5/flash_otp.c | 6 ++-- .../stm32u5/haptic/drv2625/drv2625.c | 9 ++--- core/embed/trezorhal/stm32u5/hash_processor.c | 6 ++-- core/embed/trezorhal/stm32u5/i2c_bus.c | 8 ++--- core/embed/trezorhal/stm32u5/layout.c | 6 ++-- core/embed/trezorhal/stm32u5/monoctr.c | 5 +-- core/embed/trezorhal/stm32u5/mpu.c | 7 ++-- core/embed/trezorhal/stm32u5/option_bytes.c | 9 +++-- core/embed/trezorhal/stm32u5/reset_flags.c | 2 +- core/embed/trezorhal/stm32u5/sdcard.c | 6 ++-- core/embed/trezorhal/stm32u5/secret.c | 10 +++--- core/embed/trezorhal/stm32u5/secure_aes.c | 12 +++---- core/embed/trezorhal/stm32u5/startup_init.c | 4 +-- core/embed/trezorhal/stm32u5/tamper.c | 5 +-- core/embed/trezorhal/stm32u5/touch/sitronix.c | 8 ++--- core/embed/trezorhal/stm32u5/trustzone.c | 8 ++--- .../xdisplay/stm32u5a9j-dk/display_driver.c | 7 ++-- .../xdisplay/stm32u5a9j-dk/display_fb.c | 7 ++-- .../xdisplay/stm32u5a9j-dk/display_internal.h | 3 +- .../xdisplay/stm32u5a9j-dk/display_ltdc_dsi.c | 9 ++--- core/embed/trezorhal/systask.h | 4 +-- core/embed/trezorhal/systick.h | 3 +- core/embed/trezorhal/systimer.h | 3 +- core/embed/trezorhal/tamper.h | 2 +- core/embed/trezorhal/time_estimate.h | 2 +- core/embed/trezorhal/touch.h | 4 +-- core/embed/trezorhal/trustzone.h | 3 +- core/embed/trezorhal/unit_properties.h | 3 +- core/embed/trezorhal/unix/bootutils.c | 8 ++--- core/embed/trezorhal/unix/button.c | 4 +-- core/embed/trezorhal/unix/display-unix.c | 17 ++++----- core/embed/trezorhal/unix/display_driver.c | 4 +-- core/embed/trezorhal/unix/entropy.c | 2 +- core/embed/trezorhal/unix/flash.c | 7 ++-- core/embed/trezorhal/unix/flash_otp.c | 2 +- core/embed/trezorhal/unix/monoctr.c | 7 ++-- core/embed/trezorhal/unix/optiga.c | 5 +-- core/embed/trezorhal/unix/rng.c | 4 +-- core/embed/trezorhal/unix/sdcard.c | 4 +-- core/embed/trezorhal/unix/system.c | 5 ++- core/embed/trezorhal/unix/systick.c | 4 +-- core/embed/trezorhal/unix/systimer.c | 2 +- core/embed/trezorhal/unix/touch.c | 6 ++-- core/embed/trezorhal/unix/unit_properties.c | 6 ++-- core/embed/trezorhal/unix/usb.c | 5 ++- core/embed/trezorhal/usb.h | 3 +- core/embed/trezorhal/usb_hid.h | 3 +- core/embed/trezorhal/usb_vcp.h | 3 +- core/embed/trezorhal/usb_webusb.h | 2 +- core/embed/trezorhal/xdisplay.h | 6 ++-- core/embed/trezorhal/xdisplay_legacy.h | 5 +-- core/embed/unix/main.c | 8 ++--- core/embed/unix/main_main.c | 3 +- core/embed/unix/profile.c | 4 ++- 240 files changed, 598 insertions(+), 682 deletions(-) create mode 100644 core/embed/lib/common.h rename core/embed/{trezorhal/common.h => lib/trezor_rtl.h} (77%) create mode 100644 core/embed/lib/trezor_types.h create mode 100644 core/embed/models/trezor_bsp.h rename core/embed/models/{model.h => trezor_model.h} (100%) diff --git a/core/embed/boardloader/main.c b/core/embed/boardloader/main.c index dc33f4fb32..e429e0a483 100644 --- a/core/embed/boardloader/main.c +++ b/core/embed/boardloader/main.c @@ -17,20 +17,18 @@ * along with this program. If not, see . */ -#include +#include +#include -#include TREZOR_BOARD #include "board_capabilities.h" #include "bootutils.h" #include "buffers.h" -#include "common.h" #include "compiler_traits.h" #include "display.h" #include "display_draw.h" #include "flash.h" #include "flash_utils.h" #include "image.h" -#include "model.h" #include "mpu.h" #include "pvd.h" #include "reset_flags.h" @@ -38,6 +36,7 @@ #include "rsod.h" #include "secret.h" #include "system.h" +#include "systick.h" #include "terminal.h" #ifdef USE_SD_CARD @@ -59,7 +58,6 @@ #endif #include "memzero.h" -#include "model.h" #include "monoctr.h" #include "option_bytes.h" #include "tamper.h" diff --git a/core/embed/bootloader/bootui.c b/core/embed/bootloader/bootui.c index cb1e2e320b..594202f083 100644 --- a/core/embed/bootloader/bootui.c +++ b/core/embed/bootloader/bootui.c @@ -17,9 +17,7 @@ * along with this program. If not, see . */ -#include - -#include TREZOR_BOARD +#include #include "bootui.h" #include "colors.h" diff --git a/core/embed/bootloader/bootui.h b/core/embed/bootloader/bootui.h index 4b29f01532..a9922154af 100644 --- a/core/embed/bootloader/bootui.h +++ b/core/embed/bootloader/bootui.h @@ -20,10 +20,9 @@ #ifndef __BOOTUI_H__ #define __BOOTUI_H__ +#include + #include "image.h" -#include "secbool.h" -#include "stdbool.h" -#include TREZOR_BOARD typedef enum { SCREEN_INTRO = 0, diff --git a/core/embed/bootloader/emulator.c b/core/embed/bootloader/emulator.c index 0fc61c68bb..ac6791182c 100644 --- a/core/embed/bootloader/emulator.c +++ b/core/embed/bootloader/emulator.c @@ -1,20 +1,20 @@ -#include +#include +#include + #include #include -#include TREZOR_BOARD #include "bootargs.h" #include "bootui.h" -#include "common.h" #include "display.h" #include "flash.h" #include "flash_otp.h" -#include "model.h" #include "rust_ui.h" #ifdef USE_OPTIGA #include "secret.h" #endif +#include "systick.h" #include "emulator.h" diff --git a/core/embed/bootloader/emulator.h b/core/embed/bootloader/emulator.h index ee589acb55..aa90a93f82 100644 --- a/core/embed/bootloader/emulator.h +++ b/core/embed/bootloader/emulator.h @@ -1,10 +1,9 @@ #ifndef __EMULATOR_H__ #define __EMULATOR_H__ -#undef FIRMWARE_START +#include -#include -#include +#undef FIRMWARE_START extern uint8_t *FIRMWARE_START; diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index fd1d83ea4d..0636dc117d 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -17,12 +17,14 @@ * along with this program. If not, see . */ -#include +#include +#include +#include + #include #include "bootargs.h" #include "bootutils.h" -#include "common.h" #include "display.h" #include "display_utils.h" #include "flash.h" @@ -35,9 +37,9 @@ #include "pvd.h" #include "random_delays.h" #include "rsod.h" -#include "secbool.h" #include "secret.h" #include "system.h" +#include "systick.h" #include "systimer.h" #ifdef USE_DMA2D @@ -66,7 +68,6 @@ #include "hash_processor.h" #endif -#include "model.h" #include "usb.h" #include "version.h" diff --git a/core/embed/bootloader/messages.c b/core/embed/bootloader/messages.c index 10cda4aff2..eeeb50c71b 100644 --- a/core/embed/bootloader/messages.c +++ b/core/embed/bootloader/messages.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include +#include +#include #include #include @@ -25,11 +26,9 @@ #include "messages.pb.h" #include "bootargs.h" -#include "common.h" #include "flash.h" #include "flash_utils.h" #include "image.h" -#include "secbool.h" #include "secret.h" #include "unit_properties.h" #include "usb.h" @@ -41,7 +40,6 @@ #include "version_check.h" #include "memzero.h" -#include "model.h" #ifdef TREZOR_EMULATOR #include "emulator.h" diff --git a/core/embed/bootloader/messages.h b/core/embed/bootloader/messages.h index ad8e3f4211..c8fcb34c56 100644 --- a/core/embed/bootloader/messages.h +++ b/core/embed/bootloader/messages.h @@ -20,10 +20,9 @@ #ifndef __MESSAGES_H__ #define __MESSAGES_H__ -#include +#include + #include "image.h" -#include "secbool.h" -#include TREZOR_BOARD #define USB_TIMEOUT 500 #define USB_PACKET_SIZE 64 diff --git a/core/embed/bootloader/version_check.c b/core/embed/bootloader/version_check.c index ae7d225154..0d96c53513 100644 --- a/core/embed/bootloader/version_check.c +++ b/core/embed/bootloader/version_check.c @@ -17,13 +17,11 @@ * along with this program. If not, see . */ -#include +#include -#include "version_check.h" - -#include "error_handling.h" #include "model_version.h" #include "monoctr.h" +#include "version_check.h" void ensure_bootloader_min_version(void) { monoctr_write(MONOCTR_BOOTLOADER_VERSION, BOOTLOADER_MONOTONIC_VERSION); diff --git a/core/embed/bootloader/version_check.h b/core/embed/bootloader/version_check.h index a7011808b5..4572d3c8ec 100644 --- a/core/embed/bootloader/version_check.h +++ b/core/embed/bootloader/version_check.h @@ -19,8 +19,7 @@ #pragma once -#include -#include "secbool.h" +#include // Protection against bootloader downgrade diff --git a/core/embed/bootloader_ci/bootui.c b/core/embed/bootloader_ci/bootui.c index 7b6a4e288e..580bc13646 100644 --- a/core/embed/bootloader_ci/bootui.c +++ b/core/embed/bootloader_ci/bootui.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "bootui.h" #include "display.h" diff --git a/core/embed/bootloader_ci/bootui.h b/core/embed/bootloader_ci/bootui.h index 4d71c5f8c7..b63cfc24b0 100644 --- a/core/embed/bootloader_ci/bootui.h +++ b/core/embed/bootloader_ci/bootui.h @@ -20,7 +20,7 @@ #ifndef __BOOTUI_H__ #define __BOOTUI_H__ -#include "secbool.h" +#include void ui_screen_welcome_third(void); diff --git a/core/embed/bootloader_ci/main.c b/core/embed/bootloader_ci/main.c index d44584f663..bc4a8d4782 100644 --- a/core/embed/bootloader_ci/main.c +++ b/core/embed/bootloader_ci/main.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include -#include +#include +#include +#include #include "bootutils.h" -#include "common.h" #include "display.h" #include "display_draw.h" #include "flash.h" @@ -32,8 +32,8 @@ #include "random_delays.h" #include "rng.h" #include "rsod.h" -#include "secbool.h" #include "system.h" +#include "systick.h" #ifdef USE_TOUCH #include "touch.h" #endif @@ -42,7 +42,6 @@ #include "bootui.h" #include "messages.h" -#include "model.h" #include "version_check.h" #ifdef USE_HASH_PROCESSOR diff --git a/core/embed/bootloader_ci/messages.c b/core/embed/bootloader_ci/messages.c index fd40c5fc33..e2b0a81d44 100644 --- a/core/embed/bootloader_ci/messages.c +++ b/core/embed/bootloader_ci/messages.c @@ -17,19 +17,17 @@ * along with this program. If not, see . */ -#include +#include +#include #include #include #include #include "messages.pb.h" -#include "common.h" #include "flash.h" #include "flash_utils.h" #include "image.h" -#include "model.h" -#include "secbool.h" #include "usb.h" #include "version.h" diff --git a/core/embed/bootloader_ci/messages.h b/core/embed/bootloader_ci/messages.h index 0937f60627..37656c5866 100644 --- a/core/embed/bootloader_ci/messages.h +++ b/core/embed/bootloader_ci/messages.h @@ -20,9 +20,9 @@ #ifndef __MESSAGES_H__ #define __MESSAGES_H__ -#include +#include + #include "image.h" -#include "secbool.h" #define USB_TIMEOUT 500 #define USB_PACKET_SIZE 64 diff --git a/core/embed/extmod/modtrezorconfig/modtrezorconfig.c b/core/embed/extmod/modtrezorconfig/modtrezorconfig.c index 10df09495e..c535b4c7ab 100644 --- a/core/embed/extmod/modtrezorconfig/modtrezorconfig.c +++ b/core/embed/extmod/modtrezorconfig/modtrezorconfig.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "py/mphal.h" #include "py/objstr.h" @@ -27,7 +27,6 @@ #include "embed/extmod/trezorobj.h" -#include "common.h" #include "entropy.h" #include "memzero.h" #include "storage.h" diff --git a/core/embed/extmod/modtrezorconfig/norcow_config.h b/core/embed/extmod/modtrezorconfig/norcow_config.h index f9233cb7e2..e0bae4f4b7 100644 --- a/core/embed/extmod/modtrezorconfig/norcow_config.h +++ b/core/embed/extmod/modtrezorconfig/norcow_config.h @@ -20,9 +20,10 @@ #ifndef __NORCOW_CONFIG_H__ #define __NORCOW_CONFIG_H__ -#include TREZOR_BOARD +#include +#include + #include "flash.h" -#include "model.h" #define NORCOW_HEADER_LEN 0 #define NORCOW_SECTOR_COUNT 2 diff --git a/core/embed/extmod/modtrezorcrypto/crc.h b/core/embed/extmod/modtrezorcrypto/crc.h index 34347b52de..2606b5f8f8 100644 --- a/core/embed/extmod/modtrezorcrypto/crc.h +++ b/core/embed/extmod/modtrezorcrypto/crc.h @@ -20,7 +20,7 @@ #ifndef __CRC_H__ #define __CRC_H__ -#include +#include uint32_t checksum_crc32(const uint8_t *data, uint32_t length, uint32_t crc); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c index 13282bd93a..e8e16a76fe 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c @@ -17,16 +17,10 @@ * along with this program. If not, see . */ -#include -#include -#include - -#include "common.h" +#include #include "py/runtime.h" -#include TREZOR_BOARD - #if MICROPY_PY_TREZORCRYPTO static mp_obj_t ui_wait_callback = mp_const_none; diff --git a/core/embed/extmod/modtrezorio/ff.c b/core/embed/extmod/modtrezorio/ff.c index ae62e0efc2..3fe3754aae 100644 --- a/core/embed/extmod/modtrezorio/ff.c +++ b/core/embed/extmod/modtrezorio/ff.c @@ -21,7 +21,8 @@ /----------------------------------------------------------------------------*/ -#include +#include + #include "ff.h" /* Declarations of FatFs API */ #include "diskio.h" /* Declarations of device I/O functions */ diff --git a/core/embed/extmod/modtrezorio/modtrezorio-poll.h b/core/embed/extmod/modtrezorio/modtrezorio-poll.h index c07904e560..e7bbc6603e 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio-poll.h +++ b/core/embed/extmod/modtrezorio/modtrezorio-poll.h @@ -17,11 +17,12 @@ * along with this program. If not, see . */ -#include +#include #include "button.h" -#include "common.h" #include "display.h" +#include "systick.h" + #include "embed/extmod/trezorobj.h" #ifdef TREZOR_EMULATOR diff --git a/core/embed/extmod/modtrezorio/modtrezorio.c b/core/embed/extmod/modtrezorio/modtrezorio.c index 74ad336ba7..75a5501c5e 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio.c +++ b/core/embed/extmod/modtrezorio/modtrezorio.c @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -#include +#include + +#include #include "py/mphal.h" #include "py/objstr.h" @@ -25,9 +27,6 @@ #if MICROPY_PY_TREZORIO -#include - -#include TREZOR_BOARD #include "button.h" #include "touch.h" #include "usb.h" diff --git a/core/embed/extmod/modtrezorui/modtrezorui.c b/core/embed/extmod/modtrezorui/modtrezorui.c index ce587d597b..e6a42cccac 100644 --- a/core/embed/extmod/modtrezorui/modtrezorui.c +++ b/core/embed/extmod/modtrezorui/modtrezorui.c @@ -17,9 +17,7 @@ * along with this program. If not, see . */ -#include -#include -#include +#include #include "py/runtime.h" diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h b/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h index bf2887ca26..55fdfd3770 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h +++ b/core/embed/extmod/modtrezorutils/modtrezorutils-meminfo.h @@ -22,6 +22,8 @@ #else +#include + #include "py/bc.h" #include "py/gc.h" #include "py/nlr.h" @@ -36,9 +38,6 @@ #include "embed/rust/librust.h" #include "embed/trezorhal/usb.h" -#include -#include - #define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / MP_BYTES_PER_OBJ_WORD) #define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils.c b/core/embed/extmod/modtrezorutils/modtrezorutils.c index ca04f00b41..89a8ed3df3 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils.c +++ b/core/embed/extmod/modtrezorutils/modtrezorutils.c @@ -17,6 +17,9 @@ * along with this program. If not, see . */ +#include +#include + #include "py/objstr.h" #include "py/runtime.h" @@ -28,15 +31,11 @@ #include "embed/extmod/modtrezorutils/modtrezorutils-meminfo.h" #include "embed/extmod/trezorobj.h" -#include #include "blake2s.h" #include "bootutils.h" -#include "error_handling.h" #include "fwutils.h" #include "unit_properties.h" #include "usb.h" -#include TREZOR_BOARD -#include "model.h" #if USE_OPTIGA && !defined(TREZOR_EMULATOR) #include "secret.h" diff --git a/core/embed/extmod/trezorobj.c b/core/embed/extmod/trezorobj.c index 71166dec9c..44c07c038e 100644 --- a/core/embed/extmod/trezorobj.c +++ b/core/embed/extmod/trezorobj.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "memzero.h" #include "py/obj.h" diff --git a/core/embed/firmware/main.c b/core/embed/firmware/main.c index 99c29dba3d..d59ace6257 100644 --- a/core/embed/firmware/main.c +++ b/core/embed/firmware/main.c @@ -17,11 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include -#include -#include +#include #include "py/builtin.h" #include "py/compile.h" @@ -36,10 +32,8 @@ #include "ports/stm32/gccollect.h" #include "ports/stm32/pendsv.h" -#include "error_handling.h" #include "rsod.h" #include "rust_ui_common.h" -#include "secbool.h" #include "systask.h" #include "system.h" diff --git a/core/embed/firmware/mphalport.c b/core/embed/firmware/mphalport.c index 9509ca37d5..b3428c16a9 100644 --- a/core/embed/firmware/mphalport.c +++ b/core/embed/firmware/mphalport.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include "common.h" +#include + #include "py/mphal.h" #include "systick.h" diff --git a/core/embed/firmware/systemview.c b/core/embed/firmware/systemview.c index c89c5b95d3..ca171d6569 100644 --- a/core/embed/firmware/systemview.c +++ b/core/embed/firmware/systemview.c @@ -19,9 +19,10 @@ #ifdef SYSTEM_VIEW -#include "systemview.h" -#include +#include + #include "mpconfigport.h" +#include "systemview.h" #include "SEGGER_SYSVIEW.h" #include "SEGGER_SYSVIEW_Conf.h" diff --git a/core/embed/kernel/main.c b/core/embed/kernel/main.c index 47c8160ba5..b140a3c87c 100644 --- a/core/embed/kernel/main.c +++ b/core/embed/kernel/main.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "applet.h" #include "bl_check.h" diff --git a/core/embed/lib/bl_check.c b/core/embed/lib/bl_check.c index 02fd714806..3a62f6f8b7 100644 --- a/core/embed/lib/bl_check.c +++ b/core/embed/lib/bl_check.c @@ -17,15 +17,14 @@ * along with this program. If not, see . */ -#include -#include +#include +#include + #include "blake2s.h" #include "board_capabilities.h" -#include "common.h" #include "flash.h" #include "image.h" #include "memzero.h" -#include "model.h" #include "mpu.h" #include "uzlib.h" diff --git a/core/embed/lib/buffers.c b/core/embed/lib/buffers.c index cbf53a322a..eddaef5607 100644 --- a/core/embed/lib/buffers.c +++ b/core/embed/lib/buffers.c @@ -17,8 +17,9 @@ * along with this program. If not, see . */ +#include + #include "buffers.h" -#include "common.h" #include "fonts/fonts.h" #include "memzero.h" diff --git a/core/embed/lib/buffers.h b/core/embed/lib/buffers.h index 4203338a02..6eac01580d 100644 --- a/core/embed/lib/buffers.h +++ b/core/embed/lib/buffers.h @@ -20,11 +20,8 @@ #ifndef _BUFFERS_H #define _BUFFERS_H -#include - -#include "common.h" -#include "model.h" -#include TREZOR_BOARD +#include +#include #define BUFFER_PIXELS DISPLAY_RESX diff --git a/core/embed/lib/colors.h b/core/embed/lib/colors.h index 1451959c76..7a92ca1761 100644 --- a/core/embed/lib/colors.h +++ b/core/embed/lib/colors.h @@ -20,8 +20,7 @@ #ifndef _COLORS_H #define _COLORS_H -#include "common.h" -#include TREZOR_BOARD +#include #ifdef USE_RGB_COLORS #define RGB16(R, G, B) ((R & 0xF8) << 8) | ((G & 0xFC) << 3) | ((B & 0xF8) >> 3) diff --git a/core/embed/lib/common.h b/core/embed/lib/common.h new file mode 100644 index 0000000000..a2f5826dc1 --- /dev/null +++ b/core/embed/lib/common.h @@ -0,0 +1,31 @@ +/* + * This file is part of the Trezor project, https://trezor.io/ + * + * Copyright (c) SatoshiLabs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LIB_COMMON_H + +// This header is included in storage modules that expect to find common +// functions like `ensure()`, `error_shutdown()`, or `hal_delay()`. +// +// Do not include this header or add dependencies to it unless required by +// storage. + +#include "error_handling.h" +#include "systick.h" + +#endif // LIB_COMMON_H diff --git a/core/embed/lib/display_draw.c b/core/embed/lib/display_draw.c index 289b2ce16c..a90f3be3e5 100644 --- a/core/embed/lib/display_draw.c +++ b/core/embed/lib/display_draw.c @@ -19,23 +19,20 @@ #define _GNU_SOURCE -#include "display_draw.h" +#include + +#include + #include "buffers.h" -#include "common.h" +#include "display.h" +#include "display_draw.h" +#include "fonts/fonts.h" +#include "memzero.h" #ifdef USE_DMA2D #include "dma2d.h" #endif -#include "fonts/fonts.h" - -#include -#include - -#include "memzero.h" - -#include "display.h" - static struct { int x, y; } DISPLAY_OFFSET; diff --git a/core/embed/lib/display_draw.h b/core/embed/lib/display_draw.h index dcd046681d..0facb5db14 100644 --- a/core/embed/lib/display_draw.h +++ b/core/embed/lib/display_draw.h @@ -20,13 +20,10 @@ #ifndef __DISPLAY_DRAW_H__ #define __DISPLAY_DRAW_H__ -#include -#include -#include +#include #include "buffers.h" #include "colors.h" -#include TREZOR_BOARD #include "fonts/fonts.h" // provided by common diff --git a/core/embed/lib/display_utils.c b/core/embed/lib/display_utils.c index 81846e00e1..8fb4d12634 100644 --- a/core/embed/lib/display_utils.c +++ b/core/embed/lib/display_utils.c @@ -17,8 +17,10 @@ * along with this program. If not, see . */ -#include "common.h" +#include + #include "display.h" +#include "systick.h" void display_fade(int start, int end, int delay) { #ifdef USE_BACKLIGHT diff --git a/core/embed/lib/error_handling.c b/core/embed/lib/error_handling.c index 437dc439c0..6691d37e44 100644 --- a/core/embed/lib/error_handling.c +++ b/core/embed/lib/error_handling.c @@ -17,10 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include -#include "error_handling.h" #include "system.h" #ifndef TREZOR_EMULATOR diff --git a/core/embed/lib/flash_utils.c b/core/embed/lib/flash_utils.c index 80112cf6c6..4e3c4bf346 100644 --- a/core/embed/lib/flash_utils.c +++ b/core/embed/lib/flash_utils.c @@ -17,14 +17,12 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include -#include "flash_utils.h" -#include "common.h" #include "flash_area.h" -#include "model.h" +#include "flash_utils.h" #include "mpu.h" -#include "secbool.h" typedef struct { const flash_area_t* area; diff --git a/core/embed/lib/flash_utils.h b/core/embed/lib/flash_utils.h index 04f14d8792..bd973fb9f5 100644 --- a/core/embed/lib/flash_utils.h +++ b/core/embed/lib/flash_utils.h @@ -20,7 +20,7 @@ #ifndef LIB_FLASH_UTILS_H #define LIB_FLASH_UTILS_H -#include "secbool.h" +#include #ifdef KERNEL_MODE diff --git a/core/embed/lib/fonts/font_bitmap.h b/core/embed/lib/fonts/font_bitmap.h index e9b9dd841d..f8ab8e384d 100644 --- a/core/embed/lib/fonts/font_bitmap.h +++ b/core/embed/lib/fonts/font_bitmap.h @@ -1,3 +1,3 @@ -#include +#include extern const uint8_t* const Font_Bitmap; diff --git a/core/embed/lib/fonts/fonts.c b/core/embed/lib/fonts/fonts.c index d2e6a73962..92617d9944 100644 --- a/core/embed/lib/fonts/fonts.c +++ b/core/embed/lib/fonts/fonts.c @@ -17,11 +17,9 @@ * along with this program. If not, see . */ +#include + #include "fonts.h" -#include -#include -#include -#include #ifdef TRANSLATIONS #include "librust_fonts.h" #endif diff --git a/core/embed/lib/fonts/fonts.h b/core/embed/lib/fonts/fonts.h index 2e4405e903..fd4408103c 100644 --- a/core/embed/lib/fonts/fonts.h +++ b/core/embed/lib/fonts/fonts.h @@ -23,7 +23,6 @@ #include #include "fonts/font_bitmap.h" -#include TREZOR_BOARD #ifdef USE_RGB_COLORS #define TREZOR_FONT_BPP 4 diff --git a/core/embed/lib/gfx_bitblt.h b/core/embed/lib/gfx_bitblt.h index f897d933b5..88f5815526 100644 --- a/core/embed/lib/gfx_bitblt.h +++ b/core/embed/lib/gfx_bitblt.h @@ -20,8 +20,7 @@ #ifndef GFX_BITBLT_H #define GFX_BITBLT_H -#include -#include +#include #include "gfx_color.h" diff --git a/core/embed/lib/gfx_color.h b/core/embed/lib/gfx_color.h index 5cbfd9f1ca..c67998ae41 100644 --- a/core/embed/lib/gfx_color.h +++ b/core/embed/lib/gfx_color.h @@ -20,7 +20,7 @@ #ifndef GFX_COLOR_H #define GFX_COLOR_H -#include +#include #ifdef UI_COLOR_32BIT #define GFX_COLOR_32BIT diff --git a/core/embed/lib/gfx_draw.c b/core/embed/lib/gfx_draw.c index 070a4b310c..ef73105854 100644 --- a/core/embed/lib/gfx_draw.c +++ b/core/embed/lib/gfx_draw.c @@ -17,8 +17,9 @@ * along with this program. If not, see . */ -#include +#include +#include "display.h" #include "display_draw.h" #include "fonts/fonts.h" #include "gfx_draw.h" diff --git a/core/embed/lib/image.c b/core/embed/lib/image.c index 874e9d39e7..c2fd7bf863 100644 --- a/core/embed/lib/image.c +++ b/core/embed/lib/image.c @@ -17,14 +17,13 @@ * along with this program. If not, see . */ -#include +#include +#include #include "ed25519-donna/ed25519.h" -#include "common.h" #include "flash.h" #include "image.h" -#include "model.h" _Static_assert(VENDOR_HEADER_MAX_SIZE + IMAGE_HEADER_SIZE <= IMAGE_CHUNK_SIZE, "The size of the firmware headers must be less than or equal to " diff --git a/core/embed/lib/image.h b/core/embed/lib/image.h index 9ca8c2209a..a2d02dd105 100644 --- a/core/embed/lib/image.h +++ b/core/embed/lib/image.h @@ -20,12 +20,12 @@ #ifndef __TREZORHAL_IMAGE_H__ #define __TREZORHAL_IMAGE_H__ -#include +#include +#include + #include "blake2s.h" #include "flash.h" #include "image_hash_conf.h" -#include "model.h" -#include "secbool.h" #define VENDOR_HEADER_MAX_SIZE (64 * 1024) #define IMAGE_HEADER_SIZE 0x400 // size of the bootloader or firmware header diff --git a/core/embed/lib/image_hash_conf.h b/core/embed/lib/image_hash_conf.h index e8108070c7..e7acaa3564 100644 --- a/core/embed/lib/image_hash_conf.h +++ b/core/embed/lib/image_hash_conf.h @@ -1,8 +1,8 @@ #ifndef LIB_IMAGE_HASH_H_ #define LIB_IMAGE_HASH_H_ -#include "model.h" -#include TREZOR_BOARD +#include +#include #ifdef IMAGE_HASH_SHA256 #include "sha2.h" diff --git a/core/embed/lib/mini_printf.c b/core/embed/lib/mini_printf.c index 907dc50c24..8360d7ddc0 100644 --- a/core/embed/lib/mini_printf.c +++ b/core/embed/lib/mini_printf.c @@ -43,8 +43,8 @@ * */ -#include -#include +#include + #include "mini_printf.h" static unsigned int diff --git a/core/embed/lib/mini_printf.h b/core/embed/lib/mini_printf.h index b3a21eab17..66baf4e7b0 100644 --- a/core/embed/lib/mini_printf.h +++ b/core/embed/lib/mini_printf.h @@ -33,12 +33,14 @@ #ifndef __MINI_PRINTF__ #define __MINI_PRINTF__ +#include + +#include + #ifdef __cplusplus extern "C" { #endif -#include - int mini_vsnprintf(char* buffer, unsigned int buffer_len, const char *fmt, va_list va) __attribute__ ((__format__ (__printf__, 3, 0))); int mini_snprintf(char* buffer, unsigned int buffer_len, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); diff --git a/core/embed/lib/terminal.c b/core/embed/lib/terminal.c index 70f3815351..79f5f300cb 100644 --- a/core/embed/lib/terminal.c +++ b/core/embed/lib/terminal.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD - -#include -#include -#include +#include +#include #include "display.h" #include "fonts/fonts.h" diff --git a/core/embed/lib/translations.c b/core/embed/lib/translations.c index 5053538ef0..e9dcbb6c01 100644 --- a/core/embed/lib/translations.c +++ b/core/embed/lib/translations.c @@ -1,11 +1,9 @@ -#include "translations.h" -#include -#include -#include -#include "common.h" +#include +#include + #include "flash.h" -#include "model.h" #include "mpu.h" +#include "translations.h" #ifdef KERNEL_MODE diff --git a/core/embed/lib/translations.h b/core/embed/lib/translations.h index 9e823650b5..6ea3c42da0 100644 --- a/core/embed/lib/translations.h +++ b/core/embed/lib/translations.h @@ -20,8 +20,7 @@ #ifndef LIB_TRANSLATIONS_H #define LIB_TRANSLATIONS_H -#include -#include +#include bool translations_write(const uint8_t* data, uint32_t offset, uint32_t len); diff --git a/core/embed/trezorhal/common.h b/core/embed/lib/trezor_rtl.h similarity index 77% rename from core/embed/trezorhal/common.h rename to core/embed/lib/trezor_rtl.h index c231f82a0c..24f96875a3 100644 --- a/core/embed/trezorhal/common.h +++ b/core/embed/lib/trezor_rtl.h @@ -17,15 +17,22 @@ * along with this program. If not, see . */ -#ifndef __TREZORHAL_COMMON_H__ -#define __TREZORHAL_COMMON_H__ +#ifndef TREZOR_RTL_H +#define TREZOR_RTL_H -#include -#include -#include "secbool.h" +// `trezor_rtl.h` consolidates common includes for implementation files +// (.c files) and provides essential types and functions. +// +// Do not include `trezor_rtl.h` in interface headers to prevent global +// namespace pollution; use `trezor_types.h` instead. + +#include + +#include +#include +#include #include "error_handling.h" -#include "systick.h" #ifndef MIN_8bits #define MIN_8bits(a, b) \ @@ -54,4 +61,4 @@ #define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) -#endif +#endif // TREZOR_RTL_H diff --git a/core/embed/lib/trezor_types.h b/core/embed/lib/trezor_types.h new file mode 100644 index 0000000000..03aed8fa5f --- /dev/null +++ b/core/embed/lib/trezor_types.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Trezor project, https://trezor.io/ + * + * Copyright (c) SatoshiLabs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TREZOR_TYPES_H +#define TREZOR_TYPES_H + +// `trezor_types.h` consolidates commonly needed includes for interface +// header files and provides essential types required in most files. +// +// Avoid adding additional includes here unless absolutely necessary, +// as it may pollute the global namespace across the project. + +#include +#include +#include + +#include "secbool.h" + +#endif // TREZOR_TYPES_H diff --git a/core/embed/models/trezor_bsp.h b/core/embed/models/trezor_bsp.h new file mode 100644 index 0000000000..01e68c8d63 --- /dev/null +++ b/core/embed/models/trezor_bsp.h @@ -0,0 +1,36 @@ +/* + * This file is part of the Trezor project, https://trezor.io/ + * + * Copyright (c) SatoshiLabs + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef TREZOR_BSP_H +#define TREZOR_BSP_H + +// Trezor 'board support package' (BSP) header file that includes +// all necessary headers for the specific board including STM32 HAL and +// pin definitions. +// +// This file should by only included by driver implementations and +// should not be included by application code. + +#include TREZOR_BOARD + +#ifndef TREZOR_EMULATOR +#include STM32_HAL_H +#endif + +#endif // TREZOR_BOARD_H diff --git a/core/embed/models/model.h b/core/embed/models/trezor_model.h similarity index 100% rename from core/embed/models/model.h rename to core/embed/models/trezor_model.h diff --git a/core/embed/prodtest/main.c b/core/embed/prodtest/main.c index 5ced433426..628db593a1 100644 --- a/core/embed/prodtest/main.c +++ b/core/embed/prodtest/main.c @@ -17,17 +17,17 @@ * along with this program. If not, see . */ +#include +#include +#include + #include #include -#include #include -#include STM32_HAL_H - #include "board_capabilities.h" #include "bootutils.h" #include "button.h" -#include "common.h" #include "display.h" #include "display_draw.h" #include "display_utils.h" @@ -35,15 +35,14 @@ #include "flash_otp.h" #include "fwutils.h" #include "image.h" -#include "model.h" #include "mpu.h" #include "prodtest_common.h" #include "random_delays.h" #include "rsod.h" #include "sbu.h" #include "sdcard.h" -#include "secbool.h" #include "system.h" +#include "systick.h" #include "systimer.h" #include "touch.h" #include "usb.h" diff --git a/core/embed/prodtest/optiga_prodtest.c b/core/embed/prodtest/optiga_prodtest.c index 577fb1fec0..a05484aebf 100644 --- a/core/embed/prodtest/optiga_prodtest.c +++ b/core/embed/prodtest/optiga_prodtest.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "aes/aes.h" #include "buffer.h" @@ -33,8 +33,6 @@ #include "secret.h" #include "sha2.h" -#include TREZOR_BOARD - #ifdef USE_STORAGE_HWKEY #include "secure_aes.h" #endif diff --git a/core/embed/prodtest/optiga_prodtest.h b/core/embed/prodtest/optiga_prodtest.h index 375d642f0d..135403b565 100644 --- a/core/embed/prodtest/optiga_prodtest.h +++ b/core/embed/prodtest/optiga_prodtest.h @@ -20,9 +20,7 @@ #ifndef PRODTEST_OPTIGA_PRODTEST_H #define PRODTEST_OPTIGA_PRODTEST_H -#include -#include -#include +#include #define OID_CERT_INF (OPTIGA_OID_CERT + 0) #define OID_CERT_DEV (OPTIGA_OID_CERT + 1) diff --git a/core/embed/prodtest/prodtest_common.h b/core/embed/prodtest/prodtest_common.h index 221e16cd6b..4c5fdb9e8f 100644 --- a/core/embed/prodtest/prodtest_common.h +++ b/core/embed/prodtest/prodtest_common.h @@ -20,8 +20,7 @@ #ifndef PRODTEST_COMMON_H #define PRODTEST_COMMON_H -#include -#include +#include enum { VCP_IFACE = 0x00 }; diff --git a/core/embed/reflash/main.c b/core/embed/reflash/main.c index 0e7ef45580..fbbce1ca0f 100644 --- a/core/embed/reflash/main.c +++ b/core/embed/reflash/main.c @@ -17,24 +17,22 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include -#include STM32_HAL_H +#include +#include #include "bootutils.h" -#include "common.h" #include "display.h" #include "display_draw.h" #include "flash.h" #include "image.h" -#include "model.h" #include "rng.h" #include "rsod.h" #include "sbu.h" #include "sdcard.h" -#include "secbool.h" #include "system.h" #include "systimer.h" #include "terminal.h" diff --git a/core/embed/rust/rust_ui.h b/core/embed/rust/rust_ui.h index 897c6a3311..8a736eb04e 100644 --- a/core/embed/rust/rust_ui.h +++ b/core/embed/rust/rust_ui.h @@ -1,6 +1,2 @@ -#include - -#include "common.h" - #include "rust_ui_bootloader.h" #include "rust_ui_common.h" diff --git a/core/embed/rust/rust_ui_bootloader.h b/core/embed/rust/rust_ui_bootloader.h index cdddb96a51..b0b4c22322 100644 --- a/core/embed/rust/rust_ui_bootloader.h +++ b/core/embed/rust/rust_ui_bootloader.h @@ -1,4 +1,4 @@ -#include "common.h" +#include uint32_t screen_install_confirm(const char* vendor_str, uint8_t vendor_str_len, const char* version_str, diff --git a/core/embed/rust/rust_ui_common.h b/core/embed/rust/rust_ui_common.h index 6c8a8b7dec..b3af726a14 100644 --- a/core/embed/rust/rust_ui_common.h +++ b/core/embed/rust/rust_ui_common.h @@ -1,4 +1,4 @@ -#include "common.h" +#include void display_rsod_rust(const char* title, const char* message, const char* footer); diff --git a/core/embed/rust/trezorhal.h b/core/embed/rust/trezorhal.h index 48ab14222f..e3fcc5ab91 100644 --- a/core/embed/rust/trezorhal.h +++ b/core/embed/rust/trezorhal.h @@ -1,8 +1,8 @@ -#include TREZOR_BOARD +#include +#include #include "buffers.h" #include "button.h" -#include "common.h" #include "display.h" #include "display_draw.h" #include "dma2d.h" @@ -12,10 +12,10 @@ #include "fonts/fonts.h" #include "gfx_bitblt.h" #include "haptic.h" -#include "model.h" #include "rgb_led.h" #include "secbool.h" #include "storage.h" +#include "systick.h" #include "touch.h" #include "translations.h" #include "usb.h" diff --git a/core/embed/trezorhal/applet.h b/core/embed/trezorhal/applet.h index 72f859cd70..a7fc04f887 100644 --- a/core/embed/trezorhal/applet.h +++ b/core/embed/trezorhal/applet.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_APPLET_H #define TREZORHAL_APPLET_H -#include -#include +#include #ifdef SYSCALL_DISPATCH diff --git a/core/embed/trezorhal/bg_copy.h b/core/embed/trezorhal/bg_copy.h index dac9383d79..8326f0254e 100644 --- a/core/embed/trezorhal/bg_copy.h +++ b/core/embed/trezorhal/bg_copy.h @@ -2,9 +2,7 @@ #ifndef TREZORHAL_BG_COPY_H #define TREZORHAL_BG_COPY_H -#include -#include -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/board_capabilities.h b/core/embed/trezorhal/board_capabilities.h index 8d1bf43a9b..184aaecde9 100644 --- a/core/embed/trezorhal/board_capabilities.h +++ b/core/embed/trezorhal/board_capabilities.h @@ -33,7 +33,7 @@ Simple key-tag-length-value structure at fixed boardloader address. Last tag must be terminator or all space used. */ -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/bootargs.h b/core/embed/trezorhal/bootargs.h index 1cfc5b97e8..422fee0e47 100644 --- a/core/embed/trezorhal/bootargs.h +++ b/core/embed/trezorhal/bootargs.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_BOOTARGS_H #define TREZORHAL_BOOTARGS_H -#include -#include +#include // Defines boot command processed in bootloader on next reboot typedef enum { diff --git a/core/embed/trezorhal/bootutils.h b/core/embed/trezorhal/bootutils.h index 683d2fae42..10b069e913 100644 --- a/core/embed/trezorhal/bootutils.h +++ b/core/embed/trezorhal/bootutils.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_BOOTUTILS_H #define TREZORHAL_BOOTUTILS_H -#include -#include +#include // Immediately resets the device and initiates the normal boot sequence. void __attribute__((noreturn)) reboot_device(void); diff --git a/core/embed/trezorhal/button.h b/core/embed/trezorhal/button.h index fa54013bcb..0f77b436ba 100644 --- a/core/embed/trezorhal/button.h +++ b/core/embed/trezorhal/button.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_BUTTON_H #define TREZORHAL_BUTTON_H -#include +#include #define BTN_EVT_DOWN (1U << 24) #define BTN_EVT_UP (1U << 25) diff --git a/core/embed/trezorhal/display.h b/core/embed/trezorhal/display.h index 34def49aa4..98afdf4fbc 100644 --- a/core/embed/trezorhal/display.h +++ b/core/embed/trezorhal/display.h @@ -24,10 +24,8 @@ #include #else -#include -#include "common.h" - -#include TREZOR_BOARD +#include +#include #ifdef DISPLAY_LEGACY_HEADER #include DISPLAY_LEGACY_HEADER diff --git a/core/embed/trezorhal/dma2d.h b/core/embed/trezorhal/dma2d.h index 3f8d8f79b9..642e9e9ec4 100644 --- a/core/embed/trezorhal/dma2d.h +++ b/core/embed/trezorhal/dma2d.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_DMA2D_H #define TREZORHAL_DMA2D_H -#include "common.h" +#include void dma2d_init(void); diff --git a/core/embed/trezorhal/entropy.h b/core/embed/trezorhal/entropy.h index c71d0aab4f..290c2a1162 100644 --- a/core/embed/trezorhal/entropy.h +++ b/core/embed/trezorhal/entropy.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_ENTROPY_H #define TREZORHAL_ENTROPY_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/flash.h b/core/embed/trezorhal/flash.h index bbcb5393dd..616bc2f113 100644 --- a/core/embed/trezorhal/flash.h +++ b/core/embed/trezorhal/flash.h @@ -20,11 +20,9 @@ #ifndef TREZORHAL_FLASH_H #define TREZORHAL_FLASH_H -#include -#include +#include #include "flash_ll.h" -#include "secbool.h" #ifdef USE_FLASH_BURST diff --git a/core/embed/trezorhal/flash_otp.h b/core/embed/trezorhal/flash_otp.h index 56d05a237a..e1003b3609 100644 --- a/core/embed/trezorhal/flash_otp.h +++ b/core/embed/trezorhal/flash_otp.h @@ -1,7 +1,7 @@ #ifndef TREZORHAL_FLASH_OTP_H #define TREZORHAL_FLASH_OTP_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/fwutils.h b/core/embed/trezorhal/fwutils.h index f29bc5ff63..69c77a2f2c 100644 --- a/core/embed/trezorhal/fwutils.h +++ b/core/embed/trezorhal/fwutils.h @@ -20,9 +20,7 @@ #ifndef TREZORHAL_FWUTILS_H #define TREZORHAL_FWUTILS_H -#include - -#include "secbool.h" +#include // Callback function for firmware hash calculation. typedef void (*firmware_hash_callback_t)(void* context, uint32_t progress, diff --git a/core/embed/trezorhal/haptic.h b/core/embed/trezorhal/haptic.h index 6cb60ee9bb..b6e1e26e3d 100644 --- a/core/embed/trezorhal/haptic.h +++ b/core/embed/trezorhal/haptic.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_HAPTIC_H #define TREZORHAL_HAPTIC_H -#include -#include +#include typedef enum { // Effect at the start of a button press diff --git a/core/embed/trezorhal/hash_processor.h b/core/embed/trezorhal/hash_processor.h index c7a84a4e68..3a7c6ddf9b 100644 --- a/core/embed/trezorhal/hash_processor.h +++ b/core/embed/trezorhal/hash_processor.h @@ -1,7 +1,7 @@ #ifndef TREZORHAL_HASH_PROCESSOR_H_ #define TREZORHAL_HASH_PROCESSOR_H_ -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/i2c_bus.h b/core/embed/trezorhal/i2c_bus.h index 2296a4d2c4..9163218b4a 100644 --- a/core/embed/trezorhal/i2c_bus.h +++ b/core/embed/trezorhal/i2c_bus.h @@ -20,9 +20,7 @@ #ifndef TREZORHAL_I2C_BUS_H #define TREZORHAL_I2C_BUS_H -#include -#include -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/monoctr.h b/core/embed/trezorhal/monoctr.h index e6394583f1..df6bd72032 100644 --- a/core/embed/trezorhal/monoctr.h +++ b/core/embed/trezorhal/monoctr.h @@ -22,13 +22,12 @@ #ifdef KERNEL_MODE +#include + // Monoctr module provides monotonic counter functionality #define MONOCTR_MAX_VALUE 63 -#include -#include "secbool.h" - typedef enum { MONOCTR_BOOTLOADER_VERSION = 0, MONOCTR_FIRMWARE_VERSION = 1, diff --git a/core/embed/trezorhal/mpu.h b/core/embed/trezorhal/mpu.h index 657d311356..dfe887b147 100644 --- a/core/embed/trezorhal/mpu.h +++ b/core/embed/trezorhal/mpu.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_MPU_H #define TREZORHAL_MPU_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/optiga.h b/core/embed/trezorhal/optiga.h index b3a133a629..1195a0b245 100644 --- a/core/embed/trezorhal/optiga.h +++ b/core/embed/trezorhal/optiga.h @@ -20,9 +20,8 @@ #ifndef TREZORHAL_OPTIGA_H #define TREZORHAL_OPTIGA_H -#include -#include -#include +#include + #include "optiga_common.h" #include "storage.h" diff --git a/core/embed/trezorhal/optiga/optiga.c b/core/embed/trezorhal/optiga/optiga.c index d4fa2e2391..b7ad7154df 100644 --- a/core/embed/trezorhal/optiga/optiga.c +++ b/core/embed/trezorhal/optiga/optiga.c @@ -17,11 +17,12 @@ * along with this program. If not, see . */ -#include "optiga.h" -#include +#include + #include "hash_to_curve.h" #include "hmac.h" #include "memzero.h" +#include "optiga.h" #include "optiga_commands.h" #include "optiga_transport.h" #include "rand.h" diff --git a/core/embed/trezorhal/optiga/optiga_commands.c b/core/embed/trezorhal/optiga/optiga_commands.c index 1041adc887..e25f5b7cca 100644 --- a/core/embed/trezorhal/optiga/optiga_commands.c +++ b/core/embed/trezorhal/optiga/optiga_commands.c @@ -23,13 +23,14 @@ * https://github.com/Infineon/optiga-trust-m/blob/develop/documents/Infineon_I2C_Protocol_v2.03.pdf */ -#include "optiga_commands.h" -#include +#include + #include "der.h" #include "ecdsa.h" #include "hmac.h" #include "memzero.h" #include "nist256p1.h" +#include "optiga_commands.h" #include "optiga_transport.h" #include "sha2.h" diff --git a/core/embed/trezorhal/optiga/optiga_transport.c b/core/embed/trezorhal/optiga/optiga_transport.c index 3ac1d82054..5a1413ea18 100644 --- a/core/embed/trezorhal/optiga/optiga_transport.c +++ b/core/embed/trezorhal/optiga/optiga_transport.c @@ -22,19 +22,19 @@ * https://github.com/Infineon/optiga-trust-m/blob/develop/documents/Infineon_I2C_Protocol_v2.03.pdf */ -#include "optiga_transport.h" -#include +#include +#include + #include "aes/aesccm.h" -#include "common.h" #include "i2c_bus.h" #include "memzero.h" #include "optiga_hal.h" +#include "optiga_transport.h" +#include "systick.h" #include "tls_prf.h" #ifdef KERNEL_MODE -#include TREZOR_BOARD - // Maximum possible packet size that can be transmitted. #define OPTIGA_MAX_PACKET_SIZE (OPTIGA_DATA_REG_LEN - 5) diff --git a/core/embed/trezorhal/optiga_commands.h b/core/embed/trezorhal/optiga_commands.h index 61cd7d949f..5fbaecb54b 100644 --- a/core/embed/trezorhal/optiga_commands.h +++ b/core/embed/trezorhal/optiga_commands.h @@ -20,9 +20,8 @@ #ifndef TREZORHAL_OPTIGA_COMMANDS_H #define TREZORHAL_OPTIGA_COMMANDS_H -#include -#include -#include +#include + #include "optiga_common.h" // Data object identifiers. diff --git a/core/embed/trezorhal/optiga_common.h b/core/embed/trezorhal/optiga_common.h index 21d74aed68..6447e7ca1f 100644 --- a/core/embed/trezorhal/optiga_common.h +++ b/core/embed/trezorhal/optiga_common.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_OPTIGA_COMMON_H #define TREZORHAL_OPTIGA_COMMON_H -#include "secbool.h" +#include typedef enum _optiga_result { OPTIGA_SUCCESS = 0, // Operation completed successfully. diff --git a/core/embed/trezorhal/optiga_hal.h b/core/embed/trezorhal/optiga_hal.h index e91bc03e2d..c744c1c09b 100644 --- a/core/embed/trezorhal/optiga_hal.h +++ b/core/embed/trezorhal/optiga_hal.h @@ -2,8 +2,7 @@ #ifndef CORE_OPTIGA_HAL_H #define CORE_OPTIGA_HAL_H -#include -#include "secbool.h" +#include void optiga_hal_init(void); diff --git a/core/embed/trezorhal/optiga_transport.h b/core/embed/trezorhal/optiga_transport.h index 041c88250b..3d9b914f9c 100644 --- a/core/embed/trezorhal/optiga_transport.h +++ b/core/embed/trezorhal/optiga_transport.h @@ -20,9 +20,8 @@ #ifndef TREZORHAL_OPTIGA_TRANSPORT_H #define TREZORHAL_OPTIGA_TRANSPORT_H -#include -#include -#include +#include + #include "optiga_common.h" // Maximum data register length supported by OPTIGA. diff --git a/core/embed/trezorhal/option_bytes.h b/core/embed/trezorhal/option_bytes.h index 802db911ba..d48900a533 100644 --- a/core/embed/trezorhal/option_bytes.h +++ b/core/embed/trezorhal/option_bytes.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_OPTION_BYTES_H #define TREZORHAL_OPTION_BYTES_H -#include "secbool.h" +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/random_delays.h b/core/embed/trezorhal/random_delays.h index 46d6e0e482..0c73f8b921 100644 --- a/core/embed/trezorhal/random_delays.h +++ b/core/embed/trezorhal/random_delays.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_RANDOM_DELAYS_H #define TREZORHAL_RANDOM_DELAYS_H -#include +#include /* Random delay interrupts (RDI) is a contermeasure against side channel attacks. diff --git a/core/embed/trezorhal/reset_flags.h b/core/embed/trezorhal/reset_flags.h index 52ae40d557..ed294da9c5 100644 --- a/core/embed/trezorhal/reset_flags.h +++ b/core/embed/trezorhal/reset_flags.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_RESET_FLAGS_H #define TREZORHAL_RESET_FLAGS_H -#include "secbool.h" +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/rgb_led.h b/core/embed/trezorhal/rgb_led.h index 1ad62d9b80..65158b5495 100644 --- a/core/embed/trezorhal/rgb_led.h +++ b/core/embed/trezorhal/rgb_led.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_RGB_LED_H #define TREZORHAL_RGB_LED_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/rng.h b/core/embed/trezorhal/rng.h index 7c9dc69a18..4b5dfb8510 100644 --- a/core/embed/trezorhal/rng.h +++ b/core/embed/trezorhal/rng.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_RNG_H #define TREZORHAL_RNG_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/sbu.h b/core/embed/trezorhal/sbu.h index fef077954b..beee606260 100644 --- a/core/embed/trezorhal/sbu.h +++ b/core/embed/trezorhal/sbu.h @@ -20,7 +20,7 @@ #ifndef __TREZORHAL_SBU_H__ #define __TREZORHAL_SBU_H__ -#include "secbool.h" +#include #if KERNEL_MODE diff --git a/core/embed/trezorhal/sdcard.h b/core/embed/trezorhal/sdcard.h index 730b33210f..47853c5bec 100644 --- a/core/embed/trezorhal/sdcard.h +++ b/core/embed/trezorhal/sdcard.h @@ -46,8 +46,7 @@ #ifndef __TREZORHAL_SDCARD_H__ #define __TREZORHAL_SDCARD_H__ -#include -#include "secbool.h" +#include // this is a fixed size and should not be changed #define SDCARD_BLOCK_SIZE (512) diff --git a/core/embed/trezorhal/secret.h b/core/embed/trezorhal/secret.h index 5bb457bb6a..3540ad1a74 100644 --- a/core/embed/trezorhal/secret.h +++ b/core/embed/trezorhal/secret.h @@ -1,8 +1,7 @@ #ifndef TREZORHAL_SECRET_H #define TREZORHAL_SECRET_H -#include -#include "secbool.h" +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/secure_aes.h b/core/embed/trezorhal/secure_aes.h index 9849e68c03..8819fb0c05 100644 --- a/core/embed/trezorhal/secure_aes.h +++ b/core/embed/trezorhal/secure_aes.h @@ -20,9 +20,7 @@ #ifndef TREZOR_HAL_SECURE_AES_H #define TREZOR_HAL_SECURE_AES_H -#include -#include -#include +#include // only some of the keys are supported depending on execution environment typedef enum { diff --git a/core/embed/trezorhal/stm32f4/applet.c b/core/embed/trezorhal/stm32f4/applet.c index 7d81d066a7..8945e8a993 100644 --- a/core/embed/trezorhal/stm32f4/applet.c +++ b/core/embed/trezorhal/stm32f4/applet.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "applet.h" #include "display.h" diff --git a/core/embed/trezorhal/stm32f4/backlight_pwm.c b/core/embed/trezorhal/stm32f4/backlight_pwm.c index 47d88000b1..8f30ef9b71 100644 --- a/core/embed/trezorhal/stm32f4/backlight_pwm.c +++ b/core/embed/trezorhal/stm32f4/backlight_pwm.c @@ -17,14 +17,11 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include "backlight_pwm.h" -#include "common.h" - -#include STM32_HAL_H -#include TREZOR_BOARD +#include "systick.h" // Requested PWM Timer clock frequency [Hz] #define TIM_FREQ 10000000 diff --git a/core/embed/trezorhal/stm32f4/board_capabilities.c b/core/embed/trezorhal/stm32f4/board_capabilities.c index 4cdcbf6999..509d7618c8 100644 --- a/core/embed/trezorhal/stm32f4/board_capabilities.c +++ b/core/embed/trezorhal/stm32f4/board_capabilities.c @@ -17,11 +17,10 @@ * along with this program. If not, see . */ -#include +#include +#include #include "board_capabilities.h" -#include "common.h" -#include "model.h" #include "mpu.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/bootutils.c b/core/embed/trezorhal/stm32f4/bootutils.c index f9bd6bb1a9..602aa0c23c 100644 --- a/core/embed/trezorhal/stm32f4/bootutils.c +++ b/core/embed/trezorhal/stm32f4/bootutils.c @@ -17,17 +17,15 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include +#include +#include +#include #include "bootargs.h" #include "bootutils.h" -#include "common.h" #include "display.h" #include "image.h" #include "irq.h" -#include "model.h" #include "mpu.h" #ifdef TREZOR_MODEL_T diff --git a/core/embed/trezorhal/stm32f4/button.c b/core/embed/trezorhal/stm32f4/button.c index 544b8ba482..66676aa465 100644 --- a/core/embed/trezorhal/stm32f4/button.c +++ b/core/embed/trezorhal/stm32f4/button.c @@ -1,6 +1,8 @@ -#include STM32_HAL_H + +#include +#include + #include "button.h" -#include TREZOR_BOARD #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/consumption_mask.c b/core/embed/trezorhal/stm32f4/consumption_mask.c index 7263377d72..085961eeb3 100644 --- a/core/embed/trezorhal/stm32f4/consumption_mask.c +++ b/core/embed/trezorhal/stm32f4/consumption_mask.c @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include + #include "mpu.h" #include "rng.h" diff --git a/core/embed/trezorhal/stm32f4/displays/ili9341_spi.c b/core/embed/trezorhal/stm32f4/displays/ili9341_spi.c index 50a1f228c0..1b317c6752 100644 --- a/core/embed/trezorhal/stm32f4/displays/ili9341_spi.c +++ b/core/embed/trezorhal/stm32f4/displays/ili9341_spi.c @@ -1,9 +1,9 @@ -#include -#include TREZOR_BOARD +#include +#include + #include "ili9341_spi.h" -#include STM32_HAL_H /** * @brief ILI9341 chip IDs diff --git a/core/embed/trezorhal/stm32f4/displays/ltdc.c b/core/embed/trezorhal/stm32f4/displays/ltdc.c index 515106e74a..24b54960a0 100644 --- a/core/embed/trezorhal/stm32f4/displays/ltdc.c +++ b/core/embed/trezorhal/stm32f4/displays/ltdc.c @@ -17,13 +17,12 @@ * along with this program. If not, see . */ -#include -#include TREZOR_BOARD -#include "display.h" -#include "memzero.h" -#include STM32_HAL_H +#include +#include +#include "display.h" #include "ili9341_spi.h" +#include "memzero.h" #include "sdram.h" #define MAX_LAYER_NUMBER 2 diff --git a/core/embed/trezorhal/stm32f4/displays/ltdc.h b/core/embed/trezorhal/stm32f4/displays/ltdc.h index b07020a757..34cb288a78 100644 --- a/core/embed/trezorhal/stm32f4/displays/ltdc.h +++ b/core/embed/trezorhal/stm32f4/displays/ltdc.h @@ -2,7 +2,7 @@ #ifndef _LTDC_H #define _LTDC_H -#include STM32_HAL_H +#include #define DISPLAY_FRAMEBUFFER_WIDTH DISPLAY_RESX #define DISPLAY_FRAMEBUFFER_HEIGHT DISPLAY_RESY diff --git a/core/embed/trezorhal/stm32f4/displays/st7789v.c b/core/embed/trezorhal/stm32f4/displays/st7789v.c index 5e27ea1c8f..47c98c4972 100644 --- a/core/embed/trezorhal/stm32f4/displays/st7789v.c +++ b/core/embed/trezorhal/stm32f4/displays/st7789v.c @@ -17,16 +17,14 @@ * along with this program. If not, see . */ -#include -#include -#include -#include TREZOR_BOARD +#include +#include + #include "backlight_pwm.h" #include "display.h" #include "irq.h" #include "memzero.h" #include "st7789v.h" -#include STM32_HAL_H #ifdef TREZOR_MODEL_T #include "displays/panels/154a.h" diff --git a/core/embed/trezorhal/stm32f4/displays/st7789v.h b/core/embed/trezorhal/stm32f4/displays/st7789v.h index 17b9ece346..38851867de 100644 --- a/core/embed/trezorhal/stm32f4/displays/st7789v.h +++ b/core/embed/trezorhal/stm32f4/displays/st7789v.h @@ -1,15 +1,14 @@ #ifndef _ST7789V_H #define _ST7789V_H -#include STM32_HAL_H +#include +#include typedef struct { uint16_t x; uint16_t y; } display_padding_t; -#include TREZOR_BOARD - // ILI9341V, GC9307 and ST7789V drivers support 240px x 320px display resolution #define MAX_DISPLAY_RESX 240 #define MAX_DISPLAY_RESY 320 diff --git a/core/embed/trezorhal/stm32f4/displays/ug-2828tswig01.c b/core/embed/trezorhal/stm32f4/displays/ug-2828tswig01.c index 54c602e800..18a1519065 100644 --- a/core/embed/trezorhal/stm32f4/displays/ug-2828tswig01.c +++ b/core/embed/trezorhal/stm32f4/displays/ug-2828tswig01.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include -#include TREZOR_BOARD +#include +#include + #include "display.h" #include "memzero.h" -#include STM32_HAL_H // FSMC/FMC Bank 1 - NOR/PSRAM 1 #define DISPLAY_MEMORY_BASE 0x60000000 diff --git a/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c b/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c index a7166a070f..c72173f217 100644 --- a/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c +++ b/core/embed/trezorhal/stm32f4/displays/vg-2864ksweg01.c @@ -17,11 +17,10 @@ * along with this program. If not, see . */ -#include -#include -#include TREZOR_BOARD +#include +#include + #include "display.h" -#include STM32_HAL_H #ifdef USE_CONSUMPTION_MASK #include "consumption_mask.h" diff --git a/core/embed/trezorhal/stm32f4/dma2d.c b/core/embed/trezorhal/stm32f4/dma2d.c index c479d4b4c3..861eadd66a 100644 --- a/core/embed/trezorhal/stm32f4/dma2d.c +++ b/core/embed/trezorhal/stm32f4/dma2d.c @@ -17,10 +17,11 @@ * along with this program. If not, see . */ -#include "dma2d.h" +#include + #include "colors.h" -#include STM32_HAL_H #include "display.h" +#include "dma2d.h" typedef enum { DMA2D_LAYER_FG = 1, diff --git a/core/embed/trezorhal/stm32f4/dma2d_bitblt.c b/core/embed/trezorhal/stm32f4/dma2d_bitblt.c index 87bc6452f6..3668ba2e0a 100644 --- a/core/embed/trezorhal/stm32f4/dma2d_bitblt.c +++ b/core/embed/trezorhal/stm32f4/dma2d_bitblt.c @@ -17,9 +17,8 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include +#include +#include #include "dma2d_bitblt.h" #include "gfx_color.h" diff --git a/core/embed/trezorhal/stm32f4/entropy.c b/core/embed/trezorhal/stm32f4/entropy.c index 99fb0d6974..a2ce11ea77 100644 --- a/core/embed/trezorhal/stm32f4/entropy.c +++ b/core/embed/trezorhal/stm32f4/entropy.c @@ -17,13 +17,11 @@ * along with this program. If not, see . */ -#include - -#include "entropy.h" +#include +#include #include "entropy.h" #include "flash_otp.h" -#include "model.h" #include "mpu.h" #include "rand.h" diff --git a/core/embed/trezorhal/stm32f4/flash.c b/core/embed/trezorhal/stm32f4/flash.c index 5a0b2c5cb4..42e78d62da 100644 --- a/core/embed/trezorhal/stm32f4/flash.c +++ b/core/embed/trezorhal/stm32f4/flash.c @@ -17,11 +17,9 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include -#include - -#include "common.h" #include "flash.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/flash_otp.c b/core/embed/trezorhal/stm32f4/flash_otp.c index 6260426994..10226edb42 100644 --- a/core/embed/trezorhal/stm32f4/flash_otp.c +++ b/core/embed/trezorhal/stm32f4/flash_otp.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include -#include "flash_otp.h" -#include "common.h" #include "flash.h" +#include "flash_otp.h" #include "mpu.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/fwutils.c b/core/embed/trezorhal/stm32f4/fwutils.c index 72172f2396..cd5fd055e4 100644 --- a/core/embed/trezorhal/stm32f4/fwutils.c +++ b/core/embed/trezorhal/stm32f4/fwutils.c @@ -17,19 +17,15 @@ * along with this program. If not, see . */ -#ifndef TREZOR_EMULATOR -#include STM32_HAL_H -#endif - -#include +#include +#include +#include #include "blake2s.h" -#include "error_handling.h" #include "flash.h" #include "flash_area.h" #include "fwutils.h" #include "image.h" -#include "model.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/i2c_bus.c b/core/embed/trezorhal/stm32f4/i2c_bus.c index 5e407e0291..dc9136cce7 100644 --- a/core/embed/trezorhal/stm32f4/i2c_bus.c +++ b/core/embed/trezorhal/stm32f4/i2c_bus.c @@ -17,16 +17,14 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include -#include - -#include "common.h" #include "i2c_bus.h" #include "irq.h" #include "mpu.h" #include "systemview.h" +#include "systick.h" #include "systimer.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/irq.h b/core/embed/trezorhal/stm32f4/irq.h index 525bb92043..fda030524f 100644 --- a/core/embed/trezorhal/stm32f4/irq.h +++ b/core/embed/trezorhal/stm32f4/irq.h @@ -20,8 +20,8 @@ #ifndef TREZORHAL_IRQ_H #define TREZORHAL_IRQ_H -#include STM32_HAL_H -#include +#include +#include // Enables simple IRQ statistics for debugging #define IRQ_ENABLE_STATS (0) diff --git a/core/embed/trezorhal/stm32f4/layout.c b/core/embed/trezorhal/stm32f4/layout.c index 12c2a9530c..75f6bb3084 100644 --- a/core/embed/trezorhal/stm32f4/layout.c +++ b/core/embed/trezorhal/stm32f4/layout.c @@ -17,13 +17,11 @@ * along with this program. If not, see . */ -#ifndef TREZOR_EMULATOR -#include STM32_HAL_H -#endif +#include +#include #include "flash.h" #include "layout_helpers.h" -#include "model.h" // Convert sector number to address // diff --git a/core/embed/trezorhal/stm32f4/monoctr.c b/core/embed/trezorhal/stm32f4/monoctr.c index 119b2070bf..554255e5a3 100644 --- a/core/embed/trezorhal/stm32f4/monoctr.c +++ b/core/embed/trezorhal/stm32f4/monoctr.c @@ -17,11 +17,12 @@ * along with this program. If not, see . */ -#include "monoctr.h" +#include +#include + #include "flash_otp.h" -#include "model.h" +#include "monoctr.h" #include "mpu.h" -#include "string.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/mpu.c b/core/embed/trezorhal/stm32f4/mpu.c index 230c5d625c..6fb954a01c 100644 --- a/core/embed/trezorhal/stm32f4/mpu.c +++ b/core/embed/trezorhal/stm32f4/mpu.c @@ -17,14 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD - -#include -#include +#include +#include +#include #include "irq.h" -#include "model.h" #include "mpu.h" #include "stm32f4xx_ll_cortex.h" diff --git a/core/embed/trezorhal/stm32f4/optiga_hal.c b/core/embed/trezorhal/stm32f4/optiga_hal.c index b1d60acfa5..e1efb96651 100644 --- a/core/embed/trezorhal/stm32f4/optiga_hal.c +++ b/core/embed/trezorhal/stm32f4/optiga_hal.c @@ -1,7 +1,8 @@ +#include +#include + #include "optiga_hal.h" -#include "common.h" -#include TREZOR_BOARD -#include STM32_HAL_H +#include "systick.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/option_bytes.c b/core/embed/trezorhal/stm32f4/option_bytes.c index be42e799ad..03707c25fb 100644 --- a/core/embed/trezorhal/stm32f4/option_bytes.c +++ b/core/embed/trezorhal/stm32f4/option_bytes.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include -#include "option_bytes.h" #include "flash_otp.h" #include "mpu.h" +#include "option_bytes.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/pvd.c b/core/embed/trezorhal/stm32f4/pvd.c index 0f74ff9536..5db6c32e65 100644 --- a/core/embed/trezorhal/stm32f4/pvd.c +++ b/core/embed/trezorhal/stm32f4/pvd.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "bootutils.h" #include "irq.h" diff --git a/core/embed/trezorhal/stm32f4/random_delays.c b/core/embed/trezorhal/stm32f4/random_delays.c index 3861c1f8d8..0b3e25021f 100644 --- a/core/embed/trezorhal/stm32f4/random_delays.c +++ b/core/embed/trezorhal/stm32f4/random_delays.c @@ -17,15 +17,14 @@ * along with this program. If not, see . */ -#include "random_delays.h" +#include #include -#include #include "chacha_drbg.h" -#include "common.h" #include "memzero.h" #include "rand.h" +#include "random_delays.h" #include "systimer.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/reset_flags.c b/core/embed/trezorhal/stm32f4/reset_flags.c index ce4a664b93..2525973c89 100644 --- a/core/embed/trezorhal/stm32f4/reset_flags.c +++ b/core/embed/trezorhal/stm32f4/reset_flags.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include #include "reset_flags.h" diff --git a/core/embed/trezorhal/stm32f4/rgb_led.c b/core/embed/trezorhal/stm32f4/rgb_led.c index 8d0fbd3799..2eeca39630 100644 --- a/core/embed/trezorhal/stm32f4/rgb_led.c +++ b/core/embed/trezorhal/stm32f4/rgb_led.c @@ -37,12 +37,11 @@ * bit is sent. */ -#include "common.h" +#include +#include #ifdef KERNEL_MODE -#include STM32_HAL_H - #define RESET_DATA_LEN 18 // >80us no pulse before sending data #define DATA_LEN 25 // 24 RGB bits and a final zero #define TIMER_PERIOD 832 // cca 200 KHz @ 180MHz diff --git a/core/embed/trezorhal/stm32f4/rng.c b/core/embed/trezorhal/stm32f4/rng.c index a6ae2b57c3..ebc1dc73bb 100644 --- a/core/embed/trezorhal/stm32f4/rng.c +++ b/core/embed/trezorhal/stm32f4/rng.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include #include "rng.h" diff --git a/core/embed/trezorhal/stm32f4/sbu.c b/core/embed/trezorhal/stm32f4/sbu.c index 0756c9e9e8..0ef93273b8 100644 --- a/core/embed/trezorhal/stm32f4/sbu.c +++ b/core/embed/trezorhal/stm32f4/sbu.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include #include "sbu.h" diff --git a/core/embed/trezorhal/stm32f4/sdcard.c b/core/embed/trezorhal/stm32f4/sdcard.c index 386ccef036..02e01acd4f 100644 --- a/core/embed/trezorhal/stm32f4/sdcard.c +++ b/core/embed/trezorhal/stm32f4/sdcard.c @@ -43,10 +43,8 @@ * THE SOFTWARE. */ -#include STM32_HAL_H -#include TREZOR_BOARD - -#include +#include +#include #include "irq.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32f4/sdram.h b/core/embed/trezorhal/stm32f4/sdram.h index 78b4b6c0ec..5b3fe48495 100644 --- a/core/embed/trezorhal/stm32f4/sdram.h +++ b/core/embed/trezorhal/stm32f4/sdram.h @@ -25,7 +25,7 @@ extern "C" { #endif -#include STM32_HAL_H +#include /** @addtogroup BSP * @{ diff --git a/core/embed/trezorhal/stm32f4/secret.c b/core/embed/trezorhal/stm32f4/secret.c index de6dd3297a..c2e6152e16 100644 --- a/core/embed/trezorhal/stm32f4/secret.c +++ b/core/embed/trezorhal/stm32f4/secret.c @@ -1,10 +1,10 @@ -#include "secret.h" -#include -#include "common.h" +#include +#include + #include "display_draw.h" #include "flash.h" -#include "model.h" #include "mpu.h" +#include "secret.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/startup_init.c b/core/embed/trezorhal/stm32f4/startup_init.c index 9b2d4be986..7f7aae0d6d 100644 --- a/core/embed/trezorhal/stm32f4/startup_init.c +++ b/core/embed/trezorhal/stm32f4/startup_init.c @@ -17,12 +17,12 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include -#include "startup_init.h" #include "bootutils.h" #include "rng.h" +#include "startup_init.h" #include "systick.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/syscall.h b/core/embed/trezorhal/stm32f4/syscall.h index 944cd2981d..aafdbc8f3f 100644 --- a/core/embed/trezorhal/stm32f4/syscall.h +++ b/core/embed/trezorhal/stm32f4/syscall.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_SYSCALL_H #define TREZORHAL_SYSCALL_H -#include +#include #include "applet.h" #include "syscall_numbers.h" diff --git a/core/embed/trezorhal/stm32f4/syscall_dispatch.c b/core/embed/trezorhal/stm32f4/syscall_dispatch.c index f0bb5f92f7..9f61e41716 100644 --- a/core/embed/trezorhal/stm32f4/syscall_dispatch.c +++ b/core/embed/trezorhal/stm32f4/syscall_dispatch.c @@ -17,9 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include TREZOR_BOARD +#include #include "syscall.h" diff --git a/core/embed/trezorhal/stm32f4/syscall_probe.c b/core/embed/trezorhal/stm32f4/syscall_probe.c index 525b396a1d..6194c82eef 100644 --- a/core/embed/trezorhal/stm32f4/syscall_probe.c +++ b/core/embed/trezorhal/stm32f4/syscall_probe.c @@ -17,9 +17,10 @@ * along with this program. If not, see . */ -#include "syscall_probe.h" +#include + #include "applet.h" -#include "model.h" +#include "syscall_probe.h" #ifdef SYSCALL_DISPATCH diff --git a/core/embed/trezorhal/stm32f4/syscall_probe.h b/core/embed/trezorhal/stm32f4/syscall_probe.h index b3353ef890..f026d7e12c 100644 --- a/core/embed/trezorhal/stm32f4/syscall_probe.h +++ b/core/embed/trezorhal/stm32f4/syscall_probe.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_SYSCALL_PROBE_H #define TREZORHAL_SYSCALL_PROBE_H -#include -#include +#include #include "system.h" diff --git a/core/embed/trezorhal/stm32f4/syscall_verifiers.c b/core/embed/trezorhal/stm32f4/syscall_verifiers.c index 6aaf7da095..371fdea8ea 100644 --- a/core/embed/trezorhal/stm32f4/syscall_verifiers.c +++ b/core/embed/trezorhal/stm32f4/syscall_verifiers.c @@ -17,9 +17,8 @@ * along with this program. If not, see . */ -#include +#include -#include "common.h" #include "syscall_probe.h" #include "syscall_verifiers.h" #include "systask.h" diff --git a/core/embed/trezorhal/stm32f4/systask.c b/core/embed/trezorhal/stm32f4/systask.c index 277cb2f406..720ce6eada 100644 --- a/core/embed/trezorhal/stm32f4/systask.c +++ b/core/embed/trezorhal/stm32f4/systask.c @@ -17,13 +17,10 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include -#include +#include +#include #include "bootutils.h" -#include "common.h" #include "irq.h" #include "mpu.h" #include "syscall.h" diff --git a/core/embed/trezorhal/stm32f4/system.c b/core/embed/trezorhal/stm32f4/system.c index 1083bf99fc..1d44175dbd 100644 --- a/core/embed/trezorhal/stm32f4/system.c +++ b/core/embed/trezorhal/stm32f4/system.c @@ -17,9 +17,8 @@ * along with this program. If not, see . */ -#include STM32_HAL_H - -#include +#include +#include #include "bootutils.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32f4/systick.c b/core/embed/trezorhal/stm32f4/systick.c index 359f3e2724..790949fbab 100644 --- a/core/embed/trezorhal/stm32f4/systick.c +++ b/core/embed/trezorhal/stm32f4/systick.c @@ -17,8 +17,7 @@ * along with this program. If not, see . */ -#include -#include +#include #include "irq.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32f4/systick_internal.h b/core/embed/trezorhal/stm32f4/systick_internal.h index 0f7a9a071a..1b98fe196e 100644 --- a/core/embed/trezorhal/stm32f4/systick_internal.h +++ b/core/embed/trezorhal/stm32f4/systick_internal.h @@ -1,7 +1,7 @@ #ifndef TREZORHAL_SYSTICK_INTERNAL_H #define TREZORHAL_SYSTICK_INTERNAL_H -#include +#include #include "systick.h" diff --git a/core/embed/trezorhal/stm32f4/systimer.c b/core/embed/trezorhal/stm32f4/systimer.c index 278958af82..f1215e6b76 100644 --- a/core/embed/trezorhal/stm32f4/systimer.c +++ b/core/embed/trezorhal/stm32f4/systimer.c @@ -17,8 +17,7 @@ * along with this program. If not, see . */ -#include -#include +#include #include "irq.h" #include "systick_internal.h" diff --git a/core/embed/trezorhal/stm32f4/touch/ft6x36.c b/core/embed/trezorhal/stm32f4/touch/ft6x36.c index d6e419c37b..d28c598b77 100644 --- a/core/embed/trezorhal/stm32f4/touch/ft6x36.c +++ b/core/embed/trezorhal/stm32f4/touch/ft6x36.c @@ -17,19 +17,14 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include #ifdef KERNEL_MODE -#include -#include -#include - -#include "common.h" - #include "ft6x36.h" #include "i2c_bus.h" +#include "systick.h" #include "touch.h" #ifdef TOUCH_PANEL_LX154A2422CPT23 diff --git a/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.c b/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.c index 36405ee91a..73553e050d 100644 --- a/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.c +++ b/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.c @@ -18,11 +18,11 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include +#include #include "lx154a2422cpt23.h" - -#include "model.h" #include "touch.h" void lhs200kb_if21_touch_correction(uint16_t x, uint16_t y, uint16_t *x_new, diff --git a/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.h b/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.h index 73c53961d1..cbd60d5b3e 100644 --- a/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.h +++ b/core/embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_TOUCH_LX154A2422CPT23_H #define TREZORHAL_TOUCH_LX154A2422CPT23_H -#include +#include // Performs touch coordinates correction needed for a specific panel // Input parameteres x, y represent original touch coordinates. diff --git a/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.c b/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.c index 1f412a0acb..92bb1c8818 100644 --- a/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.c +++ b/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include +#include #include "lx154a2422cpt23.h" - -#include "model.h" #include "touch.h" void lx154a2422cpt23_touch_correction(uint16_t x, uint16_t y, uint16_t *x_new, diff --git a/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.h b/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.h index bb17bf5d2a..8d6b0ea3ed 100644 --- a/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.h +++ b/core/embed/trezorhal/stm32f4/touch/panels/lx154a2422cpt23.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_TOUCH_LX154A2422CPT23_H #define TREZORHAL_TOUCH_LX154A2422CPT23_H -#include +#include // Performs touch coordinates correction needed for a specific panel // Input parameteres x, y represent original touch coordinates. diff --git a/core/embed/trezorhal/stm32f4/touch/stmpe811.c b/core/embed/trezorhal/stm32f4/touch/stmpe811.c index f3590f07b4..8e882214b3 100644 --- a/core/embed/trezorhal/stm32f4/touch/stmpe811.c +++ b/core/embed/trezorhal/stm32f4/touch/stmpe811.c @@ -17,16 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include #ifdef KERNEL_MODE -#include - -#include "common.h" -#include "secbool.h" - #include "i2c_bus.h" #include "stmpe811.h" #include "touch.h" diff --git a/core/embed/trezorhal/stm32f4/unit_properties.c b/core/embed/trezorhal/stm32f4/unit_properties.c index 276e5994f0..78f319c447 100644 --- a/core/embed/trezorhal/stm32f4/unit_properties.c +++ b/core/embed/trezorhal/stm32f4/unit_properties.c @@ -17,12 +17,11 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD - -#include +#include +#include +#include #include "flash_otp.h" -#include "model.h" #include "unit_properties.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/usb/usb.c b/core/embed/trezorhal/stm32f4/usb/usb.c index 4875f34cc0..93dd689b18 100644 --- a/core/embed/trezorhal/stm32f4/usb/usb.c +++ b/core/embed/trezorhal/stm32f4/usb/usb.c @@ -19,12 +19,12 @@ #ifdef KERNEL_MODE -#include STM32_HAL_H +#include +#include -#include "usb.h" -#include "common.h" #include "random_delays.h" -#include "secbool.h" +#include "systick.h" +#include "usb.h" #include "usb_internal.h" #define USB_MAX_CONFIG_DESC_SIZE 256 diff --git a/core/embed/trezorhal/stm32f4/usb/usb_class_hid.c b/core/embed/trezorhal/stm32f4/usb/usb_class_hid.c index 67512153af..5cee8a829b 100644 --- a/core/embed/trezorhal/stm32f4/usb/usb_class_hid.c +++ b/core/embed/trezorhal/stm32f4/usb/usb_class_hid.c @@ -19,9 +19,9 @@ #ifdef KERNEL_MODE -#include "common.h" -#include "random_delays.h" +#include +#include "random_delays.h" #include "usb_hid.h" #include "usb_internal.h" diff --git a/core/embed/trezorhal/stm32f4/usb/usb_class_vcp.c b/core/embed/trezorhal/stm32f4/usb/usb_class_vcp.c index 4559fef33b..713e0c672a 100644 --- a/core/embed/trezorhal/stm32f4/usb/usb_class_vcp.c +++ b/core/embed/trezorhal/stm32f4/usb/usb_class_vcp.c @@ -19,7 +19,7 @@ #ifdef KERNEL_MODE -#include "common.h" +#include #include "usb_internal.h" #include "usb_vcp.h" diff --git a/core/embed/trezorhal/stm32f4/usb/usb_class_webusb.c b/core/embed/trezorhal/stm32f4/usb/usb_class_webusb.c index 8d9765829f..ce2d5e0730 100644 --- a/core/embed/trezorhal/stm32f4/usb/usb_class_webusb.c +++ b/core/embed/trezorhal/stm32f4/usb/usb_class_webusb.c @@ -19,9 +19,9 @@ #ifdef KERNEL_MODE -#include "common.h" -#include "random_delays.h" +#include +#include "random_delays.h" #include "usb_internal.h" #include "usb_webusb.h" diff --git a/core/embed/trezorhal/stm32f4/usb/usb_internal.h b/core/embed/trezorhal/stm32f4/usb/usb_internal.h index adf0ffb6db..2fa548a2eb 100644 --- a/core/embed/trezorhal/stm32f4/usb/usb_internal.h +++ b/core/embed/trezorhal/stm32f4/usb/usb_internal.h @@ -20,7 +20,8 @@ #ifndef TREZORHAL_USBD_INTERNAL_H #define TREZORHAL_USBD_INTERNAL_H -#include +#include + #include "usbd_core.h" #define USB_EP_DIR_MASK 0x80 diff --git a/core/embed/trezorhal/stm32f4/usb/usbd_conf.c b/core/embed/trezorhal/stm32f4/usb/usbd_conf.c index 2db2a64884..5de7e078b8 100644 --- a/core/embed/trezorhal/stm32f4/usb/usbd_conf.c +++ b/core/embed/trezorhal/stm32f4/usb/usbd_conf.c @@ -54,7 +54,9 @@ #ifdef KERNEL_MODE /* Includes ------------------------------------------------------------------*/ -#include STM32_HAL_H +#include +#include + #include "usbd_core.h" #include "usb.h" #include "irq.h" diff --git a/core/embed/trezorhal/stm32f4/usb/usbd_conf.h b/core/embed/trezorhal/stm32f4/usb/usbd_conf.h index 6ff2c71c82..960d23f0e2 100644 --- a/core/embed/trezorhal/stm32f4/usb/usbd_conf.h +++ b/core/embed/trezorhal/stm32f4/usb/usbd_conf.h @@ -55,10 +55,8 @@ #define __USBD_CONF_H /* Includes ------------------------------------------------------------------*/ -#include STM32_HAL_H -#include -#include -#include +#include +#include /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_driver.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_driver.c index ff59d1b60d..c2013f4b53 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_driver.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_driver.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.c index ebf0293800..74bd79fa7f 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.c @@ -17,12 +17,8 @@ * along with this program. If not, see . */ -#include -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "display_fb.h" #include "display_internal.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.h b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.h index 0afa1de2d2..0bb6ee3d1e 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_fb.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_DISPLAY_FB_H #define TREZORHAL_DISPLAY_FB_H -#include +#include #ifdef XFRAMEBUFFER 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 a45ce390d6..d3803fca97 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_internal.h @@ -1,9 +1,8 @@ #ifndef TREZORHAL_DISPLAY_INTERNAL_H #define TREZORHAL_DISPLAY_INTERNAL_H -#include STM32_HAL_H - -#include +#include +#include #ifdef XFRAMEBUFFER diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.c index f9f5ad1bd8..7b51894cc9 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "display_io.h" #include "irq.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.h b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.h index 634651fe2c..e50d8c910e 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.h @@ -20,8 +20,8 @@ #ifndef TREZORHAL_DISPLAY_IO_H #define TREZORHAL_DISPLAY_IO_H -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include void display_io_init_gpio(void); void display_io_init_fmc(void); diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_nofb.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_nofb.c index 83eba001c8..232566dd12 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_nofb.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_nofb.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include #include diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_panel.h b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_panel.h index 79163c4894..4a19d540c5 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_panel.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/display_panel.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_ST7789_PANEL_H #define TREZORHAL_ST7789_PANEL_H -#include -#include +#include // section "9.1.3 RDDID (04h): Read Display ID" // of ST7789V datasheet diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lhs200kb-if21.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lhs200kb-if21.c index 565a690b9c..c73609286a 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lhs200kb-if21.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lhs200kb-if21.c @@ -1,7 +1,7 @@ +#include -#include "lhs200kb-if21.h" #include "../display_io.h" -#include "model.h" +#include "lhs200kb-if21.h" void lhs200kb_if21_gamma(void) { ISSUE_CMD_BYTE(0xE0); diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2422.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2422.c index cf9bac5adb..9a97737e4f 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2422.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2422.c @@ -17,10 +17,11 @@ * along with this program. If not, see . */ +#include + #include "lx154a2422.h" #include "../display_io.h" -#include "model.h" void lx154a2422_gamma(void) { // positive voltage correction diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2482.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2482.c index 5626adde3f..916396f20f 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2482.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lx154a2482.c @@ -17,10 +17,10 @@ * along with this program. If not, see . */ -#include "lx154a2482.h" +#include #include "../display_io.h" -#include "model.h" +#include "lx154a2482.h" void lx154a2482_gamma(void) { // positive voltage correction diff --git a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/tf15411a.c b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/tf15411a.c index 2c45fb66e9..a6424f56fe 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/tf15411a.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/st-7789/panels/tf15411a.c @@ -17,9 +17,10 @@ * along with this program. If not, see . */ -#include "tf15411a.h" +#include + #include "../display_io.h" -#include "model.h" +#include "tf15411a.h" void tf15411a_init_seq(void) { // Inter Register Enable1 diff --git a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_driver.c b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_driver.c index 78647ad128..7a74431066 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_driver.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_driver.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_internal.h b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_internal.h index c19c63a653..17371892de 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_internal.h +++ b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_internal.h @@ -20,8 +20,8 @@ #ifndef TREZORHAL_DISPLAY_INTERNAL_H #define TREZORHAL_DISPLAY_INTERNAL_H -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "sdram.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_ltdc.c b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_ltdc.c index df3a752c3b..2d2fe7e62a 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_ltdc.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/display_ltdc.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "display_internal.h" #include "ili9341_spi.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/ili9341_spi.c b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/ili9341_spi.c index 309fb3f0d2..b42b50d125 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/ili9341_spi.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/stm32f429i-disc1/ili9341_spi.c @@ -1,9 +1,9 @@ -#include -#include TREZOR_BOARD +#include +#include + #include "ili9341_spi.h" -#include STM32_HAL_H /** * @brief ILI9341 chip IDs diff --git a/core/embed/trezorhal/stm32f4/xdisplay/ug-2828/display_driver.c b/core/embed/trezorhal/stm32f4/xdisplay/ug-2828/display_driver.c index 0aed268fd3..768a4f3254 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/ug-2828/display_driver.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/ug-2828/display_driver.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "mpu.h" #include "xdisplay.h" diff --git a/core/embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c b/core/embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c index c3caeec7df..08ea87c00b 100644 --- a/core/embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c +++ b/core/embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c @@ -17,13 +17,8 @@ * along with this program. If not, see . */ -#include -#include -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "mpu.h" #include "sizedefs.h" diff --git a/core/embed/trezorhal/stm32u5/bg_copy.c b/core/embed/trezorhal/stm32u5/bg_copy.c index 9ea4b4d95c..be25d3b92b 100644 --- a/core/embed/trezorhal/stm32u5/bg_copy.c +++ b/core/embed/trezorhal/stm32u5/bg_copy.c @@ -1,10 +1,10 @@ +#include + #include "bg_copy.h" #include "irq.h" #include "mpu.h" #include "systemview.h" -#include STM32_HAL_H - #ifdef KERNEL_MODE #define MAX_DATA_SIZE 0xFFF0 diff --git a/core/embed/trezorhal/stm32u5/consumption_mask.c b/core/embed/trezorhal/stm32u5/consumption_mask.c index 8027506367..ec511fd346 100644 --- a/core/embed/trezorhal/stm32u5/consumption_mask.c +++ b/core/embed/trezorhal/stm32u5/consumption_mask.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include + #include "rng.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/displays/dsi.c b/core/embed/trezorhal/stm32u5/displays/dsi.c index 775a451a71..5734a3f2e4 100644 --- a/core/embed/trezorhal/stm32u5/displays/dsi.c +++ b/core/embed/trezorhal/stm32u5/displays/dsi.c @@ -58,11 +58,11 @@ */ /* Includes ------------------------------------------------------------------*/ +#include +#include + #include "colors.h" #include "irq.h" -#include "stdint.h" -#include "string.h" -#include STM32_HAL_H /* Common Error codes */ #define BSP_ERROR_NONE 0 diff --git a/core/embed/trezorhal/stm32u5/displays/dsi.h b/core/embed/trezorhal/stm32u5/displays/dsi.h index acded2e860..c23daf557d 100644 --- a/core/embed/trezorhal/stm32u5/displays/dsi.h +++ b/core/embed/trezorhal/stm32u5/displays/dsi.h @@ -1,7 +1,8 @@ #ifndef DSI_H_ #define DSI_H_ -#include STM32_HAL_H +#include +#include #define DISPLAY_COLOR_MODE DMA2D_OUTPUT_ARGB8888 #define DISPLAY_FRAMEBUFFER_WIDTH 768 diff --git a/core/embed/trezorhal/stm32u5/entropy.c b/core/embed/trezorhal/stm32u5/entropy.c index 695371d304..398a1369cf 100644 --- a/core/embed/trezorhal/stm32u5/entropy.c +++ b/core/embed/trezorhal/stm32u5/entropy.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include +#include +#include #include "entropy.h" #include "flash_otp.h" -#include "model.h" #include "mpu.h" #include "rand.h" diff --git a/core/embed/trezorhal/stm32u5/flash.c b/core/embed/trezorhal/stm32u5/flash.c index f25c2ba6c8..6461fb8cb3 100644 --- a/core/embed/trezorhal/stm32u5/flash.c +++ b/core/embed/trezorhal/stm32u5/flash.c @@ -17,14 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include +#include -#include -#include - -#include "common.h" #include "flash.h" -#include "model.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/flash_otp.c b/core/embed/trezorhal/stm32u5/flash_otp.c index 9486ccf7a4..0f94ecd931 100644 --- a/core/embed/trezorhal/stm32u5/flash_otp.c +++ b/core/embed/trezorhal/stm32u5/flash_otp.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include -#include "flash_otp.h" -#include "common.h" #include "flash.h" +#include "flash_otp.h" #include "mpu.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/haptic/drv2625/drv2625.c b/core/embed/trezorhal/stm32u5/haptic/drv2625/drv2625.c index 7b1168c50b..48729e6941 100644 --- a/core/embed/trezorhal/stm32u5/haptic/drv2625/drv2625.c +++ b/core/embed/trezorhal/stm32u5/haptic/drv2625/drv2625.c @@ -17,18 +17,13 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include -#include -#include - -#include "common.h" #include "drv2625.h" #include "haptic.h" #include "i2c_bus.h" -#include STM32_HAL_H - #ifdef KERNEL_MODE // Maximum amplitude of the vibration effect diff --git a/core/embed/trezorhal/stm32u5/hash_processor.c b/core/embed/trezorhal/stm32u5/hash_processor.c index d6568887b5..89f34a51e4 100644 --- a/core/embed/trezorhal/stm32u5/hash_processor.c +++ b/core/embed/trezorhal/stm32u5/hash_processor.c @@ -1,7 +1,7 @@ +#include +#include + #include "hash_processor.h" -#include -#include -#include STM32_HAL_H #include "irq.h" #include "memzero.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32u5/i2c_bus.c b/core/embed/trezorhal/stm32u5/i2c_bus.c index 579863eae2..65d9834b41 100644 --- a/core/embed/trezorhal/stm32u5/i2c_bus.c +++ b/core/embed/trezorhal/stm32u5/i2c_bus.c @@ -17,16 +17,14 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include -#include - -#include "common.h" #include "i2c_bus.h" #include "irq.h" #include "mpu.h" #include "systemview.h" +#include "systick.h" #include "systimer.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/layout.c b/core/embed/trezorhal/stm32u5/layout.c index 89934a2201..b7527157e6 100644 --- a/core/embed/trezorhal/stm32u5/layout.c +++ b/core/embed/trezorhal/stm32u5/layout.c @@ -17,13 +17,11 @@ * along with this program. If not, see . */ -#ifndef TREZOR_EMULATOR -#include STM32_HAL_H -#endif +#include +#include #include "flash.h" #include "layout_helpers.h" -#include "model.h" // Convert sector number to address // diff --git a/core/embed/trezorhal/stm32u5/monoctr.c b/core/embed/trezorhal/stm32u5/monoctr.c index f44711b4ad..e538021aaf 100644 --- a/core/embed/trezorhal/stm32u5/monoctr.c +++ b/core/embed/trezorhal/stm32u5/monoctr.c @@ -17,9 +17,10 @@ * along with this program. If not, see . */ -#include "monoctr.h" +#include + #include "flash_area.h" -#include "model.h" +#include "monoctr.h" #include "mpu.h" #include "secret.h" diff --git a/core/embed/trezorhal/stm32u5/mpu.c b/core/embed/trezorhal/stm32u5/mpu.c index aac6e66a33..423ff03b2e 100644 --- a/core/embed/trezorhal/stm32u5/mpu.c +++ b/core/embed/trezorhal/stm32u5/mpu.c @@ -17,13 +17,12 @@ * along with this program. If not, see . */ -#include STM32_HAL_H -#include +#include +#include +#include -#include "common.h" #include "image.h" #include "irq.h" -#include "model.h" #include "mpu.h" #include "sizedefs.h" diff --git a/core/embed/trezorhal/stm32u5/option_bytes.c b/core/embed/trezorhal/stm32u5/option_bytes.c index d3a95eb50a..38fae4c05a 100644 --- a/core/embed/trezorhal/stm32u5/option_bytes.c +++ b/core/embed/trezorhal/stm32u5/option_bytes.c @@ -17,15 +17,14 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include +#include #ifdef KERNEL_MODE -#include "option_bytes.h" -#include "common.h" #include "flash.h" -#include "model.h" -#include TREZOR_BOARD +#include "option_bytes.h" #pragma GCC optimize( \ "no-stack-protector") // applies to all functions in this file diff --git a/core/embed/trezorhal/stm32u5/reset_flags.c b/core/embed/trezorhal/stm32u5/reset_flags.c index 675dc2dc54..7649b82d8a 100644 --- a/core/embed/trezorhal/stm32u5/reset_flags.c +++ b/core/embed/trezorhal/stm32u5/reset_flags.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include #include "reset_flags.h" diff --git a/core/embed/trezorhal/stm32u5/sdcard.c b/core/embed/trezorhal/stm32u5/sdcard.c index 4d83000ae1..d022441d86 100644 --- a/core/embed/trezorhal/stm32u5/sdcard.c +++ b/core/embed/trezorhal/stm32u5/sdcard.c @@ -43,10 +43,8 @@ * THE SOFTWARE. */ -#include STM32_HAL_H -#include TREZOR_BOARD - -#include +#include +#include #include "irq.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32u5/secret.c b/core/embed/trezorhal/stm32u5/secret.c index fba10c91bb..8019e4beff 100644 --- a/core/embed/trezorhal/stm32u5/secret.c +++ b/core/embed/trezorhal/stm32u5/secret.c @@ -1,16 +1,14 @@ -#include STM32_HAL_H +#include +#include +#include -#include "secret.h" -#include -#include #include "bootutils.h" -#include "common.h" #include "flash.h" #include "flash_utils.h" #include "memzero.h" -#include "model.h" #include "mpu.h" #include "rng.h" +#include "secret.h" #include "secure_aes.h" #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/secure_aes.c b/core/embed/trezorhal/stm32u5/secure_aes.c index ee79062440..8b94516c3f 100644 --- a/core/embed/trezorhal/stm32u5/secure_aes.c +++ b/core/embed/trezorhal/stm32u5/secure_aes.c @@ -17,14 +17,14 @@ * along with this program. If not, see . */ -#include -#include -#include STM32_HAL_H +#include +#include +#include -#include #include -#include -#include "model.h" + +#include "mpu.h" +#include "secure_aes.h" #include "syscall.h" #include "trustzone.h" diff --git a/core/embed/trezorhal/stm32u5/startup_init.c b/core/embed/trezorhal/stm32u5/startup_init.c index c08df7316b..7b0d672a53 100644 --- a/core/embed/trezorhal/stm32u5/startup_init.c +++ b/core/embed/trezorhal/stm32u5/startup_init.c @@ -17,8 +17,8 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "rng.h" diff --git a/core/embed/trezorhal/stm32u5/tamper.c b/core/embed/trezorhal/stm32u5/tamper.c index 4f6cfb605d..ec02ef09f2 100644 --- a/core/embed/trezorhal/stm32u5/tamper.c +++ b/core/embed/trezorhal/stm32u5/tamper.c @@ -17,11 +17,12 @@ * along with this program. If not, see . */ -#include +#include +#include + #include #include #include -#include STM32_HAL_H #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/stm32u5/touch/sitronix.c b/core/embed/trezorhal/stm32u5/touch/sitronix.c index bc951bde82..03fdec7a8d 100644 --- a/core/embed/trezorhal/stm32u5/touch/sitronix.c +++ b/core/embed/trezorhal/stm32u5/touch/sitronix.c @@ -1,9 +1,8 @@ -#include STM32_HAL_H -#include TREZOR_BOARD +#include +#include #ifdef KERNEL_MODE -#include "common.h" #include "i2c_bus.h" #include "irq.h" @@ -1207,7 +1206,8 @@ static int32_t SITRONIX_Probe(uint32_t Instance) { * @} */ -#include +#include + #include "touch.h" // Touch driver diff --git a/core/embed/trezorhal/stm32u5/trustzone.c b/core/embed/trezorhal/stm32u5/trustzone.c index a72aa5a55a..ba766eb247 100644 --- a/core/embed/trezorhal/stm32u5/trustzone.c +++ b/core/embed/trezorhal/stm32u5/trustzone.c @@ -17,14 +17,12 @@ * along with this program. If not, see . */ -#include STM32_HAL_H +#include +#include +#include -#include - -#include "common.h" #include "image.h" #include "irq.h" -#include "model.h" #include "sizedefs.h" #include "trustzone.h" diff --git a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_driver.c b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_driver.c index ea011796b6..ad95f44c5a 100644 --- a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_driver.c +++ b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_driver.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include "display_internal.h" #include "mpu.h" diff --git a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_fb.c b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_fb.c index 0e21e33646..75195aa8fa 100644 --- a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_fb.c +++ b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_fb.c @@ -17,11 +17,8 @@ * along with this program. If not, see . */ -#include -#include - -#include TREZOR_BOARD -#include STM32_HAL_H +#include +#include #include #include "display_internal.h" diff --git a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_internal.h b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_internal.h index 7696b379f2..0a0c24ebe1 100644 --- a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_internal.h +++ b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_internal.h @@ -20,8 +20,7 @@ #ifndef TREZOR_HAL_DISPLAY_INTERNAL_H #define TREZOR_HAL_DISPLAY_INTERNAL_H -#include -#include +#include #include "sizedefs.h" #include "trustzone.h" diff --git a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_ltdc_dsi.c b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_ltdc_dsi.c index e296479813..49d3f79a3b 100644 --- a/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_ltdc_dsi.c +++ b/core/embed/trezorhal/stm32u5/xdisplay/stm32u5a9j-dk/display_ltdc_dsi.c @@ -58,13 +58,10 @@ */ /* Includes ------------------------------------------------------------------*/ +#include +#include + #include "colors.h" -#include "stdint.h" -#include "string.h" - -#include TREZOR_BOARD -#include STM32_HAL_H - #include "display_internal.h" #include "irq.h" diff --git a/core/embed/trezorhal/systask.h b/core/embed/trezorhal/systask.h index b802ec2f7c..b830fa4da8 100644 --- a/core/embed/trezorhal/systask.h +++ b/core/embed/trezorhal/systask.h @@ -20,9 +20,7 @@ #ifndef TREZORHAL_SYSTASK_H #define TREZORHAL_SYSTASK_H -#include -#include -#include +#include #include "mpu.h" diff --git a/core/embed/trezorhal/systick.h b/core/embed/trezorhal/systick.h index 71403c06f7..e78bec1a6c 100644 --- a/core/embed/trezorhal/systick.h +++ b/core/embed/trezorhal/systick.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_SYSTICK_H #define TREZORHAL_SYSTICK_H -#include -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/systimer.h b/core/embed/trezorhal/systimer.h index 058e585b20..65633065d5 100644 --- a/core/embed/trezorhal/systimer.h +++ b/core/embed/trezorhal/systimer.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_SYSTIMER_H #define TREZORHAL_SYSTIMER_H -#include -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/tamper.h b/core/embed/trezorhal/tamper.h index abfbe81266..17f52e4b48 100644 --- a/core/embed/trezorhal/tamper.h +++ b/core/embed/trezorhal/tamper.h @@ -20,7 +20,7 @@ #ifndef TREZOR_HAL_TAMPER_H #define TREZOR_HAL_TAMPER_H -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/time_estimate.h b/core/embed/trezorhal/time_estimate.h index 68baa3098d..b23396c6db 100644 --- a/core/embed/trezorhal/time_estimate.h +++ b/core/embed/trezorhal/time_estimate.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_TIME_ESTIMATE_H #define TREZORHAL_TIME_ESTIMATE_H -#include +#include uint32_t time_estimate_pbkdf2_ms(uint32_t iterations); diff --git a/core/embed/trezorhal/touch.h b/core/embed/trezorhal/touch.h index ff5738eecf..d95cfdb75a 100644 --- a/core/embed/trezorhal/touch.h +++ b/core/embed/trezorhal/touch.h @@ -1,9 +1,7 @@ #ifndef TREZOR_HAL_TOUCH_H #define TREZOR_HAL_TOUCH_H -#include -#include -#include "secbool.h" +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/trustzone.h b/core/embed/trezorhal/trustzone.h index 8e19a0beca..ce9c081832 100644 --- a/core/embed/trezorhal/trustzone.h +++ b/core/embed/trezorhal/trustzone.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_TRUSTZONE #define TREZORHAL_TRUSTZONE -#include -#include +#include #ifdef BOARDLOADER diff --git a/core/embed/trezorhal/unit_properties.h b/core/embed/trezorhal/unit_properties.h index 5011c6bbfb..21d80e0c3d 100644 --- a/core/embed/trezorhal/unit_properties.h +++ b/core/embed/trezorhal/unit_properties.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_UNIT_PROPERTIES_H #define TREZORHAL_UNIT_PROPERTIES_H -#include -#include +#include #ifdef KERNEL_MODE diff --git a/core/embed/trezorhal/unix/bootutils.c b/core/embed/trezorhal/unix/bootutils.c index 8f8a0f6877..69d2b11e46 100644 --- a/core/embed/trezorhal/unix/bootutils.c +++ b/core/embed/trezorhal/unix/bootutils.c @@ -17,13 +17,13 @@ * along with this program. If not, see . */ -#include -#include -#include +#include + +#include -#include #include "bootargs.h" #include "bootutils.h" +#include "systick.h" // Holds the 'command' for the next reboot. static boot_command_t g_boot_command; diff --git a/core/embed/trezorhal/unix/button.c b/core/embed/trezorhal/unix/button.c index 01a096ff26..6f1c447341 100644 --- a/core/embed/trezorhal/unix/button.c +++ b/core/embed/trezorhal/unix/button.c @@ -17,12 +17,12 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include #include #include "button.h" -#include "common.h" static char last_left = 0, last_right = 0; diff --git a/core/embed/trezorhal/unix/display-unix.c b/core/embed/trezorhal/unix/display-unix.c index 937ef7565c..7fd62fb3fb 100644 --- a/core/embed/trezorhal/unix/display-unix.c +++ b/core/embed/trezorhal/unix/display-unix.c @@ -18,23 +18,18 @@ */ #define _GNU_SOURCE -#include -#include +#include +#include + #include #include -#include -#include -#include -#include -#include -#include -#include "common.h" +#include +#include + #include "display.h" #include "profile.h" -#include TREZOR_BOARD - #define EMULATOR_BORDER 16 static SDL_Window *WINDOW; diff --git a/core/embed/trezorhal/unix/display_driver.c b/core/embed/trezorhal/unix/display_driver.c index e0d3dcaf5d..2ad3e56525 100644 --- a/core/embed/trezorhal/unix/display_driver.c +++ b/core/embed/trezorhal/unix/display_driver.c @@ -19,14 +19,14 @@ #define _GNU_SOURCE -#include TREZOR_BOARD +#include +#include #include #include #include -#include "common.h" #include "profile.h" #define EMULATOR_BORDER 16 diff --git a/core/embed/trezorhal/unix/entropy.c b/core/embed/trezorhal/unix/entropy.c index a7a091b689..c2bcb1cdf2 100644 --- a/core/embed/trezorhal/unix/entropy.c +++ b/core/embed/trezorhal/unix/entropy.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "entropy.h" diff --git a/core/embed/trezorhal/unix/flash.c b/core/embed/trezorhal/unix/flash.c index acd967aba3..b91fa00f53 100644 --- a/core/embed/trezorhal/unix/flash.c +++ b/core/embed/trezorhal/unix/flash.c @@ -17,6 +17,9 @@ * along with this program. If not, see . */ +#include +#include + #include #include #include @@ -24,11 +27,7 @@ #include #include -#include - -#include "common.h" #include "flash.h" -#include "model.h" #include "profile.h" #ifndef FLASH_FILE diff --git a/core/embed/trezorhal/unix/flash_otp.c b/core/embed/trezorhal/unix/flash_otp.c index 1369e09293..8e92639459 100644 --- a/core/embed/trezorhal/unix/flash_otp.c +++ b/core/embed/trezorhal/unix/flash_otp.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "../flash_otp.h" diff --git a/core/embed/trezorhal/unix/monoctr.c b/core/embed/trezorhal/unix/monoctr.c index a8a140db60..1feff33ba4 100644 --- a/core/embed/trezorhal/unix/monoctr.c +++ b/core/embed/trezorhal/unix/monoctr.c @@ -17,10 +17,11 @@ * along with this program. If not, see . */ -#include "monoctr.h" +#include +#include + #include "flash_otp.h" -#include "model.h" -#include "string.h" +#include "monoctr.h" static int get_otp_block(monoctr_type_t type) { switch (type) { diff --git a/core/embed/trezorhal/unix/optiga.c b/core/embed/trezorhal/unix/optiga.c index 8a5fe94c67..5396e7441c 100644 --- a/core/embed/trezorhal/unix/optiga.c +++ b/core/embed/trezorhal/unix/optiga.c @@ -17,10 +17,11 @@ * along with this program. If not, see . */ -#include "optiga.h" -#include +#include + #include "ecdsa.h" #include "nist256p1.h" +#include "optiga.h" #include "optiga_common.h" #include "rand.h" #include "storage.h" diff --git a/core/embed/trezorhal/unix/rng.c b/core/embed/trezorhal/unix/rng.c index a2d6750c4a..bc790ddf98 100644 --- a/core/embed/trezorhal/unix/rng.c +++ b/core/embed/trezorhal/unix/rng.c @@ -17,10 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include -#include "common.h" #include "rng.h" uint32_t rng_get(void) { diff --git a/core/embed/trezorhal/unix/sdcard.c b/core/embed/trezorhal/unix/sdcard.c index 5d3cd35291..a357f84102 100644 --- a/core/embed/trezorhal/unix/sdcard.c +++ b/core/embed/trezorhal/unix/sdcard.c @@ -17,15 +17,15 @@ * along with this program. If not, see . */ +#include + #include #include -#include #include #include #include #include -#include "common.h" #include "profile.h" #include "sdcard.h" diff --git a/core/embed/trezorhal/unix/system.c b/core/embed/trezorhal/unix/system.c index 73307b0f03..eab9d53b82 100644 --- a/core/embed/trezorhal/unix/system.c +++ b/core/embed/trezorhal/unix/system.c @@ -17,12 +17,11 @@ * along with this program. If not, see . */ -#include +#include + #include -#include #include "bootutils.h" -#include "common.h" #include "system.h" #include "systick.h" #include "systimer.h" diff --git a/core/embed/trezorhal/unix/systick.c b/core/embed/trezorhal/unix/systick.c index 7515884fd0..923ea435b6 100644 --- a/core/embed/trezorhal/unix/systick.c +++ b/core/embed/trezorhal/unix/systick.c @@ -17,10 +17,8 @@ * along with this program. If not, see . */ -#include -#include +#include -#include #include #include diff --git a/core/embed/trezorhal/unix/systimer.c b/core/embed/trezorhal/unix/systimer.c index 1088f96bbd..6f56cc0327 100644 --- a/core/embed/trezorhal/unix/systimer.c +++ b/core/embed/trezorhal/unix/systimer.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include #include "systimer.h" diff --git a/core/embed/trezorhal/unix/touch.c b/core/embed/trezorhal/unix/touch.c index 194ee6c45c..f9008540ca 100644 --- a/core/embed/trezorhal/unix/touch.c +++ b/core/embed/trezorhal/unix/touch.c @@ -17,13 +17,11 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD +#include +#include #include -#include -#include -#include "common.h" #include "touch.h" extern int sdl_display_res_x, sdl_display_res_y; diff --git a/core/embed/trezorhal/unix/unit_properties.c b/core/embed/trezorhal/unix/unit_properties.c index 76de8598cf..5fd1881f69 100644 --- a/core/embed/trezorhal/unix/unit_properties.c +++ b/core/embed/trezorhal/unix/unit_properties.c @@ -17,12 +17,10 @@ * along with this program. If not, see . */ -#include TREZOR_BOARD - -#include +#include +#include #include "flash_otp.h" -#include "model.h" #include "unit_properties.h" // Unit properties driver structure diff --git a/core/embed/trezorhal/unix/usb.c b/core/embed/trezorhal/unix/usb.c index e57f5120cb..eedf618202 100644 --- a/core/embed/trezorhal/unix/usb.c +++ b/core/embed/trezorhal/unix/usb.c @@ -17,17 +17,16 @@ * along with this program. If not, see . */ +#include + #include -#include #include #include -#include #include #include #include #include -#include "error_handling.h" #include "profile.h" #include "usb.h" diff --git a/core/embed/trezorhal/usb.h b/core/embed/trezorhal/usb.h index c68c9f4c12..d1967a2a01 100644 --- a/core/embed/trezorhal/usb.h +++ b/core/embed/trezorhal/usb.h @@ -20,8 +20,7 @@ #ifndef __TREZORHAL_USB_H__ #define __TREZORHAL_USB_H__ -#include -#include "secbool.h" +#include #include "usb_hid.h" #include "usb_vcp.h" diff --git a/core/embed/trezorhal/usb_hid.h b/core/embed/trezorhal/usb_hid.h index 54b99b05d8..6ab8f6440c 100644 --- a/core/embed/trezorhal/usb_hid.h +++ b/core/embed/trezorhal/usb_hid.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_USB_CLASS_HID_H #define TREZORHAL_USB_CLASS_HID_H -#include -#include "secbool.h" +#include /* usb_hid_info_t contains all information for setting up a HID interface. All * passed pointers need to live at least until the interface is disabled diff --git a/core/embed/trezorhal/usb_vcp.h b/core/embed/trezorhal/usb_vcp.h index 8759a11a5c..623d99f460 100644 --- a/core/embed/trezorhal/usb_vcp.h +++ b/core/embed/trezorhal/usb_vcp.h @@ -20,8 +20,7 @@ #ifndef TREZORHAL_USB_CLASS_VCP_H #define TREZORHAL_USB_CLASS_VCP_H -#include -#include "secbool.h" +#include /* usb_vcp_info_t contains all information for setting up a VCP interface. All * passed pointers need to live at least until the interface is disabled diff --git a/core/embed/trezorhal/usb_webusb.h b/core/embed/trezorhal/usb_webusb.h index 216c3d6b57..0cc873f0b9 100644 --- a/core/embed/trezorhal/usb_webusb.h +++ b/core/embed/trezorhal/usb_webusb.h @@ -20,7 +20,7 @@ #ifndef TREZORHAL_USB_CLASS_WEBUSB_H #define TREZORHAL_USB_CLASS_WEBUSB_H -#include "secbool.h" +#include /* usb_webusb_info_t contains all information for setting up a WebUSB interface. * All passed pointers need to live at least until the interface is disabled diff --git a/core/embed/trezorhal/xdisplay.h b/core/embed/trezorhal/xdisplay.h index 5b4041ee4f..dfd3cf75df 100644 --- a/core/embed/trezorhal/xdisplay.h +++ b/core/embed/trezorhal/xdisplay.h @@ -20,11 +20,9 @@ #ifndef TREZORHAL_XDISPLAY_H #define TREZORHAL_XDISPLAY_H -#include -#include -#include "gfx_bitblt.h" +#include -#include TREZOR_BOARD +#include "gfx_bitblt.h" // This is a universal API for controlling different types of display // controllers. diff --git a/core/embed/trezorhal/xdisplay_legacy.h b/core/embed/trezorhal/xdisplay_legacy.h index fddec1e7e4..39766895e5 100644 --- a/core/embed/trezorhal/xdisplay_legacy.h +++ b/core/embed/trezorhal/xdisplay_legacy.h @@ -20,8 +20,9 @@ #ifndef TREZORHAL_DISPLAY_LEGACY_H #define TREZORHAL_DISPLAY_LEGACY_H -#include -#include +#include + +#include "buffers.h" // These declarations will be removed after the final cleanup // of display drivers. They are here just to simplify integration diff --git a/core/embed/unix/main.c b/core/embed/unix/main.c index b079632097..8f935f438c 100644 --- a/core/embed/unix/main.c +++ b/core/embed/unix/main.c @@ -24,22 +24,18 @@ * THE SOFTWARE. */ +#include + #include #include #include #include #include -#include -#include -#include -#include -#include #include #include #include -#include "common.h" #include "display.h" #include "extmod/misc.h" #include "extmod/vfs_posix.h" diff --git a/core/embed/unix/main_main.c b/core/embed/unix/main_main.c index bdc9d561ab..7f8ee7d9b1 100644 --- a/core/embed/unix/main_main.c +++ b/core/embed/unix/main_main.c @@ -1,3 +1,5 @@ +#include + #include "py/mpthread.h" #include "py/runtime.h" #include "py/stackctrl.h" @@ -5,7 +7,6 @@ #include "zkp_context.h" #endif -#include "common.h" #include "entropy.h" MP_NOINLINE int main_(int argc, char **argv); diff --git a/core/embed/unix/profile.c b/core/embed/unix/profile.c index 6e2e0ac4c6..e661fae1e5 100644 --- a/core/embed/unix/profile.c +++ b/core/embed/unix/profile.c @@ -18,7 +18,9 @@ */ #define _GNU_SOURCE -#include + +#include + #include #include "profile.h"