mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
chore(core): remove residual support for T1B1 in core
[no changelog]
This commit is contained in:
parent
ab96ce7954
commit
e13d4a45a6
@ -141,7 +141,7 @@ MAKO_FILTERS = {
|
|||||||
|
|
||||||
|
|
||||||
def render_file(
|
def render_file(
|
||||||
src: Path, dst: Path, coins: CoinsInfo, support_info: SupportInfo
|
src: Path, dst: Path, coins: CoinsInfo, support_info: SupportInfo, models: list[str]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Renders `src` template into `dst`.
|
"""Renders `src` template into `dst`.
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ def render_file(
|
|||||||
ROOT=ROOT,
|
ROOT=ROOT,
|
||||||
**coins,
|
**coins,
|
||||||
**MAKO_FILTERS,
|
**MAKO_FILTERS,
|
||||||
ALL_MODELS=coin_info.get_models(),
|
ALL_MODELS=models,
|
||||||
)
|
)
|
||||||
dst.write_text(str(result))
|
dst.write_text(str(result))
|
||||||
src_stat = src.stat()
|
src_stat = src.stat()
|
||||||
@ -846,9 +846,14 @@ def dump(
|
|||||||
@click.option("-o", "--outfile", type=click.Path(dir_okay=False, writable=True, path_type=Path), help="Alternate output file")
|
@click.option("-o", "--outfile", type=click.Path(dir_okay=False, writable=True, path_type=Path), help="Alternate output file")
|
||||||
@click.option("-v", "--verbose", is_flag=True, help="Print rendered file names")
|
@click.option("-v", "--verbose", is_flag=True, help="Print rendered file names")
|
||||||
@click.option("-b", "--bitcoin-only", is_flag=True, help="Accept only Bitcoin coins")
|
@click.option("-b", "--bitcoin-only", is_flag=True, help="Accept only Bitcoin coins")
|
||||||
|
@click.option("-M", "--model-exclude", metavar="NAME", multiple=True, type=device_choice, help="Skip generation for this models (-M T1B1)")
|
||||||
# fmt: on
|
# fmt: on
|
||||||
def render(
|
def render(
|
||||||
paths: tuple[Path, ...], outfile: Path, verbose: bool, bitcoin_only: bool
|
paths: tuple[Path, ...],
|
||||||
|
outfile: Path,
|
||||||
|
verbose: bool,
|
||||||
|
bitcoin_only: bool,
|
||||||
|
model_exclude: tuple[str, ...],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Generate source code from Mako templates.
|
"""Generate source code from Mako templates.
|
||||||
|
|
||||||
@ -885,9 +890,12 @@ def render(
|
|||||||
support_info[key] = Munch(value)
|
support_info[key] = Munch(value)
|
||||||
|
|
||||||
def do_render(src: Path, dst: Path) -> None:
|
def do_render(src: Path, dst: Path) -> None:
|
||||||
|
models = coin_info.get_models()
|
||||||
|
models = [m for m in models if m not in model_exclude]
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
click.echo(f"Rendering {src} => {dst.name}")
|
click.echo(f"Rendering {src} => {dst.name}")
|
||||||
render_file(src, dst, defs, support_info)
|
render_file(src, dst, defs, support_info, models)
|
||||||
|
|
||||||
# single in-out case
|
# single in-out case
|
||||||
if outfile:
|
if outfile:
|
||||||
|
@ -46,10 +46,7 @@ OPENOCD_INTERFACE ?= stlink
|
|||||||
# OpenOCD transport default. Alternative: jtag
|
# OpenOCD transport default. Alternative: jtag
|
||||||
OPENOCD_TRANSPORT ?= hla_swd
|
OPENOCD_TRANSPORT ?= hla_swd
|
||||||
|
|
||||||
ifeq ($(TREZOR_MODEL), 1)
|
ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T))
|
||||||
MCU = STM32F2
|
|
||||||
OPENOCD_TARGET = target/stm32f2x.cfg
|
|
||||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T))
|
|
||||||
MCU = STM32F4
|
MCU = STM32F4
|
||||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||||
MODEL_FEATURE = model_tt
|
MODEL_FEATURE = model_tt
|
||||||
@ -403,9 +400,6 @@ flash_firmware_jlink: $(FIRMWARE_BUILD_DIR)/firmware.bin ## flash firmware using
|
|||||||
truncate -s $(FIRMWARE_P2_MAXSIZE) $<.p2.bin
|
truncate -s $(FIRMWARE_P2_MAXSIZE) $<.p2.bin
|
||||||
JLinkExe -nogui 1 -commanderscript embed/firmware/firmware_flash.jlink
|
JLinkExe -nogui 1 -commanderscript embed/firmware/firmware_flash.jlink
|
||||||
|
|
||||||
flash_firmware_t1_jlink: $(FIRMWARE_BUILD_DIR)/firmware.bin ## flash T1 core port via JLink
|
|
||||||
JLinkExe -nogui 1 -commanderscript embed/firmware/firmware_flash_t1.jlink
|
|
||||||
|
|
||||||
## openocd debug commands:
|
## openocd debug commands:
|
||||||
|
|
||||||
openocd: ## start openocd which connects to the device
|
openocd: ## start openocd which connects to the device
|
||||||
|
@ -32,23 +32,8 @@ g_header:
|
|||||||
.byte FIRMWARE_MONOTONIC_VERSION // monotonic version of the binary
|
.byte FIRMWARE_MONOTONIC_VERSION // monotonic version of the binary
|
||||||
. = . + 2 // reserved
|
. = . + 2 // reserved
|
||||||
. = . + 512 // hash1 ... hash16
|
. = . + 512 // hash1 ... hash16
|
||||||
|
|
||||||
#if !defined TREZOR_MODEL_1
|
|
||||||
// trezor-core header style
|
|
||||||
. = . + 415 // reserved
|
. = . + 415 // reserved
|
||||||
.byte 0 // sigmask
|
.byte 0 // sigmask
|
||||||
. = . + 64 // sig
|
. = . + 64 // sig
|
||||||
#else
|
|
||||||
// model 1 compatibility header
|
|
||||||
. = . + 64 // sig1
|
|
||||||
. = . + 64 // sig2
|
|
||||||
. = . + 64 // sig3
|
|
||||||
.byte 0 // sigindex1
|
|
||||||
.byte 0 // sigindex2
|
|
||||||
.byte 0 // sigindex3
|
|
||||||
. = . + 220 // reserved
|
|
||||||
. = . + 65 // reserved
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_header_end:
|
g_header_end:
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
@ -1,22 +0,0 @@
|
|||||||
#ifndef BOARDS_T1B1_UNIX_H
|
|
||||||
#define BOARDS_T1B1_UNIX_H
|
|
||||||
|
|
||||||
#define USE_BUTTON 1
|
|
||||||
|
|
||||||
#define MAX_DISPLAY_RESX 128
|
|
||||||
#define MAX_DISPLAY_RESY 64
|
|
||||||
#define DISPLAY_RESX 128
|
|
||||||
#define DISPLAY_RESY 64
|
|
||||||
#define TREZOR_FONT_BPP 1
|
|
||||||
|
|
||||||
#define WINDOW_WIDTH 200
|
|
||||||
#define WINDOW_HEIGHT 340
|
|
||||||
#define TOUCH_OFFSET_X 36
|
|
||||||
#define TOUCH_OFFSET_Y 92
|
|
||||||
|
|
||||||
#define ORIENTATION_NS 1
|
|
||||||
|
|
||||||
#define BACKGROUND_FILE "T1B1/background_1.h"
|
|
||||||
#define BACKGROUND_NAME background_1_jpg
|
|
||||||
|
|
||||||
#endif // BOARDS_T1B1_UNIX_H
|
|
@ -1,38 +0,0 @@
|
|||||||
#ifndef _TREZOR_1_H
|
|
||||||
#define _TREZOR_1_H
|
|
||||||
|
|
||||||
#define HSE_8MHZ
|
|
||||||
|
|
||||||
#define USE_BUTTON 1
|
|
||||||
|
|
||||||
#define DISPLAY_RESX 128
|
|
||||||
#define DISPLAY_RESY 64
|
|
||||||
|
|
||||||
#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_2
|
|
||||||
#define BTN_RIGHT_PORT GPIOC
|
|
||||||
#define BTN_RIGHT_CLK_ENA __HAL_RCC_GPIOC_CLK_ENABLE
|
|
||||||
|
|
||||||
#define OLED_DC_PORT GPIOB
|
|
||||||
#define OLED_DC_PIN GPIO_PIN_0 // PB0 | Data/Command
|
|
||||||
#define OLED_DC_CLK_ENA __HAL_RCC_GPIOB_CLK_ENABLE
|
|
||||||
#define OLED_CS_PORT GPIOA
|
|
||||||
#define OLED_CS_PIN GPIO_PIN_4 // PA4 | SPI Select
|
|
||||||
#define OLED_CS_CLK_ENA __HAL_RCC_GPIOA_CLK_ENABLE
|
|
||||||
#define OLED_RST_PORT GPIOB
|
|
||||||
#define OLED_RST_PIN GPIO_PIN_1 // PB1 | Reset display
|
|
||||||
#define OLED_RST_CLK_ENA __HAL_RCC_GPIOB_CLK_ENABLE
|
|
||||||
|
|
||||||
#define OLED_SPI SPI1
|
|
||||||
#define OLED_SPI_AF GPIO_AF5_SPI1
|
|
||||||
#define OLED_SPI_CLK_ENA __HAL_RCC_SPI1_CLK_ENABLE
|
|
||||||
#define OLED_SPI_SCK_PORT GPIOA
|
|
||||||
#define OLED_SPI_SCK_PIN GPIO_PIN_5 // PA5 | SPI SCK
|
|
||||||
#define OLED_SPI_SCK_CLK_ENA __HAL_RCC_GPIOA_CLK_ENABLE
|
|
||||||
#define OLED_SPI_MOSI_PORT GPIOA
|
|
||||||
#define OLED_SPI_MOSI_PIN GPIO_PIN_7 // PA7 | SPI MOSI
|
|
||||||
#define OLED_SPI_MOSI_CLK_ENA __HAL_RCC_GPIOA_CLK_ENABLE
|
|
||||||
|
|
||||||
#endif //_TREZOR_1_H
|
|
@ -1,16 +0,0 @@
|
|||||||
/* Auto-generated file, do not edit.*/
|
|
||||||
|
|
||||||
FLASH_START = 0x8000000;
|
|
||||||
BOOTLOADER_START = 0x8000000;
|
|
||||||
FIRMWARE_START = 0x8010000;
|
|
||||||
NORCOW_SECTOR_SIZE = 0x10000;
|
|
||||||
BOOTLOADER_IMAGE_MAXSIZE = 0x8000;
|
|
||||||
FIRMWARE_IMAGE_MAXSIZE = 0xf0000;
|
|
||||||
BOOTLOADER_SECTOR_START = 0x0;
|
|
||||||
BOOTLOADER_SECTOR_END = 0x2;
|
|
||||||
FIRMWARE_SECTOR_START = 0x4;
|
|
||||||
FIRMWARE_SECTOR_END = 0xb;
|
|
||||||
STORAGE_1_SECTOR_START = 0x2;
|
|
||||||
STORAGE_1_SECTOR_END = 0x2;
|
|
||||||
STORAGE_2_SECTOR_START = 0x3;
|
|
||||||
STORAGE_2_SECTOR_END = 0x3;
|
|
@ -1,34 +0,0 @@
|
|||||||
#ifndef MODELS_MODEL_T1B1_H_
|
|
||||||
#define MODELS_MODEL_T1B1_H_
|
|
||||||
|
|
||||||
#define MODEL_NAME "1"
|
|
||||||
#define MODEL_FULL_NAME "Trezor Model One"
|
|
||||||
#define MODEL_INTERNAL_NAME "T1B1"
|
|
||||||
#define MODEL_INTERNAL_NAME_TOKEN T1B1
|
|
||||||
#define MODEL_INTERNAL_NAME_QSTR MP_QSTR_T1B1
|
|
||||||
#define MODEL_USB_MANUFACTURER "SatoshiLabs"
|
|
||||||
#define MODEL_USB_PRODUCT "TREZOR"
|
|
||||||
|
|
||||||
#define IMAGE_CHUNK_SIZE (64 * 1024)
|
|
||||||
#define IMAGE_HASH_SHA256
|
|
||||||
#define CODE_ALIGNMENT 0x200
|
|
||||||
#define DISPLAY_JUMP_BEHAVIOR DISPLAY_RETAIN_CONTENT
|
|
||||||
|
|
||||||
// SHARED WITH MAKEFILE
|
|
||||||
#define FLASH_START 0x08000000
|
|
||||||
#define BOOTLOADER_START 0x08000000
|
|
||||||
#define FIRMWARE_START 0x08010000
|
|
||||||
#define NORCOW_SECTOR_SIZE (1 * 64 * 1024) // 64 kB
|
|
||||||
#define BOOTLOADER_IMAGE_MAXSIZE (1 * 32 * 1024) // 32 kB
|
|
||||||
#define FIRMWARE_IMAGE_MAXSIZE (15 * 64 * 1024) // 960 kB
|
|
||||||
|
|
||||||
#define BOOTLOADER_SECTOR_START 0
|
|
||||||
#define BOOTLOADER_SECTOR_END 2
|
|
||||||
#define FIRMWARE_SECTOR_START 4
|
|
||||||
#define FIRMWARE_SECTOR_END 11
|
|
||||||
#define STORAGE_1_SECTOR_START 2
|
|
||||||
#define STORAGE_1_SECTOR_END 2
|
|
||||||
#define STORAGE_2_SECTOR_START 3
|
|
||||||
#define STORAGE_2_SECTOR_END 3
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,41 +0,0 @@
|
|||||||
#include "flash.h"
|
|
||||||
#include "model.h"
|
|
||||||
|
|
||||||
const flash_area_t STORAGE_AREAS[STORAGE_AREAS_COUNT] = {
|
|
||||||
{
|
|
||||||
.num_subareas = 1,
|
|
||||||
.subarea[0] =
|
|
||||||
{
|
|
||||||
.first_sector = STORAGE_1_SECTOR_START,
|
|
||||||
.num_sectors =
|
|
||||||
STORAGE_1_SECTOR_END - STORAGE_1_SECTOR_START + 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.num_subareas = 1,
|
|
||||||
.subarea[0] =
|
|
||||||
{
|
|
||||||
.first_sector = STORAGE_2_SECTOR_START,
|
|
||||||
.num_sectors =
|
|
||||||
STORAGE_2_SECTOR_END - STORAGE_2_SECTOR_START + 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const flash_area_t BOOTLOADER_AREA = {
|
|
||||||
.num_subareas = 1,
|
|
||||||
.subarea[0] =
|
|
||||||
{
|
|
||||||
.first_sector = BOOTLOADER_SECTOR_START,
|
|
||||||
.num_sectors = BOOTLOADER_SECTOR_END - BOOTLOADER_SECTOR_START + 1,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const flash_area_t FIRMWARE_AREA = {
|
|
||||||
.num_subareas = 1,
|
|
||||||
.subarea[0] =
|
|
||||||
{
|
|
||||||
.first_sector = FIRMWARE_SECTOR_START,
|
|
||||||
.num_sectors = FIRMWARE_SECTOR_END - FIRMWARE_SECTOR_START + 1,
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
#define BOOTLOADER_MONOTONIC_VERSION 1
|
|
||||||
#define FIRMWARE_MONOTONIC_VERSION 1
|
|
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
#include "layout_common.h"
|
#include "layout_common.h"
|
||||||
|
|
||||||
#if defined TREZOR_MODEL_1
|
#if defined TREZOR_MODEL_T
|
||||||
#include "T1B1/model_T1B1.h"
|
|
||||||
#elif defined TREZOR_MODEL_T
|
|
||||||
#include "T2T1/model_T2T1.h"
|
#include "T2T1/model_T2T1.h"
|
||||||
#elif defined TREZOR_MODEL_R
|
#elif defined TREZOR_MODEL_R
|
||||||
#include "T2B1/model_T2B1.h"
|
#include "T2B1/model_T2B1.h"
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#ifndef MODELS_MODEL_H_
|
#ifndef MODELS_MODEL_H_
|
||||||
#define MODELS_MODEL_H_
|
#define MODELS_MODEL_H_
|
||||||
|
|
||||||
#if defined TREZOR_MODEL_1
|
#if defined TREZOR_MODEL_T
|
||||||
#include "T1B1/versions.h"
|
|
||||||
#elif defined TREZOR_MODEL_T
|
|
||||||
#include "T2T1/versions.h"
|
#include "T2T1/versions.h"
|
||||||
#elif defined TREZOR_MODEL_R
|
#elif defined TREZOR_MODEL_R
|
||||||
#include "T2B1/versions.h"
|
#include "T2B1/versions.h"
|
||||||
|
@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R
|
#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R
|
||||||
#define FLASH_SECTOR_COUNT 24
|
#define FLASH_SECTOR_COUNT 24
|
||||||
#elif defined TREZOR_MODEL_1
|
|
||||||
#define FLASH_SECTOR_COUNT 12
|
|
||||||
#elif defined TREZOR_MODEL_T3T1 || defined TREZOR_MODEL_T3B1
|
#elif defined TREZOR_MODEL_T3T1 || defined TREZOR_MODEL_T3B1
|
||||||
#define FLASH_SECTOR_COUNT 256
|
#define FLASH_SECTOR_COUNT 256
|
||||||
#else
|
#else
|
||||||
@ -72,20 +70,6 @@ static uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = {
|
|||||||
[22] = 0x081C0000, // - 0x081DFFFF | 128 KiB
|
[22] = 0x081C0000, // - 0x081DFFFF | 128 KiB
|
||||||
[23] = 0x081E0000, // - 0x081FFFFF | 128 KiB
|
[23] = 0x081E0000, // - 0x081FFFFF | 128 KiB
|
||||||
[24] = 0x08200000, // last element - not a valid sector
|
[24] = 0x08200000, // last element - not a valid sector
|
||||||
#elif defined TREZOR_MODEL_1
|
|
||||||
[0] = 0x08000000, // - 0x08003FFF | 16 KiB
|
|
||||||
[1] = 0x08004000, // - 0x08007FFF | 16 KiB
|
|
||||||
[2] = 0x08008000, // - 0x0800BFFF | 16 KiB
|
|
||||||
[3] = 0x0800C000, // - 0x0800FFFF | 16 KiB
|
|
||||||
[4] = 0x08010000, // - 0x0801FFFF | 64 KiB
|
|
||||||
[5] = 0x08020000, // - 0x0803FFFF | 128 KiB
|
|
||||||
[6] = 0x08040000, // - 0x0805FFFF | 128 KiB
|
|
||||||
[7] = 0x08060000, // - 0x0807FFFF | 128 KiB
|
|
||||||
[8] = 0x08080000, // - 0x0809FFFF | 128 KiB
|
|
||||||
[9] = 0x080A0000, // - 0x080BFFFF | 128 KiB
|
|
||||||
[10] = 0x080C0000, // - 0x080DFFFF | 128 KiB
|
|
||||||
[11] = 0x080E0000, // - 0x080FFFFF | 128 KiB
|
|
||||||
[12] = 0x08100000, // last element - not a valid sector
|
|
||||||
#elif defined TREZOR_MODEL_T3T1 || defined TREZOR_MODEL_T3B1
|
#elif defined TREZOR_MODEL_T3T1 || defined TREZOR_MODEL_T3B1
|
||||||
[0] = 0x08000000, // - 0x08001FFF | 8 KiB
|
[0] = 0x08000000, // - 0x08001FFF | 8 KiB
|
||||||
// rest is initialized in flash_init
|
// rest is initialized in flash_init
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
// Currently, following displays displays are supported
|
// Currently, following displays displays are supported
|
||||||
//
|
//
|
||||||
// VG-2864KSWEG01 - OLED Mono / 128x64 pixels / SPI
|
// VG-2864KSWEG01 - OLED Mono / 128x64 pixels / SPI
|
||||||
// - Model T1B1 / Model T2B1
|
// - Model T2B1
|
||||||
//
|
//
|
||||||
// UG-2828SWIG01 - OLED Mono / 128x128 pixels / Parallel
|
// UG-2828SWIG01 - OLED Mono / 128x128 pixels / Parallel
|
||||||
// - Early revisions of T2B1
|
// - Early revisions of T2B1
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from .emulator import configure as emul
|
|
||||||
from .trezor_1 import configure
|
|
||||||
|
|
||||||
|
|
||||||
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],
|
|
||||||
):
|
|
||||||
if revision == "emulator":
|
|
||||||
return emul(env, features_wanted, defines, sources, paths)
|
|
||||||
else:
|
|
||||||
return configure(env, features_wanted, defines, sources, paths)
|
|
@ -1,39 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from .. import get_hw_model_as_number
|
|
||||||
|
|
||||||
|
|
||||||
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 = "T1B1/boards/t1b1-unix.h"
|
|
||||||
hw_model = get_hw_model_as_number("T1B1")
|
|
||||||
hw_revision = 0
|
|
||||||
mcu = "STM32F405xx"
|
|
||||||
|
|
||||||
if "new_rendering" in features_wanted:
|
|
||||||
defines += ["XFRAMEBUFFER", "DISPLAY_MONO"]
|
|
||||||
features_available.append("xframebuffer")
|
|
||||||
features_available.append("display_mono")
|
|
||||||
|
|
||||||
defines += [mcu]
|
|
||||||
defines += [f'TREZOR_BOARD=\\"{board}\\"']
|
|
||||||
defines += [f"HW_MODEL={hw_model}"]
|
|
||||||
defines += [f"HW_REVISION={hw_revision}"]
|
|
||||||
defines += [f"MCU_TYPE={mcu}"]
|
|
||||||
defines += ["FLASH_BIT_ACCESS=1"]
|
|
||||||
defines += ["FLASH_BLOCK_WORDS=1"]
|
|
||||||
|
|
||||||
if "input" in features_wanted:
|
|
||||||
sources += ["embed/trezorhal/unix/button.c"]
|
|
||||||
features_available.append("button")
|
|
||||||
|
|
||||||
sources += ["embed/models/T1B1/model_T1B1_layout.c"]
|
|
||||||
|
|
||||||
return features_available
|
|
@ -1,57 +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] = []
|
|
||||||
board = "T1B1/boards/trezor_1.h"
|
|
||||||
display = "vg-2864ksweg01.c"
|
|
||||||
hw_model = get_hw_model_as_number("T1B1")
|
|
||||||
hw_revision = 0
|
|
||||||
|
|
||||||
mcu = "STM32F405xx"
|
|
||||||
|
|
||||||
stm32f4_common_files(env, defines, sources, paths)
|
|
||||||
|
|
||||||
env.get("ENV")["CPU_ASFLAGS"] = "-mthumb -mcpu=cortex-m3 -mfloat-abi=soft"
|
|
||||||
env.get("ENV")[
|
|
||||||
"CPU_CCFLAGS"
|
|
||||||
] = "-mthumb -mtune=cortex-m3 -mcpu=cortex-m3 -mfloat-abi=soft "
|
|
||||||
env.get("ENV")["RUST_TARGET"] = "thumbv7m-none-eabi"
|
|
||||||
|
|
||||||
defines += [mcu]
|
|
||||||
defines += [f'TREZOR_BOARD=\\"{board}\\"']
|
|
||||||
defines += [f"HW_MODEL={hw_model}"]
|
|
||||||
defines += [f"HW_REVISION={hw_revision}"]
|
|
||||||
sources += [
|
|
||||||
"embed/models/T1B1/model_T1B1_layout.c",
|
|
||||||
]
|
|
||||||
sources += [f"embed/trezorhal/stm32f4/displays/{display}"]
|
|
||||||
|
|
||||||
if "input" in features_wanted:
|
|
||||||
sources += ["embed/trezorhal/stm32f4/button.c"]
|
|
||||||
features_available.append("button")
|
|
||||||
|
|
||||||
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")
|
|
||||||
|
|
||||||
return features_available
|
|
@ -24,9 +24,7 @@ def configure_board(
|
|||||||
|
|
||||||
|
|
||||||
def get_model_identifier(model: str) -> str:
|
def get_model_identifier(model: str) -> str:
|
||||||
if model == "1":
|
if model == "T":
|
||||||
return "T1B1"
|
|
||||||
elif model == "T":
|
|
||||||
return "T2T1"
|
return "T2T1"
|
||||||
elif model == "R":
|
elif model == "R":
|
||||||
return "T2B1"
|
return "T2B1"
|
||||||
|
@ -94,8 +94,7 @@ def get_features() -> Features:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
utils.INTERNAL_MODEL == "T1B1" # pylint: disable=consider-using-in
|
utils.INTERNAL_MODEL == "T2B1" # pylint: disable=consider-using-in
|
||||||
or utils.INTERNAL_MODEL == "T2B1"
|
|
||||||
or utils.INTERNAL_MODEL == "T3B1"
|
or utils.INTERNAL_MODEL == "T3B1"
|
||||||
):
|
):
|
||||||
f.homescreen_format = HomescreenFormat.ToiG
|
f.homescreen_format = HomescreenFormat.ToiG
|
||||||
|
1569
core/src/apps/common/coininfo.py
generated
1569
core/src/apps/common/coininfo.py
generated
File diff suppressed because it is too large
Load Diff
@ -59,43 +59,6 @@ def by_slip44(slip44: int) -> EthereumNetworkInfo:
|
|||||||
|
|
||||||
# fmt: off
|
# fmt: off
|
||||||
def _networks_iterator() -> Iterator[NetworkInfoTuple]:
|
def _networks_iterator() -> Iterator[NetworkInfoTuple]:
|
||||||
if utils.INTERNAL_MODEL == "T1B1":
|
|
||||||
yield (
|
|
||||||
1, # chain_id
|
|
||||||
60, # slip44
|
|
||||||
"ETH", # symbol
|
|
||||||
"Ethereum", # name
|
|
||||||
)
|
|
||||||
yield (
|
|
||||||
56, # chain_id
|
|
||||||
714, # slip44
|
|
||||||
"BNB", # symbol
|
|
||||||
"BNB Smart Chain", # name
|
|
||||||
)
|
|
||||||
yield (
|
|
||||||
61, # chain_id
|
|
||||||
61, # slip44
|
|
||||||
"ETC", # symbol
|
|
||||||
"Ethereum Classic", # name
|
|
||||||
)
|
|
||||||
yield (
|
|
||||||
137, # chain_id
|
|
||||||
966, # slip44
|
|
||||||
"POL", # symbol
|
|
||||||
"Polygon", # name
|
|
||||||
)
|
|
||||||
yield (
|
|
||||||
17000, # chain_id
|
|
||||||
1, # slip44
|
|
||||||
"tHOL", # symbol
|
|
||||||
"Holesky", # name
|
|
||||||
)
|
|
||||||
yield (
|
|
||||||
11155111, # chain_id
|
|
||||||
1, # slip44
|
|
||||||
"tSEP", # symbol
|
|
||||||
"Sepolia", # name
|
|
||||||
)
|
|
||||||
if utils.INTERNAL_MODEL == "T2B1":
|
if utils.INTERNAL_MODEL == "T2B1":
|
||||||
yield (
|
yield (
|
||||||
1, # chain_id
|
1, # chain_id
|
||||||
|
@ -42,154 +42,6 @@ def token_by_chain_address(chain_id: int, address: bytes) -> EthereumTokenInfo |
|
|||||||
|
|
||||||
|
|
||||||
def _token_iterator(chain_id: int) -> Iterator[tuple[bytes, str, int, str]]:
|
def _token_iterator(chain_id: int) -> Iterator[tuple[bytes, str, int, str]]:
|
||||||
if utils.INTERNAL_MODEL == "T1B1":
|
|
||||||
if chain_id == 1: # eth
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x7f\xc6\x65\x00\xc8\x4a\x76\xad\x7e\x9c\x93\x43\x7b\xfc\x5a\xc3\x3e\x2d\xda\xe9",
|
|
||||||
"AAVE",
|
|
||||||
18,
|
|
||||||
"Aave",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x4d\x22\x44\x52\x80\x1a\xce\xd8\xb2\xf0\xae\xbe\x15\x53\x79\xbb\x5d\x59\x43\x81",
|
|
||||||
"APE",
|
|
||||||
18,
|
|
||||||
"ApeCoin",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xbb\x0e\x17\xef\x65\xf8\x2a\xb0\x18\xd8\xed\xd7\x76\xe8\xdd\x94\x03\x27\xb2\x8b",
|
|
||||||
"AXS",
|
|
||||||
18,
|
|
||||||
"Axie Infinity",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x4f\xab\xb1\x45\xd6\x46\x52\xa9\x48\xd7\x25\x33\x02\x3f\x6e\x7a\x62\x3c\x7c\x53",
|
|
||||||
"BUSD",
|
|
||||||
18,
|
|
||||||
"Binance USD",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x35\x06\x42\x4f\x91\xfd\x33\x08\x44\x66\xf4\x02\xd5\xd9\x7f\x05\xf8\xe3\xb4\xaf",
|
|
||||||
"CHZ",
|
|
||||||
18,
|
|
||||||
"Chiliz",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xa0\xb7\x3e\x1f\xf0\xb8\x09\x14\xab\x6f\xe0\x44\x4e\x65\x84\x8c\x4c\x34\x45\x0b",
|
|
||||||
"CRO",
|
|
||||||
8,
|
|
||||||
"Cronos",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x6b\x17\x54\x74\xe8\x90\x94\xc4\x4d\xa9\x8b\x95\x4e\xed\xea\xc4\x95\x27\x1d\x0f",
|
|
||||||
"DAI",
|
|
||||||
18,
|
|
||||||
"Dai",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x85\x3d\x95\x5a\xce\xf8\x22\xdb\x05\x8e\xb8\x50\x59\x11\xed\x77\xf1\x75\xb9\x9e",
|
|
||||||
"FRAX",
|
|
||||||
18,
|
|
||||||
"Frax",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x2a\xf5\xd2\xad\x76\x74\x11\x91\xd1\x5d\xfe\x7b\xf6\xac\x92\xd4\xbd\x91\x2c\xa3",
|
|
||||||
"LEO",
|
|
||||||
18,
|
|
||||||
"LEO Token",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x51\x49\x10\x77\x1a\xf9\xca\x65\x6a\xf8\x40\xdf\xf8\x3e\x82\x64\xec\xf9\x86\xca",
|
|
||||||
"LINK",
|
|
||||||
18,
|
|
||||||
"Chainlink",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x0f\x5d\x2f\xb2\x9f\xb7\xd3\xcf\xee\x44\x4a\x20\x02\x98\xf4\x68\x90\x8c\xc9\x42",
|
|
||||||
"MANA",
|
|
||||||
18,
|
|
||||||
"Decentraland",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x7d\x1a\xfa\x7b\x71\x8f\xb8\x93\xdb\x30\xa3\xab\xc0\xcf\xc6\x08\xaa\xcf\xeb\xb0",
|
|
||||||
"MATIC",
|
|
||||||
18,
|
|
||||||
"Polygon",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x75\x23\x1f\x58\xb4\x32\x40\xc9\x71\x8d\xd5\x8b\x49\x67\xc5\x11\x43\x42\xa8\x6c",
|
|
||||||
"OKB",
|
|
||||||
18,
|
|
||||||
"OKB",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x4a\x22\x0e\x60\x96\xb2\x5e\xad\xb8\x83\x58\xcb\x44\x06\x8a\x32\x48\x25\x46\x75",
|
|
||||||
"QNT",
|
|
||||||
18,
|
|
||||||
"Quant",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x38\x45\xba\xda\xde\x8e\x6d\xff\x04\x98\x20\x68\x0d\x1f\x14\xbd\x39\x03\xa5\xd0",
|
|
||||||
"SAND",
|
|
||||||
18,
|
|
||||||
"The Sandbox",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x95\xad\x61\xb0\xa1\x50\xd7\x92\x19\xdc\xf6\x4e\x1e\x6c\xc0\x1f\x0b\x64\xc4\xce",
|
|
||||||
"SHIB",
|
|
||||||
18,
|
|
||||||
"Shiba Inu",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xae\x7a\xb9\x65\x20\xde\x3a\x18\xe5\xe1\x11\xb5\xea\xab\x09\x53\x12\xd7\xfe\x84",
|
|
||||||
"STETH",
|
|
||||||
18,
|
|
||||||
"Lido Staked Ether",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x1f\x98\x40\xa8\x5d\x5a\xf5\xbf\x1d\x17\x62\xf9\x25\xbd\xad\xdc\x42\x01\xf9\x84",
|
|
||||||
"UNI",
|
|
||||||
18,
|
|
||||||
"Uniswap",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xa0\xb8\x69\x91\xc6\x21\x8b\x36\xc1\xd1\x9d\x4a\x2e\x9e\xb0\xce\x36\x06\xeb\x48",
|
|
||||||
"USDC",
|
|
||||||
6,
|
|
||||||
"USD Coin",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xda\xc1\x7f\x95\x8d\x2e\xe5\x23\xa2\x20\x62\x06\x99\x45\x97\xc1\x3d\x83\x1e\xc7",
|
|
||||||
"USDT",
|
|
||||||
6,
|
|
||||||
"Tether",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x22\x60\xfa\xc5\xe5\x54\x2a\x77\x3a\xa4\x4f\xbc\xfe\xdf\x7c\x19\x3b\xc2\xc5\x99",
|
|
||||||
"WBTC",
|
|
||||||
8,
|
|
||||||
"Wrapped Bitcoin",
|
|
||||||
)
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\xa2\xcd\x3d\x43\xc7\x75\x97\x8a\x96\xbd\xbf\x12\xd7\x33\xd5\xa1\xed\x94\xfb\x18",
|
|
||||||
"XCN",
|
|
||||||
18,
|
|
||||||
"Chain",
|
|
||||||
)
|
|
||||||
if chain_id == 56: # bnb
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x0e\xb3\xa7\x05\xfc\x54\x72\x50\x37\xcc\x9e\x00\x8b\xde\xde\x69\x7f\x62\xf3\x35",
|
|
||||||
"ATOM",
|
|
||||||
18,
|
|
||||||
"Cosmos Hub",
|
|
||||||
)
|
|
||||||
if chain_id == 137: # matic
|
|
||||||
yield ( # address, symbol, decimals, name
|
|
||||||
b"\x2c\x89\xbb\xc9\x2b\xd8\x6f\x80\x75\xd1\xde\xcc\x58\xc7\xf4\xe0\x10\x7f\x28\x6b",
|
|
||||||
"WAVAX",
|
|
||||||
18,
|
|
||||||
"Wrapped AVAX",
|
|
||||||
)
|
|
||||||
if utils.INTERNAL_MODEL == "T2B1":
|
if utils.INTERNAL_MODEL == "T2B1":
|
||||||
if chain_id == 1: # eth
|
if chain_id == 1: # eth
|
||||||
yield ( # address, symbol, decimals, name
|
yield ( # address, symbol, decimals, name
|
||||||
|
@ -53,12 +53,7 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
# in both debug and production, emulator needs to draw the screen explicitly
|
# in both debug and production, emulator needs to draw the screen explicitly
|
||||||
if (
|
if utils.EMULATOR or utils.INTERNAL_MODEL == "T2B1" or utils.INTERNAL_MODEL == "T3B1":
|
||||||
utils.EMULATOR
|
|
||||||
or utils.INTERNAL_MODEL == "T1B1"
|
|
||||||
or utils.INTERNAL_MODEL == "T2B1"
|
|
||||||
or utils.INTERNAL_MODEL == "T3B1"
|
|
||||||
):
|
|
||||||
loop.after_step_hook = refresh
|
loop.after_step_hook = refresh
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from common import * # isort:skip
|
from common import * # isort:skip
|
||||||
|
|
||||||
if utils.INTERNAL_MODEL in ("T1B1", "T2T1"):
|
if utils.INTERNAL_MODEL in ("T2T1", ):
|
||||||
from trezor.crypto import bip39
|
from trezor.crypto import bip39
|
||||||
from trezor.enums import AmountUnit, OutputScriptType
|
from trezor.enums import AmountUnit, OutputScriptType
|
||||||
from trezor.enums.RequestType import TXFINISHED, TXINPUT, TXMETA, TXOUTPUT
|
from trezor.enums.RequestType import TXFINISHED, TXINPUT, TXMETA, TXOUTPUT
|
||||||
@ -405,5 +405,5 @@ class TestSignTxDecred(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if utils.INTERNAL_MODEL in ("T1B1", "T2T1"):
|
if utils.INTERNAL_MODEL in ("T2T1",):
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -22,7 +22,7 @@ class TestCoins(unittest.TestCase):
|
|||||||
("ZEC", "Zcash", 7352),
|
("ZEC", "Zcash", 7352),
|
||||||
("TAZ", "Zcash Testnet", 7461),
|
("TAZ", "Zcash Testnet", 7461),
|
||||||
]
|
]
|
||||||
if utils.INTERNAL_MODEL in ("T1B1", "T2T1"):
|
if utils.INTERNAL_MODEL in ("T2T1",):
|
||||||
ref.extend(
|
ref.extend(
|
||||||
[
|
[
|
||||||
("NMC", "Namecoin", 52),
|
("NMC", "Namecoin", 52),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
CWD=`dirname "$0"`
|
CWD=`dirname "$0"`
|
||||||
RENDER="$CWD/../vendor/trezor-common/tools/cointool.py render"
|
RENDER="$CWD/../vendor/trezor-common/tools/cointool.py render -M T1B1"
|
||||||
|
|
||||||
# Search both in `core/src` and `core/embed` - Solana templates are excluded since those are handled separately
|
# Search both in `core/src` and `core/embed` - Solana templates are excluded since those are handled separately
|
||||||
FIND_TEMPLATES="find $CWD/.. -name *.mako -not -name _proto* -not -path *solana*"
|
FIND_TEMPLATES="find $CWD/.. -name *.mako -not -name _proto* -not -path *solana*"
|
||||||
|
@ -27,7 +27,7 @@ from .layout_parser import find_all_values
|
|||||||
def main(model: str, bin: list[tuple[str, Path]], outfile: Path | None) -> None:
|
def main(model: str, bin: list[tuple[str, Path]], outfile: Path | None) -> None:
|
||||||
"""Create a combined.bin file from components.
|
"""Create a combined.bin file from components.
|
||||||
|
|
||||||
MODEL is the internal model name (e.g. T1B1, T2T1, T2B1).
|
MODEL is the internal model name (e.g. T2T1, T2B1).
|
||||||
|
|
||||||
BIN is a list of tuples with the type and path to the binary file. The usual types
|
BIN is a list of tuples with the type and path to the binary file. The usual types
|
||||||
are:
|
are:
|
||||||
|
Loading…
Reference in New Issue
Block a user