1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 05:03:07 +00:00

feat(legacy): add model info to image header

This commit is contained in:
tychovrahe 2022-12-20 10:14:50 +01:00 committed by matejcik
parent 335ac476a2
commit 6d2b73ea86
3 changed files with 15 additions and 2 deletions

View File

@ -95,6 +95,13 @@ LDFLAGS += -L$(TOP_DIR) \
ZKP_PATH = $(TOP_DIR)vendor/secp256k1-zkp
# hw_model = T1B1 = 0x31423154
HW_MODEL = 0x31423154
CPUFLAGS += -DHW_MODEL=$(HW_MODEL)
CPUFLAGS += -DHW_REVISION=0
CFLAGS += -DHW_MODEL=$(HW_MODEL)
CFLAGS += -DHW_REVISION=0
ifeq ($(EMULATOR),1)
CFLAGS += -DEMULATOR=1

View File

@ -20,7 +20,10 @@ g_header:
.byte FIX_VERSION_MINOR // fix_vminor
.byte FIX_VERSION_PATCH // fix_vpatch
.byte 0 // fix_vbuild
. = . + 8 // reserved
.word HW_MODEL // type of the designated hardware
.byte HW_REVISION // revision of the designated hardware
.byte 0 // monotonic version placeholder - not used in legacy
. = . + 2 // reserved
. = . + 512 // hash1 ... hash16
. = . + 64 // sig1
. = . + 64 // sig2

View File

@ -44,7 +44,10 @@ typedef struct {
uint32_t codelen;
uint32_t version;
uint32_t fix_version;
uint8_t __reserved1[8];
uint32_t hw_model;
uint8_t hw_revision;
uint8_t monotonic;
uint8_t __reserved1[2];
uint8_t hashes[512];
uint8_t sig1[64];
uint8_t sig2[64];