diff --git a/core/embed/models/T2B1/boards/trezor_r_v3.h b/core/embed/models/T2B1/boards/trezor_r_v3.h deleted file mode 100644 index 47d350338f..0000000000 --- a/core/embed/models/T2B1/boards/trezor_r_v3.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _TREZOR_R_V3_H -#define _TREZOR_R_V3_H - -#define HSE_8MHZ - -#define DISPLAY_RESX 128 -#define DISPLAY_RESY 128 -#define DISPLAY_LEGACY_HEADER "displays/ug-2828tswig01.h" - -#define BTN_LEFT_PIN GPIO_PIN_0 -#define BTN_LEFT_PORT GPIOA -#define BTN_LEFT_CLK_ENA __HAL_RCC_GPIOA_CLK_ENABLE -#define BTN_RIGHT_PIN GPIO_PIN_15 -#define BTN_RIGHT_PORT GPIOE -#define BTN_RIGHT_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE - -#endif //_TREZOR_R_V3_H diff --git a/core/embed/models/T2B1/boards/trezor_r_v4.h b/core/embed/models/T2B1/boards/trezor_r_v4.h deleted file mode 100644 index f2646ef2ac..0000000000 --- a/core/embed/models/T2B1/boards/trezor_r_v4.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _TREZOR_R_V4_H -#define _TREZOR_R_V4_H - -#define HSE_8MHZ - -#define DISPLAY_RESX 128 -#define DISPLAY_RESY 64 -#define DISPLAY_LEGACY_HEADER "displays/vg-2864ksweg01.h" - -#define BTN_LEFT_PIN GPIO_PIN_5 -#define BTN_LEFT_PORT GPIOC -#define BTN_LEFT_CLK_ENA __HAL_RCC_GPIOC_CLK_ENABLE -#define BTN_RIGHT_PIN GPIO_PIN_10 -#define BTN_RIGHT_PORT GPIOB -#define BTN_RIGHT_CLK_ENA __HAL_RCC_GPIOB_CLK_ENABLE - -#define OLED_DC_PORT GPIOD -#define OLED_DC_PIN GPIO_PIN_0 // PD0 | Data/Command -#define OLED_DC_CLK_ENA __HAL_RCC_GPIOD_CLK_ENABLE -#define OLED_CS_PORT GPIOE -#define OLED_CS_PIN GPIO_PIN_4 // PE4 | SPI Select -#define OLED_CS_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE -#define OLED_RST_PORT GPIOD -#define OLED_RST_PIN GPIO_PIN_1 // PD1 | Reset display -#define OLED_RST_CLK_ENA __HAL_RCC_GPIOD_CLK_ENABLE - -#define OLED_SPI SPI4 -#define OLED_SPI_AF GPIO_AF5_SPI4 -#define OLED_SPI_CLK_ENA __HAL_RCC_SPI4_CLK_ENABLE -#define OLED_SPI_SCK_PORT GPIOE -#define OLED_SPI_SCK_PIN GPIO_PIN_2 // PE2 | SPI SCK -#define OLED_SPI_SCK_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE -#define OLED_SPI_MOSI_PORT GPIOE -#define OLED_SPI_MOSI_PIN GPIO_PIN_6 // PE6 | SPI MOSI -#define OLED_SPI_MOSI_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE - -#endif //_TREZOR_R_V4_H diff --git a/core/embed/models/T2B1/boards/trezor_r_v6.h b/core/embed/models/T2B1/boards/trezor_r_v6.h deleted file mode 100644 index 00e561659e..0000000000 --- a/core/embed/models/T2B1/boards/trezor_r_v6.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _TREZOR_R_V6_H -#define _TREZOR_R_V6_H - -#define HSE_8MHZ - -#define DISPLAY_RESX 128 -#define DISPLAY_RESY 64 -#define DISPLAY_LEGACY_HEADER "displays/vg-2864ksweg01.h" - -#define BTN_LEFT_PIN GPIO_PIN_10 -#define BTN_LEFT_PORT GPIOC -#define BTN_LEFT_CLK_ENA __HAL_RCC_GPIOC_CLK_ENABLE -#define BTN_RIGHT_PIN GPIO_PIN_10 -#define BTN_RIGHT_PORT GPIOB -#define BTN_RIGHT_CLK_ENA __HAL_RCC_GPIOB_CLK_ENABLE - -#define OLED_DC_PORT GPIOD -#define OLED_DC_PIN GPIO_PIN_0 // PD0 | Data/Command -#define OLED_DC_CLK_ENA __HAL_RCC_GPIOD_CLK_ENABLE -#define OLED_CS_PORT GPIOE -#define OLED_CS_PIN GPIO_PIN_4 // PE4 | SPI Select -#define OLED_CS_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE -#define OLED_RST_PORT GPIOD -#define OLED_RST_PIN GPIO_PIN_1 // PD1 | Reset display -#define OLED_RST_CLK_ENA __HAL_RCC_GPIOD_CLK_ENABLE - -#define OLED_SPI SPI4 -#define OLED_SPI_AF GPIO_AF5_SPI4 -#define OLED_SPI_CLK_ENA __HAL_RCC_SPI4_CLK_ENABLE -#define OLED_SPI_SCK_PORT GPIOE -#define OLED_SPI_SCK_PIN GPIO_PIN_2 // PE2 | SPI SCK -#define OLED_SPI_SCK_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE -#define OLED_SPI_MOSI_PORT GPIOE -#define OLED_SPI_MOSI_PIN GPIO_PIN_6 // PE6 | SPI MOSI -#define OLED_SPI_MOSI_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE - -#endif //_TREZOR_R_V6_H diff --git a/core/embed/models/T3T1/boards/trezor_t3t1_v4.h b/core/embed/models/T3T1/boards/trezor_t3t1_v4.h deleted file mode 100644 index 20247814ed..0000000000 --- a/core/embed/models/T3T1/boards/trezor_t3t1_v4.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef _TREZOR_T3T1_H -#define _TREZOR_T3T1_H - -#define VDD_3V3 1 -#define HSE_16MHZ 1 - -#define DISPLAY_RESX 240 -#define DISPLAY_RESY 240 -#define DISPLAY_LEGACY_HEADER "displays/st7789v.h" -#define DISPLAY_COLOR_MODE DMA2D_OUTPUT_RGB565 -#define DISPLAY_PANEL_LX154A2482 1 -#define DISPLAY_I8080_8BIT_DW 1 - -#define DISPLAY_IDENTIFY 1 -#define DISPLAY_TE_PORT GPIOD -#define DISPLAY_TE_PIN GPIO_PIN_12 -#define DISPLAY_TE_INTERRUPT_HANDLER EXTI12_IRQHandler -#define DISPLAY_TE_INTERRUPT_NUM EXTI12_IRQn -#define DISPLAY_TE_INTERRUPT_GPIOSEL EXTI_GPIOD -#define DISPLAY_TE_INTERRUPT_EXTI_LINE EXTI_LINE_12 - -#define BACKLIGHT_PWM_FREQ 12500 -#define BACKLIGHT_PWM_TIM TIM8 -#define BACKLIGHT_PWM_TIM_CLK_EN __HAL_RCC_TIM8_CLK_ENABLE -#define BACKLIGHT_PWM_TIM_AF GPIO_AF3_TIM8 -#define BACKLIGHT_PWM_TIM_OCMODE TIM_OCMODE_PWM1 -#define BACKLIGHT_PWM_TIM_CHANNEL TIM_CHANNEL_1 -#define BACKLIGHT_PWM_TIM_CCR CCR1 -#define BACKLIGHT_PWM_PIN GPIO_PIN_6 -#define BACKLIGHT_PWM_PORT GPIOC -#define BACKLIGHT_PWM_PORT_CLK_EN __HAL_RCC_GPIOC_CLK_ENABLE - -#define I2C_COUNT 2 -#define I2C_INSTANCE_0 I2C1 -#define I2C_INSTANCE_0_CLK_EN __HAL_RCC_I2C1_CLK_ENABLE -#define I2C_INSTANCE_0_CLK_DIS __HAL_RCC_I2C1_CLK_DISABLE -#define I2C_INSTANCE_0_PIN_AF GPIO_AF4_I2C1 -#define I2C_INSTANCE_0_SDA_PORT GPIOB -#define I2C_INSTANCE_0_SDA_PIN GPIO_PIN_7 -#define I2C_INSTANCE_0_SDA_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE -#define I2C_INSTANCE_0_SCL_PORT GPIOB -#define I2C_INSTANCE_0_SCL_PIN GPIO_PIN_6 -#define I2C_INSTANCE_0_SCL_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE -#define I2C_INSTANCE_0_RESET_REG &RCC->APB1RSTR1 -#define I2C_INSTANCE_0_RESET_BIT RCC_APB1RSTR1_I2C1RST -#define I2C_INSTANCE_0_EV_IRQHandler I2C1_EV_IRQHandler -#define I2C_INSTANCE_0_ER_IRQHandler I2C1_ER_IRQHandler -#define I2C_INSTANCE_0_EV_IRQn I2C1_EV_IRQn -#define I2C_INSTANCE_0_ER_IRQn I2C1_ER_IRQn -#define I2C_INSTANCE_0_GUARD_TIME 0 - -#define I2C_INSTANCE_1 I2C2 -#define I2C_INSTANCE_1_CLK_EN __HAL_RCC_I2C2_CLK_ENABLE -#define I2C_INSTANCE_1_CLK_DIS __HAL_RCC_I2C2_CLK_DISABLE -#define I2C_INSTANCE_1_PIN_AF GPIO_AF4_I2C2 -#define I2C_INSTANCE_1_SDA_PORT GPIOB -#define I2C_INSTANCE_1_SDA_PIN GPIO_PIN_14 -#define I2C_INSTANCE_1_SDA_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE -#define I2C_INSTANCE_1_SCL_PORT GPIOB -#define I2C_INSTANCE_1_SCL_PIN GPIO_PIN_13 -#define I2C_INSTANCE_1_SCL_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE -#define I2C_INSTANCE_1_RESET_REG &RCC->APB1RSTR1 -#define I2C_INSTANCE_1_RESET_BIT RCC_APB1RSTR1_I2C2RST -#define I2C_INSTANCE_1_EV_IRQHandler I2C2_EV_IRQHandler -#define I2C_INSTANCE_1_ER_IRQHandler I2C2_ER_IRQHandler -#define I2C_INSTANCE_1_EV_IRQn I2C2_EV_IRQn -#define I2C_INSTANCE_1_ER_IRQn I2C2_ER_IRQn -#define I2C_INSTANCE_1_GUARD_TIME 50 // Optiga requires 50us guard time - -#define TOUCH_SENSITIVITY 0x40 -#define TOUCH_I2C_INSTANCE 0 -#define TOUCH_RST_PORT GPIOC -#define TOUCH_RST_PIN GPIO_PIN_5 -#define TOUCH_INT_PORT GPIOC -#define TOUCH_INT_PIN GPIO_PIN_4 -#define TOUCH_ON_PORT GPIOB -#define TOUCH_ON_PIN GPIO_PIN_0 - -#define DRV2625_I2C_INSTANCE 1 -#define HAPTIC_ACTUATOR "actuators/vg1040003d.h" - -#define OPTIGA_I2C_INSTANCE 1 -#define OPTIGA_RST_PORT GPIOB -#define OPTIGA_RST_PIN GPIO_PIN_1 -#define OPTIGA_RST_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE - -#define SD_DETECT_PORT GPIOC -#define SD_DETECT_PIN GPIO_PIN_13 -#define SD_ENABLE_PORT GPIOC -#define SD_ENABLE_PIN GPIO_PIN_0 - -#endif //_TREZOR_T_H diff --git a/core/site_scons/models/T2B1/__init__.py b/core/site_scons/models/T2B1/__init__.py index 8bd8422005..af6c37d102 100644 --- a/core/site_scons/models/T2B1/__init__.py +++ b/core/site_scons/models/T2B1/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Optional -from . import emulator, trezor_r_v3, trezor_r_v4, trezor_r_v6, trezor_r_v10 +from . import emulator, trezor_r_v10 def configure_board( @@ -19,9 +19,6 @@ def configure_board( # Mapping of revisions to their respective configurations revision_map = { "emulator": emulator, - 3: trezor_r_v3, - 4: trezor_r_v4, - 6: trezor_r_v6, 10: trezor_r_v10, } diff --git a/core/site_scons/models/T2B1/trezor_r_v3.py b/core/site_scons/models/T2B1/trezor_r_v3.py deleted file mode 100644 index 5520232ee0..0000000000 --- a/core/site_scons/models/T2B1/trezor_r_v3.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from .. import get_hw_model_as_number -from ..stm32f4_common import stm32f4_common_files - - -def configure( - env: dict, - features_wanted: list[str], - defines: list[str | tuple[str, str]], - sources: list[str], - paths: list[str], -) -> list[str]: - features_available: list[str] = [] - hw_model = get_hw_model_as_number("T2B1") - hw_revision = 3 - board = "T2B1/boards/trezor_r_v3.h" - display = "ug-2828tswig01.c" - - if "new_rendering" in features_wanted: - defines += ["XFRAMEBUFFER"] - features_available.append("xframebuffer") - features_available.append("display_mono") - - mcu = "STM32F427xx" - - stm32f4_common_files(env, defines, sources, paths) - - env.get("ENV")[ - "CPU_ASFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" - env.get("ENV")[ - "CPU_CCFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 " - env.get("ENV")["RUST_TARGET"] = "thumbv7em-none-eabihf" - - defines += [mcu] - defines += [f'TREZOR_BOARD=\\"{board}\\"'] - defines += [f"HW_MODEL={hw_model}"] - defines += [f"HW_REVISION={hw_revision}"] - - if "new_rendering" in features_wanted: - sources += ["embed/trezorhal/xdisplay_legacy.c"] - sources += ["embed/trezorhal/stm32f4/xdisplay/ug-2828/display_driver.c"] - else: - sources += [f"embed/trezorhal/stm32f4/displays/{display}"] - - if "input" in features_wanted: - sources += ["embed/trezorhal/stm32f4/button.c"] - features_available.append("button") - defines += ["USE_BUTTON=1"] - - if "rgb_led" in features_wanted: - sources += ["embed/trezorhal/stm32f4/rgb_led.c"] - features_available.append("rgb_led") - - if "sbu" in features_wanted: - sources += ["embed/trezorhal/stm32f4/sbu.c"] - features_available.append("sbu") - defines += ["USE_SBU=1"] - - if "usb" in features_wanted: - sources += [ - "embed/trezorhal/stm32f4/usb/usb_class_hid.c", - "embed/trezorhal/stm32f4/usb/usb_class_vcp.c", - "embed/trezorhal/stm32f4/usb/usb_class_webusb.c", - "embed/trezorhal/stm32f4/usb/usb.c", - "embed/trezorhal/stm32f4/usb/usbd_conf.c", - "embed/trezorhal/stm32f4/usb/usbd_core.c", - "embed/trezorhal/stm32f4/usb/usbd_ctlreq.c", - "embed/trezorhal/stm32f4/usb/usbd_ioreq.c", - "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c", - ] - features_available.append("usb") - - defines += ["USE_PVD=1"] - - return features_available diff --git a/core/site_scons/models/T2B1/trezor_r_v4.py b/core/site_scons/models/T2B1/trezor_r_v4.py deleted file mode 100644 index d785c03ad5..0000000000 --- a/core/site_scons/models/T2B1/trezor_r_v4.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -from .. import get_hw_model_as_number -from ..stm32f4_common import stm32f4_common_files - - -def configure( - env: dict, - features_wanted: list[str], - defines: list[str | tuple[str, str]], - sources: list[str], - paths: list[str], -) -> list[str]: - features_available: list[str] = [] - hw_model = get_hw_model_as_number("T2B1") - hw_revision = 4 - board = "T2B1/boards/trezor_r_v4.h" - display = "vg-2864ksweg01.c" - - if "new_rendering" in features_wanted: - defines += ["XFRAMEBUFFER"] - features_available.append("xframebuffer") - features_available.append("display_mono") - - mcu = "STM32F427xx" - - stm32f4_common_files(env, defines, sources, paths) - - env.get("ENV")[ - "CPU_ASFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" - env.get("ENV")[ - "CPU_CCFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 " - env.get("ENV")["RUST_TARGET"] = "thumbv7em-none-eabihf" - - defines += [mcu] - defines += [f'TREZOR_BOARD=\\"{board}\\"'] - defines += [f"HW_MODEL={hw_model}"] - defines += [f"HW_REVISION={hw_revision}"] - - if "new_rendering" in features_wanted: - sources += ["embed/trezorhal/xdisplay_legacy.c"] - sources += ["embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c"] - else: - sources += [f"embed/trezorhal/stm32f4/displays/{display}"] - - if "input" in features_wanted: - sources += ["embed/trezorhal/stm32f4/button.c"] - features_available.append("button") - defines += ["USE_BUTTON=1"] - - if "sbu" in features_wanted: - sources += ["embed/trezorhal/stm32f4/sbu.c"] - features_available.append("sbu") - defines += ["USE_SBU=1"] - - if "usb" in features_wanted: - sources += [ - "embed/trezorhal/stm32f4/usb/usb_class_hid.c", - "embed/trezorhal/stm32f4/usb/usb_class_vcp.c", - "embed/trezorhal/stm32f4/usb/usb_class_webusb.c", - "embed/trezorhal/stm32f4/usb/usb.c", - "embed/trezorhal/stm32f4/usb/usbd_conf.c", - "embed/trezorhal/stm32f4/usb/usbd_core.c", - "embed/trezorhal/stm32f4/usb/usbd_ctlreq.c", - "embed/trezorhal/stm32f4/usb/usbd_ioreq.c", - "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c", - ] - features_available.append("usb") - - defines += ["USE_PVD=1"] - - return features_available diff --git a/core/site_scons/models/T2B1/trezor_r_v6.py b/core/site_scons/models/T2B1/trezor_r_v6.py deleted file mode 100644 index c7e1476bf1..0000000000 --- a/core/site_scons/models/T2B1/trezor_r_v6.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -from .. import get_hw_model_as_number -from ..stm32f4_common import stm32f4_common_files - - -def configure( - env: dict, - features_wanted: list[str], - defines: list[str | tuple[str, str]], - sources: list[str], - paths: list[str], -) -> list[str]: - features_available: list[str] = [] - hw_model = get_hw_model_as_number("T2B1") - hw_revision = 6 - board = "T2B1/boards/trezor_r_v6.h" - display = "vg-2864ksweg01.c" - - if "new_rendering" in features_wanted: - defines += ["XFRAMEBUFFER"] - features_available.append("xframebuffer") - features_available.append("display_mono") - - mcu = "STM32F427xx" - - stm32f4_common_files(env, defines, sources, paths) - - env.get("ENV")[ - "CPU_ASFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" - env.get("ENV")[ - "CPU_CCFLAGS" - ] = "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 " - env.get("ENV")["RUST_TARGET"] = "thumbv7em-none-eabihf" - - defines += [mcu] - defines += [f'TREZOR_BOARD=\\"{board}\\"'] - defines += [f"HW_MODEL={hw_model}"] - defines += [f"HW_REVISION={hw_revision}"] - - if "new_rendering" in features_wanted: - sources += ["embed/trezorhal/xdisplay_legacy.c"] - sources += ["embed/trezorhal/stm32f4/xdisplay/vg-2864/display_driver.c"] - else: - sources += [f"embed/trezorhal/stm32f4/displays/{display}"] - - if "input" in features_wanted: - sources += ["embed/trezorhal/stm32f4/button.c"] - features_available.append("button") - defines += ["USE_BUTTON=1"] - - if "sbu" in features_wanted: - sources += ["embed/trezorhal/stm32f4/sbu.c"] - features_available.append("sbu") - defines += ["USE_SBU=1"] - - if "usb" in features_wanted: - sources += [ - "embed/trezorhal/stm32f4/usb/usb_class_hid.c", - "embed/trezorhal/stm32f4/usb/usb_class_vcp.c", - "embed/trezorhal/stm32f4/usb/usb_class_webusb.c", - "embed/trezorhal/stm32f4/usb/usb.c", - "embed/trezorhal/stm32f4/usb/usbd_conf.c", - "embed/trezorhal/stm32f4/usb/usbd_core.c", - "embed/trezorhal/stm32f4/usb/usbd_ctlreq.c", - "embed/trezorhal/stm32f4/usb/usbd_ioreq.c", - "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c", - ] - features_available.append("usb") - - defines += ["USE_PVD=1"] - - return features_available diff --git a/core/site_scons/models/T3T1/__init__.py b/core/site_scons/models/T3T1/__init__.py index 1c14a0be3e..278a3a0d61 100644 --- a/core/site_scons/models/T3T1/__init__.py +++ b/core/site_scons/models/T3T1/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import Optional -from . import emulator, trezor_t3t1_revE, trezor_t3t1_v4 +from . import emulator, trezor_t3t1_revE def configure_board( @@ -19,7 +19,6 @@ def configure_board( # Mapping of revisions to their respective configurations revision_map = { "emulator": emulator, - 4: trezor_t3t1_v4, "E": trezor_t3t1_revE, } diff --git a/core/site_scons/models/T3T1/trezor_t3t1_v4.py b/core/site_scons/models/T3T1/trezor_t3t1_v4.py deleted file mode 100644 index 952d4c1fc3..0000000000 --- a/core/site_scons/models/T3T1/trezor_t3t1_v4.py +++ /dev/null @@ -1,145 +0,0 @@ -from __future__ import annotations - -from .. import get_hw_model_as_number -from ..stm32u5_common import stm32u5_common_files - - -def configure( - env: dict, - features_wanted: list[str], - defines: list[str | tuple[str, str]], - sources: list[str], - paths: list[str], -) -> list[str]: - features_available: list[str] = [] - board = "T3T1/boards/trezor_t3t1_v4.h" - display = "st7789v.c" - hw_model = get_hw_model_as_number("T3T1") - hw_revision = 0 - features_available.append("disp_i8080_8bit_dw") - features_available.append("framebuffer") - defines += ["FRAMEBUFFER"] - - if "new_rendering" in features_wanted: - features_available.append("xframebuffer") - features_available.append("display_rgb565") - defines += ["DISPLAY_RGB565"] - defines += ["XFRAMEBUFFER"] - defines += ["USE_RGB_COLORS=1"] - - mcu = "STM32U585xx" - linker_script = """embed/trezorhal/stm32u5/linker/u58/{target}.ld""" - - stm32u5_common_files(env, defines, sources, paths) - - env.get("ENV")[ - "CPU_ASFLAGS" - ] = "-mthumb -mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-sp-d16 " - env.get("ENV")[ - "CPU_CCFLAGS" - ] = "-mthumb -mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -mtune=cortex-m33 -mcmse " - env.get("ENV")["RUST_TARGET"] = "thumbv8m.main-none-eabihf" - - defines += [mcu] - defines += [f'TREZOR_BOARD=\\"{board}\\"'] - defines += [f"HW_MODEL={hw_model}"] - defines += [f"HW_REVISION={hw_revision}"] - - if "new_rendering" in features_wanted: - sources += ["embed/trezorhal/xdisplay_legacy.c"] - sources += ["embed/trezorhal/stm32u5/xdisplay/st-7789/display_fb.c"] - sources += ["embed/trezorhal/stm32u5/xdisplay/st-7789/display_driver.c"] - sources += ["embed/trezorhal/stm32u5/xdisplay/st-7789/display_io.c"] - sources += ["embed/trezorhal/stm32u5/xdisplay/st-7789/display_panel.c"] - sources += [ - "embed/trezorhal/stm32u5/xdisplay/st-7789/panels/lx154a2482.c", - ] - else: - sources += [f"embed/trezorhal/stm32u5/displays/{display}"] - sources += [ - "embed/trezorhal/stm32u5/displays/panels/lx154a2482.c", - ] - - sources += ["embed/trezorhal/stm32u5/backlight_pwm.c"] - features_available.append("backlight") - defines += ["USE_BACKLIGHT=1"] - - env_constraints = env.get("CONSTRAINTS") - if not (env_constraints and "limited_util_s" in env_constraints): - sources += ["embed/trezorhal/stm32u5/bg_copy.c"] - - if "input" in features_wanted: - sources += ["embed/trezorhal/stm32u5/i2c_bus.c"] - sources += ["embed/trezorhal/stm32u5/touch/ft6x36.c"] - sources += ["embed/trezorhal/stm32u5/touch/panels/lx154a2422cpt23.c"] - features_available.append("touch") - defines += ["USE_TOUCH=1"] - defines += ["USE_I2C=1"] - - if "haptic" in features_wanted: - sources += [ - "embed/trezorhal/stm32u5/haptic/drv2625/drv2625.c", - ] - sources += [ - "vendor/stm32u5xx_hal_driver/Src/stm32u5xx_hal_tim.c", - "vendor/stm32u5xx_hal_driver/Src/stm32u5xx_hal_tim_ex.c", - ] - features_available.append("haptic") - defines += ["USE_HAPTIC=1"] - - if "sd_card" in features_wanted: - sources += ["embed/trezorhal/stm32u5/sdcard.c"] - sources += ["embed/extmod/modtrezorio/ff.c"] - sources += ["embed/extmod/modtrezorio/ffunicode.c"] - sources += ["vendor/stm32u5xx_hal_driver/Src/stm32u5xx_hal_sd.c"] - sources += ["vendor/stm32u5xx_hal_driver/Src/stm32u5xx_ll_sdmmc.c"] - features_available.append("sd_card") - defines += ["USE_SD_CARD=1"] - - if "sbu" in features_wanted: - sources += ["embed/trezorhal/stm32u5/sbu.c"] - features_available.append("sbu") - defines += ["USE_SBU=1"] - - if "usb" in features_wanted: - sources += [ - "embed/trezorhal/stm32u5/usb/usb_class_hid.c", - "embed/trezorhal/stm32u5/usb/usb_class_vcp.c", - "embed/trezorhal/stm32u5/usb/usb_class_webusb.c", - "embed/trezorhal/stm32u5/usb/usb.c", - "embed/trezorhal/stm32u5/usb/usbd_conf.c", - "embed/trezorhal/stm32u5/usb/usbd_core.c", - "embed/trezorhal/stm32u5/usb/usbd_ctlreq.c", - "embed/trezorhal/stm32u5/usb/usbd_ioreq.c", - "vendor/stm32u5xx_hal_driver/Src/stm32u5xx_ll_usb.c", - ] - features_available.append("usb") - - if "dma2d" in features_wanted: - defines += ["USE_DMA2D"] - if "new_rendering" in features_wanted: - sources += ["embed/trezorhal/stm32u5/dma2d_bitblt.c"] - else: - sources += ["embed/trezorhal/stm32u5/dma2d.c"] - features_available.append("dma2d") - - if "optiga" in features_wanted: - sources += ["embed/trezorhal/stm32u5/optiga_hal.c"] - sources += ["embed/trezorhal/optiga/optiga.c"] - sources += ["embed/trezorhal/optiga/optiga_commands.c"] - sources += ["embed/trezorhal/optiga/optiga_transport.c"] - sources += ["vendor/trezor-crypto/hash_to_curve.c"] - features_available.append("optiga") - defines += ["USE_OPTIGA=1"] - - defines += ["USE_HASH_PROCESSOR=1"] - defines += ["USE_PVD=1"] - - env.get("ENV")["TREZOR_BOARD"] = board - env.get("ENV")["MCU_TYPE"] = mcu - env.get("ENV")["LINKER_SCRIPT"] = linker_script - - defs = env.get("CPPDEFINES_IMPLICIT") - defs += ["__ARM_FEATURE_CMSE=3"] - - return features_available