mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-03 16:56:07 +00:00
build(core): embed bootloader according to trezor model
[no changelog]
This commit is contained in:
parent
ab949053e8
commit
4603b9ee74
@ -772,12 +772,18 @@ obj_program.extend(
|
|||||||
' --rename-section .data=.vendorheader,alloc,load,readonly,contents'
|
' --rename-section .data=.vendorheader,alloc,load,readonly,contents'
|
||||||
' $SOURCE $TARGET', ))
|
' $SOURCE $TARGET', ))
|
||||||
|
|
||||||
|
|
||||||
|
BOOTLOADER_SUFFIX = tools.get_model_identifier(TREZOR_MODEL)
|
||||||
|
|
||||||
obj_program.extend(
|
obj_program.extend(
|
||||||
env.Command(
|
env.Command(
|
||||||
target='embed/firmware/bootloader.o',
|
target='embed/firmware/bootloaders/bootloader.o',
|
||||||
source='embed/firmware/bootloader.bin',
|
source=f'embed/firmware/bootloaders/bootloader_{BOOTLOADER_SUFFIX}.bin',
|
||||||
action='$OBJCOPY -I binary -O elf32-littlearm -B arm'
|
action='$OBJCOPY -I binary -O elf32-littlearm -B arm'
|
||||||
' --rename-section .data=.bootloader'
|
' --rename-section .data=.bootloader'
|
||||||
|
f' --redefine-sym _binary_embed_firmware_bootloaders_bootloader_{BOOTLOADER_SUFFIX}_bin_start=_binary_embed_firmware_bootloader_bin_start'
|
||||||
|
f' --redefine-sym _binary_embed_firmware_bootloaders_bootloader_{BOOTLOADER_SUFFIX}_bin_end=_binary_embed_firmware_bootloader_bin_end'
|
||||||
|
f' --redefine-sym _binary_embed_firmware_bootloaders_bootloader_{BOOTLOADER_SUFFIX}_bin_size=_binary_embed_firmware_bootloader_bin_size'
|
||||||
' $SOURCE $TARGET', ))
|
' $SOURCE $TARGET', ))
|
||||||
|
|
||||||
env.Depends(obj_program, qstr_generated)
|
env.Depends(obj_program, qstr_generated)
|
||||||
|
BIN
core/embed/firmware/bootloaders/bootloader_T1B1.bin
Normal file
BIN
core/embed/firmware/bootloaders/bootloader_T1B1.bin
Normal file
Binary file not shown.
@ -44,3 +44,14 @@ def configure_board(model, env, defines, sources):
|
|||||||
defines += [f'HW_REVISION={hw_revision}', ]
|
defines += [f'HW_REVISION={hw_revision}', ]
|
||||||
sources += [f'embed/trezorhal/displays/{display}', ]
|
sources += [f'embed/trezorhal/displays/{display}', ]
|
||||||
env.get('ENV')['TREZOR_BOARD'] = board
|
env.get('ENV')['TREZOR_BOARD'] = board
|
||||||
|
|
||||||
|
|
||||||
|
def get_model_identifier(model):
|
||||||
|
if model == '1':
|
||||||
|
return "T1B1"
|
||||||
|
elif model == 'T':
|
||||||
|
return "T2T1"
|
||||||
|
elif model == 'R':
|
||||||
|
return "T2B1"
|
||||||
|
else:
|
||||||
|
raise Exception("Unknown model")
|
||||||
|
Loading…
Reference in New Issue
Block a user