2019-06-17 18:27:55 +00:00
|
|
|
/* Trezor v2 bootloader linker script */
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
ENTRY(reset_handler)
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
MEMORY {
|
2023-10-20 12:58:32 +00:00
|
|
|
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 128K
|
|
|
|
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K - 0x100
|
|
|
|
BOOT_ARGS (wal) : ORIGIN = 0x1000FF00, LENGTH = 0x100
|
|
|
|
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K
|
2017-10-09 15:44:58 +00:00
|
|
|
}
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2022-08-09 17:16:54 +00:00
|
|
|
main_stack_base = ORIGIN(CCMRAM) + SIZEOF(.stack) ; /* 8-byte aligned full descending stack */
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
/* used by the startup code to populate variables used by the C code */
|
|
|
|
data_lma = LOADADDR(.data);
|
|
|
|
data_vma = ADDR(.data);
|
|
|
|
data_size = SIZEOF(.data);
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-08 17:25:56 +00:00
|
|
|
/* used by the startup code to wipe memory */
|
|
|
|
ccmram_start = ORIGIN(CCMRAM);
|
|
|
|
ccmram_end = ORIGIN(CCMRAM) + LENGTH(CCMRAM);
|
|
|
|
|
|
|
|
/* used by the startup code to wipe memory */
|
2017-10-09 15:44:58 +00:00
|
|
|
sram_start = ORIGIN(SRAM);
|
|
|
|
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
|
|
|
|
2023-10-20 12:58:32 +00:00
|
|
|
/* reserve 256 bytes for bootloader arguments */
|
|
|
|
boot_args_start = ORIGIN(BOOT_ARGS);
|
|
|
|
boot_args_end = ORIGIN(BOOT_ARGS) + LENGTH(BOOT_ARGS);
|
|
|
|
g_boot_args = boot_args_start;
|
2023-08-09 12:53:13 +00:00
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
_codelen = SIZEOF(.flash) + SIZEOF(.data);
|
2017-10-09 15:44:58 +00:00
|
|
|
|
|
|
|
SECTIONS {
|
|
|
|
.header : ALIGN(4) {
|
|
|
|
KEEP(*(.header));
|
|
|
|
} >FLASH AT>FLASH
|
|
|
|
|
|
|
|
.flash : ALIGN(512) {
|
|
|
|
KEEP(*(.vector_table));
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.text*);
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.rodata*);
|
|
|
|
. = ALIGN(512);
|
|
|
|
} >FLASH AT>FLASH
|
|
|
|
|
2022-08-09 17:16:54 +00:00
|
|
|
.stack : ALIGN(8) {
|
|
|
|
. = 16K; /* Exactly 16K allocated for stack. Overflow causes MemManage fault (when using MPU). */
|
|
|
|
} >CCMRAM
|
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
.data : ALIGN(4) {
|
|
|
|
*(.data*);
|
|
|
|
. = ALIGN(512);
|
|
|
|
} >CCMRAM AT>FLASH
|
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
/DISCARD/ : {
|
|
|
|
*(.ARM.exidx*);
|
|
|
|
}
|
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
.bss : ALIGN(4) {
|
|
|
|
*(.bss*);
|
|
|
|
. = ALIGN(4);
|
|
|
|
} >CCMRAM
|
|
|
|
|
2022-05-31 07:31:32 +00:00
|
|
|
.buf : ALIGN(4) {
|
|
|
|
*(.buf*);
|
|
|
|
. = ALIGN(4);
|
|
|
|
} >SRAM
|
|
|
|
|
2017-10-09 15:44:58 +00:00
|
|
|
}
|