mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
feat(core): add support for T3W1, on F4
[no changelog]
This commit is contained in:
parent
138fadbf7b
commit
915d4fca94
@ -62,6 +62,10 @@ else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3B1))
|
||||
MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_tr
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3W1))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
MODEL_FEATURE = model_tt
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),DISC1))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
|
82
core/embed/models/T3W1/boards/trezor_t3w1_d1.h
Normal file
82
core/embed/models/T3W1/boards/trezor_t3w1_d1.h
Normal file
@ -0,0 +1,82 @@
|
||||
#ifndef _TREZOR_T3W1_H
|
||||
#define _TREZOR_T3W1_H
|
||||
|
||||
#define HSE_8MHZ
|
||||
|
||||
#define USE_SD_CARD 1
|
||||
#define USE_I2C 1
|
||||
#define USE_TOUCH 1
|
||||
// #define USE_BUTTON 1
|
||||
#define USE_SBU 1
|
||||
#define USE_RGB_COLORS 1
|
||||
#define USE_BACKLIGHT 1
|
||||
#define USE_DISP_I8080_16BIT_DW 1
|
||||
// #define USE_BLE 1
|
||||
|
||||
#define DISPLAY_RESX 240
|
||||
#define DISPLAY_RESY 320
|
||||
#define DISPLAY_COLOR_MODE DMA2D_OUTPUT_RGB565
|
||||
#define DISPLAY_LEGACY_HEADER "displays/st7789v.h"
|
||||
#define DISPLAY_PANEL_LHS200KB_IF21 1
|
||||
|
||||
// #define DISPLAY_PANEL_INIT_SEQ lhs200kb_if21_init_seq
|
||||
// #define DISPLAY_PANEL_ROTATE lhs200kb_if21_rotate
|
||||
// #define TRANSFORM_TOUCH_COORDS lhs200kb_if21_transform_touch_coords
|
||||
|
||||
#define BACKLIGHT_PWM_FREQ 50000
|
||||
#define BACKLIGHT_PWM_TIM TIM1
|
||||
#define BACKLIGHT_PWM_TIM_CLK_EN __HAL_RCC_TIM1_CLK_ENABLE
|
||||
#define BACKLIGHT_PWM_TIM_AF GPIO_AF1_TIM1
|
||||
#define BACKLIGHT_PWM_TIM_OCMODE TIM_OCMODE_PWM2
|
||||
#define BACKLIGHT_PWM_TIM_CHANNEL TIM_CHANNEL_1
|
||||
#define BACKLIGHT_PWM_TIM_CCR CCR1
|
||||
#define BACKLIGHT_PWM_PIN GPIO_PIN_7
|
||||
#define BACKLIGHT_PWM_PORT GPIOA
|
||||
#define BACKLIGHT_PWM_PORT_CLK_EN __HAL_RCC_GPIOA_CLK_ENABLE
|
||||
|
||||
#define I2C_COUNT 1
|
||||
#define I2C_INSTANCE_0 I2C2
|
||||
#define I2C_INSTANCE_0_CLK_EN __HAL_RCC_I2C2_CLK_ENABLE
|
||||
#define I2C_INSTANCE_0_CLK_DIS __HAL_RCC_I2C2_CLK_DISABLE
|
||||
#define I2C_INSTANCE_0_PIN_AF GPIO_AF4_I2C2
|
||||
#define I2C_INSTANCE_0_SDA_PORT GPIOB
|
||||
#define I2C_INSTANCE_0_SDA_PIN GPIO_PIN_11
|
||||
#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_10
|
||||
#define I2C_INSTANCE_0_SCL_CLK_EN __HAL_RCC_GPIOB_CLK_ENABLE
|
||||
#define I2C_INSTANCE_0_RESET_REG &RCC->APB1RSTR
|
||||
#define I2C_INSTANCE_0_RESET_BIT RCC_APB1RSTR_I2C2RST
|
||||
#define I2C_INSTANCE_0_EV_IRQHandler I2C2_EV_IRQHandler
|
||||
#define I2C_INSTANCE_0_ER_IRQHandler I2C2_ER_IRQHandler
|
||||
#define I2C_INSTANCE_0_EV_IRQn I2C2_EV_IRQn
|
||||
#define I2C_INSTANCE_0_ER_IRQn I2C2_ER_IRQn
|
||||
#define I2C_INSTANCE_0_GUARD_TIME 0
|
||||
|
||||
#define TOUCH_PANEL_LHS200KB_IF21 1
|
||||
#define TOUCH_SENSITIVITY 0x06
|
||||
#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_8
|
||||
|
||||
#define SD_DETECT_PORT GPIOB
|
||||
#define SD_DETECT_PIN GPIO_PIN_0
|
||||
#define SD_ENABLE_PORT GPIOE
|
||||
#define SD_ENABLE_PIN GPIO_PIN_1
|
||||
|
||||
#define GPIO_1_PORT GPIOC
|
||||
#define GPIO_1_PIN GPIO_PIN_1
|
||||
#define GPIO_2_PORT GPIOC
|
||||
#define GPIO_2_PIN GPIO_PIN_6
|
||||
#define GPIO_3_PORT GPIOC
|
||||
#define GPIO_3_PIN GPIO_PIN_7
|
||||
|
||||
#define BTN_POWER_CLK_ENA __HAL_RCC_GPIOE_CLK_ENABLE
|
||||
#define BTN_POWER_PORT GPIOE
|
||||
#define BTN_POWER_PIN GPIO_PIN_0
|
||||
|
||||
#endif //_TREZOR_T3W1_H
|
BIN
core/embed/models/T3W1/bootloaders/bootloader_T3W1.bin
Executable file
BIN
core/embed/models/T3W1/bootloaders/bootloader_T3W1.bin
Executable file
Binary file not shown.
13
core/embed/models/T3W1/bootloaders/bootloader_hashes.h
Normal file
13
core/embed/models/T3W1/bootloaders/bootloader_hashes.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef BOOTLOADER_HASHES_H
|
||||
#define BOOTLOADER_HASHES_H
|
||||
|
||||
// Auto-generated file, do not edit.
|
||||
|
||||
// clang-format off
|
||||
// bootloader_T3W1.bin version 2.1.10.0
|
||||
#define BOOTLOADER_T3W1_00 {0xc9, 0x2b, 0x45, 0xf2, 0x8d, 0x97, 0x1d, 0xf2, 0x42, 0xf3, 0x2e, 0xd4, 0x14, 0xb9, 0x70, 0x8e, 0x15, 0x38, 0xeb, 0xc0, 0x32, 0x35, 0x6b, 0xb8, 0x29, 0x2c, 0xe9, 0x56, 0x54, 0xad, 0xc5, 0xb2}
|
||||
#define BOOTLOADER_T3W1_FF {0xd6, 0x8d, 0x69, 0xa7, 0xcf, 0x73, 0xe1, 0xf7, 0xdc, 0xa2, 0x65, 0x51, 0x1b, 0x4e, 0x67, 0x4c, 0x57, 0x76, 0x35, 0x31, 0x38, 0xc5, 0x40, 0x39, 0x9f, 0x3c, 0xf8, 0x97, 0x3b, 0xa0, 0xa7, 0x24}
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif
|
52
core/embed/models/T3W1/memory.ld
Normal file
52
core/embed/models/T3W1/memory.ld
Normal file
@ -0,0 +1,52 @@
|
||||
/* Auto-generated file, do not edit.*/
|
||||
|
||||
NORCOW_SECTOR_SIZE = 0x10000;
|
||||
FLASH_START = 0x8000000;
|
||||
BOARDLOADER_START = 0x8000000;
|
||||
BOARDLOADER_MAXSIZE = 0xc000;
|
||||
BOARDLOADER_SECTOR_START = 0x0;
|
||||
BOARDLOADER_SECTOR_END = 0x2;
|
||||
BOARDCAPS_START = 0x800bf00;
|
||||
BOARDCAPS_MAXSIZE = 0x100;
|
||||
UNUSED_1_START = 0x800c000;
|
||||
UNUSED_1_MAXSIZE = 0x4000;
|
||||
UNUSED_1_SECTOR_START = 0x3;
|
||||
UNUSED_1_SECTOR_END = 0x3;
|
||||
STORAGE_1_START = 0x8010000;
|
||||
STORAGE_1_MAXSIZE = 0x10000;
|
||||
STORAGE_1_SECTOR_START = 0x4;
|
||||
STORAGE_1_SECTOR_END = 0x4;
|
||||
BOOTLOADER_START = 0x8020000;
|
||||
BOOTLOADER_MAXSIZE = 0x20000;
|
||||
BOOTLOADER_SECTOR_START = 0x5;
|
||||
BOOTLOADER_SECTOR_END = 0x5;
|
||||
FIRMWARE_START = 0x8040000;
|
||||
FIRMWARE_MAXSIZE = 0x1a0000;
|
||||
FIRMWARE_P1_START = 0x8040000;
|
||||
FIRMWARE_P1_MAXSIZE = 0xc0000;
|
||||
FIRMWARE_P1_SECTOR_START = 0x6;
|
||||
FIRMWARE_P1_SECTOR_END = 0xb;
|
||||
KERNEL_START = 0x8040000;
|
||||
KERNEL_MAXSIZE = 0x80000;
|
||||
ASSETS_START = 0x8100000;
|
||||
ASSETS_MAXSIZE = 0xc000;
|
||||
ASSETS_SECTOR_START = 0xc;
|
||||
ASSETS_SECTOR_END = 0xe;
|
||||
UNUSED_2_START = 0x810c000;
|
||||
UNUSED_2_MAXSIZE = 0x4000;
|
||||
UNUSED_2_SECTOR_START = 0xf;
|
||||
UNUSED_2_SECTOR_END = 0xf;
|
||||
STORAGE_2_START = 0x8110000;
|
||||
STORAGE_2_MAXSIZE = 0x10000;
|
||||
STORAGE_2_SECTOR_START = 0x10;
|
||||
STORAGE_2_SECTOR_END = 0x10;
|
||||
FIRMWARE_P2_START = 0x8120000;
|
||||
FIRMWARE_P2_MAXSIZE = 0xe0000;
|
||||
FIRMWARE_P2_SECTOR_START = 0x11;
|
||||
FIRMWARE_P2_SECTOR_END = 0x17;
|
||||
KERNEL_STACK_SIZE = 0x2000;
|
||||
KERNEL_CCMRAM_SIZE = 0x4000;
|
||||
KERNEL_FRAMEBUFFER_SIZE = 0x0;
|
||||
KERNEL_SRAM_SIZE = 0x400;
|
||||
BOOTARGS_SIZE = 0x100;
|
||||
CODE_ALIGNMENT = 0x200;
|
99
core/embed/models/T3W1/model_T3W1.h
Normal file
99
core/embed/models/T3W1/model_T3W1.h
Normal file
@ -0,0 +1,99 @@
|
||||
#ifndef MODELS_MODEL_T3W1_H_
|
||||
#define MODELS_MODEL_T3W1_H_
|
||||
|
||||
// #include "bootloaders/bootloader_hashes.h"
|
||||
|
||||
#include "sizedefs.h"
|
||||
|
||||
#define MODEL_NAME "T3W1"
|
||||
#define MODEL_FULL_NAME "Trezor T3W1"
|
||||
#define MODEL_INTERNAL_NAME "T3W1"
|
||||
#define MODEL_INTERNAL_NAME_TOKEN T3W1
|
||||
#define MODEL_INTERNAL_NAME_QSTR MP_QSTR_T3W1
|
||||
#define MODEL_USB_MANUFACTURER "Trezor Company"
|
||||
#define MODEL_USB_PRODUCT MODEL_FULL_NAME
|
||||
|
||||
// todo replace dev keys with produciton ones
|
||||
#define MODEL_BOARDLOADER_KEYS \
|
||||
(const uint8_t *)"\xdb\x99\x5f\xe2\x51\x69\xd1\x41\xca\xb9\xbb\xba\x92\xba\xa0\x1f\x9f\x2e\x1e\xce\x7d\xf4\xcb\x2a\xc0\x51\x90\xf3\x7f\xcc\x1f\x9d", \
|
||||
(const uint8_t *)"\x21\x52\xf8\xd1\x9b\x79\x1d\x24\x45\x32\x42\xe1\x5f\x2e\xab\x6c\xb7\xcf\xfa\x7b\x6a\x5e\xd3\x00\x97\x96\x0e\x06\x98\x81\xdb\x12", \
|
||||
(const uint8_t *)"\x22\xfc\x29\x77\x92\xf0\xb6\xff\xc0\xbf\xcf\xdb\x7e\xdb\x0c\x0a\xa1\x4e\x02\x5a\x36\x5e\xc0\xe3\x42\xe8\x6e\x38\x29\xcb\x74\xb6",
|
||||
|
||||
#define MODEL_BOOTLOADER_KEYS \
|
||||
(const uint8_t *)"\xd7\x59\x79\x3b\xbc\x13\xa2\x81\x9a\x82\x7c\x76\xad\xb6\xfb\xa8\xa4\x9a\xee\x00\x7f\x49\xf2\xd0\x99\x2d\x99\xb8\x25\xad\x2c\x48", \
|
||||
(const uint8_t *)"\x63\x55\x69\x1c\x17\x8a\x8f\xf9\x10\x07\xa7\x47\x8a\xfb\x95\x5e\xf7\x35\x2c\x63\xe7\xb2\x57\x03\x98\x4c\xf7\x8b\x26\xe2\x1a\x56", \
|
||||
(const uint8_t *)"\xee\x93\xa4\xf6\x6f\x8d\x16\xb8\x19\xbb\x9b\xeb\x9f\xfc\xcd\xfc\xdc\x14\x12\xe8\x7f\xee\x6a\x32\x4c\x2a\x99\xa1\xe0\xe6\x71\x48",
|
||||
|
||||
#define IMAGE_CHUNK_SIZE (128 * 1024)
|
||||
#define IMAGE_HASH_BLAKE2S
|
||||
#define DISPLAY_JUMP_BEHAVIOR DISPLAY_RESET_CONTENT
|
||||
|
||||
// SHARED WITH MAKEFILE
|
||||
// common
|
||||
|
||||
#define NORCOW_SECTOR_SIZE (1 * 64 * 1024) // 64 kB
|
||||
#define FLASH_START 0x08000000
|
||||
|
||||
// FLASH layout
|
||||
#define BOARDLOADER_START 0x08000000
|
||||
#define BOARDLOADER_MAXSIZE (3 * 16 * 1024) // 48 kB
|
||||
#define BOARDLOADER_SECTOR_START 0
|
||||
#define BOARDLOADER_SECTOR_END 2
|
||||
|
||||
#define BOARDCAPS_START 0x0800BF00
|
||||
#define BOARDCAPS_MAXSIZE 0x100
|
||||
|
||||
#define UNUSED_1_START 0x0800C000
|
||||
#define UNUSED_1_MAXSIZE (1 * 16 * 1024) // 16 kB
|
||||
#define UNUSED_1_SECTOR_START 3
|
||||
#define UNUSED_1_SECTOR_END 3
|
||||
|
||||
#define STORAGE_1_START 0x08010000
|
||||
#define STORAGE_1_MAXSIZE (1 * 64 * 1024) // 64 kB
|
||||
#define STORAGE_1_SECTOR_START 4
|
||||
#define STORAGE_1_SECTOR_END 4
|
||||
|
||||
#define BOOTLOADER_START 0x08020000
|
||||
#define BOOTLOADER_MAXSIZE (1 * 128 * 1024) // 128 kB
|
||||
#define BOOTLOADER_SECTOR_START 5
|
||||
#define BOOTLOADER_SECTOR_END 5
|
||||
|
||||
#define FIRMWARE_START 0x08040000
|
||||
#define FIRMWARE_MAXSIZE (13 * 128 * 1024) // 1664 kB
|
||||
#define FIRMWARE_P1_START 0x08040000
|
||||
#define FIRMWARE_P1_MAXSIZE (6 * 128 * 1024)
|
||||
#define FIRMWARE_P1_SECTOR_START 6
|
||||
#define FIRMWARE_P1_SECTOR_END 11
|
||||
// part of firmware P1
|
||||
#define KERNEL_START 0x08040000
|
||||
#define KERNEL_MAXSIZE (4 * 128 * 1024)
|
||||
|
||||
#define ASSETS_START 0x08100000
|
||||
#define ASSETS_MAXSIZE (3 * 16 * 1024) // 48 kB
|
||||
#define ASSETS_SECTOR_START 12
|
||||
#define ASSETS_SECTOR_END 14
|
||||
|
||||
#define UNUSED_2_START 0x0810C000
|
||||
#define UNUSED_2_MAXSIZE (1 * 16 * 1024) // 16 kB
|
||||
#define UNUSED_2_SECTOR_START 15
|
||||
#define UNUSED_2_SECTOR_END 15
|
||||
|
||||
#define STORAGE_2_START 0x08110000
|
||||
#define STORAGE_2_MAXSIZE (1 * 64 * 1024) // 64 kB
|
||||
#define STORAGE_2_SECTOR_START 16
|
||||
#define STORAGE_2_SECTOR_END 16
|
||||
|
||||
#define FIRMWARE_P2_START 0x08120000
|
||||
#define FIRMWARE_P2_MAXSIZE (7 * 128 * 1024)
|
||||
#define FIRMWARE_P2_SECTOR_START 17
|
||||
#define FIRMWARE_P2_SECTOR_END 23
|
||||
|
||||
// RAM layout
|
||||
#define KERNEL_STACK_SIZE 8 * 1024
|
||||
#define KERNEL_CCMRAM_SIZE 16 * 1024
|
||||
#define KERNEL_FRAMEBUFFER_SIZE 0 * 1024
|
||||
#define KERNEL_SRAM_SIZE 1 * 1024
|
||||
|
||||
#define BOOTARGS_SIZE 0x100
|
||||
#define CODE_ALIGNMENT 0x200
|
||||
#endif
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"header_len": 1024,
|
||||
"text": "DEV ONLY, DO NOT USE!",
|
||||
"hw_model": "T3W1",
|
||||
"expiry": 0,
|
||||
"version": [0, 0],
|
||||
"sig_m": 2,
|
||||
"trust": {
|
||||
"allow_run_with_secret": true,
|
||||
"show_vendor_string": false,
|
||||
"require_user_click": false,
|
||||
"red_background": false,
|
||||
"delay": 0
|
||||
},
|
||||
"pubkeys": [
|
||||
"e28a8970753332bd72fef413e6b0b2ef1b4aadda7aa2c141f233712a6876b351",
|
||||
"d4eec1869fb1b8a4e817516ad5a931557cb56805c3eb16e8f3a803d647df7869",
|
||||
"772c8a442b7db06e166cfbc1ccbcbcde6f3eba76a4e98ef3ffc519502237d6ef"
|
||||
]
|
||||
}
|
BIN
core/embed/models/T3W1/vendorheader/vendor_dev_DO_NOT_SIGN.toif
Normal file
BIN
core/embed/models/T3W1/vendorheader/vendor_dev_DO_NOT_SIGN.toif
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
core/embed/models/T3W1/versions.h
Normal file
3
core/embed/models/T3W1/versions.h
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
#define BOOTLOADER_MONOTONIC_VERSION 1
|
||||
#define FIRMWARE_MONOTONIC_VERSION 1
|
@ -12,6 +12,8 @@
|
||||
#include "T3T1/model_T3T1.h"
|
||||
#elif defined TREZOR_MODEL_T3B1
|
||||
#include "T3B1/model_T3B1.h"
|
||||
#elif defined TREZOR_MODEL_T3W1
|
||||
#include "T3W1/model_T3W1.h"
|
||||
#elif defined TREZOR_MODEL_DISC1
|
||||
#include "D001/model_D001.h"
|
||||
#elif defined TREZOR_MODEL_DISC2
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include "T3T1/versions.h"
|
||||
#elif defined TREZOR_MODEL_T3B1
|
||||
#include "T3B1/versions.h"
|
||||
#elif defined TREZOR_MODEL_T3W1
|
||||
#include "T3W1/versions.h"
|
||||
#elif defined TREZOR_MODEL_DISC1
|
||||
#include "D001/versions.h"
|
||||
#elif defined TREZOR_MODEL_DISC2
|
||||
|
37
core/site_scons/models/T3W1/__init__.py
Normal file
37
core/site_scons/models/T3W1/__init__.py
Normal file
@ -0,0 +1,37 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from . import trezor_t3w1_d1
|
||||
|
||||
|
||||
def configure_board(
|
||||
revision: Optional[int | str],
|
||||
features_wanted: list[str],
|
||||
env: dict, # type: ignore
|
||||
defines: list[str | tuple[str, str]],
|
||||
sources: list[str],
|
||||
paths: list[str],
|
||||
):
|
||||
# Set default revision if None
|
||||
revision = revision or "d1"
|
||||
|
||||
# Mapping of revisions to their respective configurations
|
||||
revision_map = {
|
||||
"d1": trezor_t3w1_d1,
|
||||
}
|
||||
|
||||
module = revision_map.get(revision)
|
||||
|
||||
if module:
|
||||
return module.configure(env, features_wanted, defines, sources, paths)
|
||||
|
||||
raise Exception("Unknown model_r_version")
|
||||
|
||||
|
||||
def get_model_ui() -> str:
|
||||
return "tt"
|
||||
|
||||
|
||||
def get_model_ui_conf() -> list[str]:
|
||||
return []
|
109
core/site_scons/models/T3W1/trezor_t3w1_d1.py
Normal file
109
core/site_scons/models/T3W1/trezor_t3w1_d1.py
Normal file
@ -0,0 +1,109 @@
|
||||
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] = []
|
||||
board = "T3W1/boards/trezor_t3w1_d1.h"
|
||||
hw_model = get_hw_model_as_number("T3W1")
|
||||
hw_revision = 0
|
||||
features_available.append("disp_i8080_16bit_dw")
|
||||
|
||||
defines += ["DISPLAY_RGB565"]
|
||||
features_available.append("display_rgb565")
|
||||
|
||||
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}"]
|
||||
|
||||
sources += ["embed/trezorhal/xdisplay_legacy.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/xdisplay/st-7789/display_nofb.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/xdisplay/st-7789/display_driver.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/xdisplay/st-7789/display_io.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/xdisplay/st-7789/display_panel.c"]
|
||||
sources += [
|
||||
"embed/trezorhal/stm32f4/xdisplay/st-7789/panels/lhs200kb-if21.c",
|
||||
]
|
||||
|
||||
sources += ["embed/trezorhal/stm32f4/backlight_pwm.c"]
|
||||
|
||||
features_available.append("backlight")
|
||||
|
||||
if "input" in features_wanted:
|
||||
sources += ["embed/trezorhal/stm32f4/i2c_bus.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/touch/ft6x36.c"]
|
||||
sources += ["embed/trezorhal/stm32f4/touch/panels/lhs200kb-if21.c"]
|
||||
features_available.append("touch")
|
||||
# sources += ["embed/trezorhal/stm32f4/button.c"]
|
||||
# features_available.append("button")
|
||||
|
||||
if "sd_card" in features_wanted:
|
||||
sources += ["embed/trezorhal/stm32f4/sdcard.c"]
|
||||
sources += ["embed/extmod/modtrezorio/ff.c"]
|
||||
sources += ["embed/extmod/modtrezorio/ffunicode.c"]
|
||||
features_available.append("sd_card")
|
||||
|
||||
# if "ble" in features_wanted:
|
||||
# sources += ["embed/trezorhal/stm32f4/ble/ble_hal.c"]
|
||||
# sources += ["embed/trezorhal/stm32f4/ble/dfu.c"]
|
||||
# sources += ["embed/trezorhal/stm32f4/ble/fwu.c"]
|
||||
# sources += ["embed/trezorhal/stm32f4/ble/ble.c"]
|
||||
# sources += ["embed/trezorhal/stm32f4/ble/messages.c"]
|
||||
# sources += [
|
||||
# "vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c"
|
||||
# ]
|
||||
# features_available.append("ble")
|
||||
|
||||
if "ble" in features_wanted or "sd_card" in features_wanted:
|
||||
sources += [
|
||||
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c"
|
||||
]
|
||||
|
||||
if "sbu" in features_wanted:
|
||||
sources += ["embed/trezorhal/stm32f4/sbu.c"]
|
||||
features_available.append("sbu")
|
||||
|
||||
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")
|
||||
|
||||
if "dma2d" in features_wanted:
|
||||
defines += ["USE_DMA2D"]
|
||||
sources += ["embed/trezorhal/stm32u5/dma2d_bitblt.c"]
|
||||
sources += [
|
||||
"vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c",
|
||||
]
|
||||
features_available.append("dma2d")
|
||||
|
||||
return features_available
|
@ -29,10 +29,11 @@ if t.TYPE_CHECKING:
|
||||
|
||||
class Model(Enum):
|
||||
T1B1 = b"T1B1"
|
||||
T2T1 = b"T2T1"
|
||||
T3T1 = b"T3T1"
|
||||
T3B1 = b"T3B1"
|
||||
T2B1 = b"T2B1"
|
||||
T2T1 = b"T2T1"
|
||||
T3B1 = b"T3B1"
|
||||
T3T1 = b"T3T1"
|
||||
T3W1 = b"T3W1"
|
||||
D001 = b"D001"
|
||||
D002 = b"D002"
|
||||
|
||||
@ -298,6 +299,12 @@ T3B1_HASH_PARAMS = FirmwareHashParameters(
|
||||
padding_byte=None,
|
||||
)
|
||||
|
||||
T3W1_HASH_PARAMS = FirmwareHashParameters(
|
||||
hash_function=hashlib.blake2s,
|
||||
chunk_size=1024 * 128,
|
||||
padding_byte=None,
|
||||
)
|
||||
|
||||
D002_HASH_PARAMS = FirmwareHashParameters(
|
||||
hash_function=hashlib.sha256,
|
||||
chunk_size=1024 * 256,
|
||||
@ -310,6 +317,7 @@ MODEL_MAP = {
|
||||
Model.T2B1: T2B1,
|
||||
Model.T3T1: T3T1,
|
||||
Model.T3B1: T3B1,
|
||||
Model.T3W1: TREZOR_CORE_DEV,
|
||||
Model.D001: TREZOR_CORE_DEV,
|
||||
Model.D002: TREZOR_CORE_DEV,
|
||||
}
|
||||
@ -320,6 +328,7 @@ MODEL_MAP_DEV = {
|
||||
Model.T2B1: TREZOR_CORE_DEV,
|
||||
Model.T3T1: TREZOR_CORE_DEV,
|
||||
Model.T3B1: TREZOR_CORE_DEV,
|
||||
Model.T3W1: TREZOR_CORE_DEV,
|
||||
Model.D001: TREZOR_CORE_DEV,
|
||||
Model.D002: TREZOR_CORE_DEV,
|
||||
}
|
||||
@ -330,6 +339,7 @@ MODEL_HASH_PARAMS_MAP = {
|
||||
Model.T2B1: T2T1_HASH_PARAMS,
|
||||
Model.T3T1: T3T1_HASH_PARAMS,
|
||||
Model.T3B1: T3B1_HASH_PARAMS,
|
||||
Model.T3W1: T3W1_HASH_PARAMS,
|
||||
Model.D001: T2T1_HASH_PARAMS,
|
||||
Model.D002: D002_HASH_PARAMS,
|
||||
}
|
||||
@ -341,6 +351,7 @@ MODEL_CODE_ALIGNMENT_MAP = {
|
||||
Model.T2B1: 0x200,
|
||||
Model.T3T1: 0x200,
|
||||
Model.T3B1: 0x200,
|
||||
Model.T3W1: 0x200,
|
||||
Model.D001: 0x200,
|
||||
Model.D002: 0x400,
|
||||
}
|
||||
|
@ -81,6 +81,15 @@ T3B1 = TrezorModel(
|
||||
default_mapping=mapping.DEFAULT_MAPPING,
|
||||
)
|
||||
|
||||
T3W1 = TrezorModel(
|
||||
name="T3W1",
|
||||
internal_name="T3W1",
|
||||
minimum_version=(2, 1, 0),
|
||||
vendors=VENDORS,
|
||||
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
|
||||
default_mapping=mapping.DEFAULT_MAPPING,
|
||||
)
|
||||
|
||||
DISC1 = TrezorModel(
|
||||
name="DISC1",
|
||||
internal_name="D001",
|
||||
@ -109,7 +118,7 @@ TREZOR_SAFE5 = T3T1
|
||||
TREZOR_DISC1 = DISC1
|
||||
TREZOR_DISC2 = DISC2
|
||||
|
||||
TREZORS = frozenset({T1B1, T2T1, T2B1, T3T1, T3B1, DISC1, DISC2})
|
||||
TREZORS = frozenset({T1B1, T2T1, T2B1, T3T1, T3B1, T3W1, DISC1, DISC2})
|
||||
|
||||
|
||||
def by_name(name: Optional[str]) -> Optional[TrezorModel]:
|
||||
|
Loading…
Reference in New Issue
Block a user