mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-22 19:15:43 +00:00
bootloader update in prodtest
This commit is contained in:
parent
8d224f7a37
commit
f17c6bfe18
@ -6,6 +6,7 @@ import tools, models, ui
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
|
||||
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
||||
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1'
|
||||
@ -41,6 +42,7 @@ SOURCE_MOD_CRYPTO += [
|
||||
'vendor/trezor-crypto/aes/aeskey.c',
|
||||
'vendor/trezor-crypto/aes/aestab.c',
|
||||
'vendor/trezor-crypto/bignum.c',
|
||||
'vendor/trezor-crypto/blake2s.c',
|
||||
'vendor/trezor-crypto/buffer.c',
|
||||
'vendor/trezor-crypto/chacha_drbg.c',
|
||||
'vendor/trezor-crypto/chacha20poly1305/chacha_merged.c',
|
||||
@ -72,6 +74,7 @@ SOURCE_MOD += [
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/bl_check/bl_check.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/util/scm_revision/scm_revision.c',
|
||||
@ -88,7 +91,7 @@ ui.init_ui(TREZOR_MODEL, "prodtest", RUST_UI_FEATURES)
|
||||
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={ARGUMENTS.get('PRODUCTION', '0')} -DBOOTLOADER_QA={int(BOOTLOADER_QA)}",
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
@ -150,6 +153,7 @@ ALLPATHS = [
|
||||
'embed/models',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/bl_check/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/util/scm_revision/inc',
|
||||
@ -243,6 +247,20 @@ else:
|
||||
VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/vendorheader_unsafe_signed_prod.bin'
|
||||
|
||||
|
||||
BOOTLOADER_SUFFIX = TREZOR_MODEL
|
||||
if BOOTLOADER_QA or BOOTLOADER_DEVEL:
|
||||
BOOTLOADER_SUFFIX += '_qa'
|
||||
|
||||
tools.embed_compressed_binary(
|
||||
obj_program,
|
||||
env,
|
||||
'bootloader',
|
||||
'embed/projects/bootloaders/bootloader.o',
|
||||
f'embed/models/{TREZOR_MODEL}/bootloaders/bootloader_{BOOTLOADER_SUFFIX}.bin',
|
||||
'prodtest',
|
||||
'bootloader',
|
||||
)
|
||||
|
||||
tools.embed_raw_binary(
|
||||
obj_program,
|
||||
env,
|
||||
|
Binary file not shown.
@ -5,12 +5,12 @@
|
||||
|
||||
// clang-format off
|
||||
// bootloader_T3W1.bin version 2.1.10.0
|
||||
#define BOOTLOADER_T3W1_00 {0x33, 0x7b, 0xe4, 0xc8, 0x54, 0x54, 0x4e, 0x0d, 0xf7, 0xd0, 0x29, 0xed, 0x5b, 0x6d, 0x35, 0x0f, 0xf4, 0x77, 0x87, 0x3f, 0xa2, 0xd1, 0x21, 0xca, 0x99, 0xd0, 0xfc, 0x94, 0xc1, 0xa8, 0xac, 0x78}
|
||||
#define BOOTLOADER_T3W1_FF {0xa0, 0x71, 0xd4, 0xea, 0x0a, 0xab, 0xce, 0x92, 0x8d, 0xf2, 0xce, 0xff, 0xe2, 0xd2, 0x12, 0x31, 0x47, 0xd0, 0xbb, 0x25, 0x01, 0xd2, 0x1a, 0xa4, 0x21, 0xff, 0xb0, 0xc8, 0x2a, 0x23, 0x41, 0x3d}
|
||||
#define BOOTLOADER_T3W1_00 {0xa6, 0xf0, 0xd1, 0xa0, 0xdc, 0xdd, 0xa7, 0x1e, 0xd8, 0x1e, 0x3a, 0x6c, 0x55, 0x9a, 0xb2, 0xf0, 0xc7, 0xdf, 0xe8, 0xd8, 0x6d, 0xfb, 0x4e, 0xb8, 0xb4, 0xb9, 0x13, 0x8d, 0x8d, 0xa7, 0x5f, 0xaa}
|
||||
#define BOOTLOADER_T3W1_FF {0xb9, 0x41, 0x87, 0x7b, 0xec, 0x55, 0x1a, 0xfb, 0xab, 0xa6, 0xa8, 0x5d, 0xce, 0x34, 0x3b, 0x4f, 0x4d, 0xfc, 0x26, 0x8b, 0x24, 0x68, 0x8b, 0x3d, 0x76, 0xee, 0xd0, 0xf8, 0x66, 0xd6, 0x64, 0x5a}
|
||||
|
||||
// bootloader_T3W1_qa.bin version 2.1.11.0
|
||||
#define BOOTLOADER_T3W1_QA_00 {0x70, 0xd0, 0xcb, 0xe3, 0xb9, 0x9a, 0x6b, 0x5f, 0xe5, 0x38, 0xf9, 0xb3, 0x80, 0x49, 0x80, 0xe8, 0xbb, 0xb4, 0xda, 0xf6, 0x4d, 0xab, 0xe9, 0x31, 0xa9, 0xdf, 0x90, 0x69, 0x07, 0xc7, 0x3f, 0x06}
|
||||
#define BOOTLOADER_T3W1_QA_FF {0xa9, 0xd7, 0x74, 0x24, 0x0d, 0xb9, 0x75, 0x11, 0x2d, 0xff, 0xbf, 0x64, 0x83, 0xe1, 0xe3, 0xe5, 0xb5, 0x91, 0x95, 0xc6, 0x97, 0x55, 0x1e, 0xcc, 0x86, 0x45, 0xde, 0x99, 0x23, 0xaf, 0xc9, 0xfe}
|
||||
// bootloader_T3W1_qa.bin version 2.1.12.0
|
||||
#define BOOTLOADER_T3W1_QA_00 {0xed, 0xd9, 0x03, 0x09, 0x3a, 0x4c, 0x6f, 0x3c, 0xce, 0xe8, 0x75, 0xce, 0xa7, 0xdf, 0x04, 0xa8, 0x9e, 0x73, 0x58, 0x09, 0x1d, 0x00, 0x13, 0x17, 0x87, 0xb8, 0x2b, 0x4a, 0x48, 0xf5, 0xce, 0x03}
|
||||
#define BOOTLOADER_T3W1_QA_FF {0x97, 0xa1, 0x7e, 0x04, 0x8b, 0x7b, 0xf2, 0x07, 0x73, 0x2c, 0xcb, 0x39, 0x3f, 0xbe, 0x07, 0xa6, 0x98, 0x38, 0xa0, 0x4b, 0xbe, 0xb1, 0x91, 0x27, 0x4d, 0xc1, 0xa5, 0x2e, 0xa0, 0xe3, 0x18, 0xee}
|
||||
|
||||
// clang-format on
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MODELS_MODEL_T3W1_H_
|
||||
#define MODELS_MODEL_T3W1_H_
|
||||
|
||||
// #include "bootloaders/bootloader_hashes.h"
|
||||
#include "bootloaders/bootloader_hashes.h"
|
||||
|
||||
#include <rtl/sizedefs.h>
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <rtl/cli.h>
|
||||
#include <sys/system.h>
|
||||
#include <sys/systick.h>
|
||||
#include <util/bl_check.h>
|
||||
#include <util/board_capabilities.h>
|
||||
#include <util/flash_otp.h>
|
||||
#include <util/rsod.h>
|
||||
#include <util/unit_properties.h>
|
||||
@ -228,6 +230,11 @@ static void drivers_init(void) {
|
||||
#ifdef USE_HW_REVISION
|
||||
hw_revision_init();
|
||||
#endif
|
||||
|
||||
#if BOOTLOADER_QA
|
||||
parse_boardloader_capabilities();
|
||||
check_and_replace_bootloader();
|
||||
#endif
|
||||
}
|
||||
|
||||
#define BACKLIGHT_NORMAL 150
|
||||
|
@ -61,6 +61,9 @@ SECTIONS {
|
||||
. = ALIGN(4);
|
||||
*(.rodata*);
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.bootloader));
|
||||
*(.bootloader*);
|
||||
. = ALIGN(4);
|
||||
|
||||
_prodtest_cli_cmd_section_start = .;
|
||||
KEEP(*(.prodtest_cli_cmd))
|
||||
|
@ -7,7 +7,7 @@ from hashlib import blake2s
|
||||
|
||||
from trezorlib.firmware.core import FirmwareImage, Model
|
||||
|
||||
ALIGNED_SIZE = 128 * 1024
|
||||
ALIGNED_SIZE = 192 * 1024
|
||||
|
||||
HERE = Path(__file__).parent
|
||||
BOOTLOADERS = HERE / ".." / "embed" / "models"
|
||||
|
Loading…
Reference in New Issue
Block a user