mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
Merge pull request #995 from trezor/omikle/t1-core-port
core port to Trezor One
This commit is contained in:
commit
6704ed86a1
@ -626,7 +626,8 @@ if env.get('TREZOR_MODEL') == 'T':
|
|||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
action_bin=[
|
action_bin=[
|
||||||
'$OBJCOPY -O binary -j .flash -j .data $SOURCE $TARGET',
|
'$OBJCOPY -O binary -j .header -j .flash -j .data $SOURCE $TARGET',
|
||||||
|
'../legacy/bootloader/firmware_sign.py -f $TARGET',
|
||||||
]
|
]
|
||||||
|
|
||||||
program_bin = env.Command(
|
program_bin = env.Command(
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
.type g_header, %object
|
.type g_header, %object
|
||||||
.size g_header, .-g_header
|
.size g_header, .-g_header
|
||||||
|
|
||||||
|
// Firmware header for both Trezor One and Trezor T.
|
||||||
|
// Trezor One must have bootloader version >= 1.8.0 (before that version the hdrlen used to be reset vector)
|
||||||
|
|
||||||
g_header:
|
g_header:
|
||||||
.byte 'T','R','Z','F' // magic
|
.byte 'T','R','Z','F' // magic
|
||||||
.word g_header_end - g_header // hdrlen
|
.word g_header_end - g_header // hdrlen
|
||||||
@ -22,7 +25,23 @@ g_header:
|
|||||||
.byte FIX_VERSION_BUILD // fix_vbuild
|
.byte FIX_VERSION_BUILD // fix_vbuild
|
||||||
. = . + 8 // reserved
|
. = . + 8 // reserved
|
||||||
. = . + 512 // hash1 ... hash16
|
. = . + 512 // hash1 ... hash16
|
||||||
|
|
||||||
|
#if TREZOR_MODEL != 1
|
||||||
|
// model T header specifics
|
||||||
. = . + 415 // reserved
|
. = . + 415 // reserved
|
||||||
.byte 0 // sigmask
|
.byte 0 // sigmask
|
||||||
. = . + 64 // sig
|
. = . + 64 // sig
|
||||||
|
#else
|
||||||
|
// model 1 header specifics
|
||||||
|
. = . + 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:
|
||||||
|
|
||||||
|
@ -26,13 +26,17 @@ sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
|||||||
_ram_start = sram_start;
|
_ram_start = sram_start;
|
||||||
_ram_end = sram_end;
|
_ram_end = sram_end;
|
||||||
|
|
||||||
_codelen = LENGTH(FLASH);
|
_codelen = SIZEOF(.flash) + SIZEOF(.data) + SIZEOF(.ARM.exidx);
|
||||||
_flash_start = ORIGIN(FLASH);
|
_flash_start = ORIGIN(FLASH);
|
||||||
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||||
_heap_start = ADDR(.heap);
|
_heap_start = ADDR(.heap);
|
||||||
_heap_end = ADDR(.heap) + SIZEOF(.heap);
|
_heap_end = ADDR(.heap) + SIZEOF(.heap);
|
||||||
|
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
|
.header : ALIGN(4) {
|
||||||
|
KEEP(*(.header));
|
||||||
|
} >FLASH AT>FLASH
|
||||||
|
|
||||||
.flash : ALIGN(512) {
|
.flash : ALIGN(512) {
|
||||||
KEEP(*(.vector_table));
|
KEEP(*(.vector_table));
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -5,6 +5,14 @@
|
|||||||
.global reset_handler
|
.global reset_handler
|
||||||
.type reset_handler, STT_FUNC
|
.type reset_handler, STT_FUNC
|
||||||
reset_handler:
|
reset_handler:
|
||||||
|
|
||||||
|
#if TREZOR_MODEL == 1
|
||||||
|
ldr r0, =_estack - 8 // r0 = stack pointer, T1 bootloader had 8 bytes reserved at end
|
||||||
|
msr msp, r0 // set stack pointer
|
||||||
|
dsb
|
||||||
|
isb
|
||||||
|
#endif
|
||||||
|
|
||||||
// setup environment for subsequent stage of code
|
// setup environment for subsequent stage of code
|
||||||
ldr r0, =ccmram_start // r0 - point to beginning of CCMRAM
|
ldr r0, =ccmram_start // r0 - point to beginning of CCMRAM
|
||||||
ldr r1, =ccmram_end // r1 - point to byte after the end of CCMRAM
|
ldr r1, =ccmram_end // r1 - point to byte after the end of CCMRAM
|
||||||
|
Loading…
Reference in New Issue
Block a user