2017-10-09 15:45:45 +00:00
|
|
|
/* TREZORv2 firmware linker script */
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:45:45 +00:00
|
|
|
ENTRY(reset_handler)
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:45:45 +00:00
|
|
|
MEMORY {
|
2017-10-11 19:15:22 +00:00
|
|
|
FLASH (rx) : ORIGIN = 0x08040000, LENGTH = 768K
|
2018-06-20 12:55:30 +00:00
|
|
|
FLASH2 (r) : ORIGIN = 0x08120000, LENGTH = 896K
|
2017-10-09 15:45:45 +00:00
|
|
|
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
|
2017-10-11 21:36:07 +00:00
|
|
|
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K
|
2017-10-09 15:45:45 +00:00
|
|
|
}
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:45:45 +00:00
|
|
|
main_stack_base = ORIGIN(SRAM) + LENGTH(SRAM); /* 8-byte aligned full descending stack */
|
|
|
|
_estack = main_stack_base;
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:45:45 +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-09 15:45:45 +00:00
|
|
|
/* used by the startup code to wipe memory */
|
|
|
|
ccmram_start = ORIGIN(CCMRAM);
|
|
|
|
ccmram_end = ORIGIN(CCMRAM) + LENGTH(CCMRAM);
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2017-10-09 15:45:45 +00:00
|
|
|
/* used by the startup code to wipe memory */
|
|
|
|
sram_start = ORIGIN(SRAM);
|
|
|
|
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
|
|
|
_ram_start = sram_start;
|
|
|
|
_ram_end = sram_end;
|
2017-02-06 14:38:45 +00:00
|
|
|
|
2018-06-20 12:55:30 +00:00
|
|
|
_codelen = LENGTH(FLASH) - SIZEOF(.vendorheader) - SIZEOF(.header) + SIZEOF(.flash2);
|
2017-09-28 12:08:08 +00:00
|
|
|
_flash_start = ORIGIN(FLASH);
|
|
|
|
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
2017-10-09 15:45:45 +00:00
|
|
|
_heap_start = ADDR(.heap);
|
|
|
|
_heap_end = ADDR(.heap) + SIZEOF(.heap);
|
|
|
|
|
|
|
|
SECTIONS {
|
2017-10-25 22:07:16 +00:00
|
|
|
.vendorheader : ALIGN(4) {
|
2017-10-09 15:45:45 +00:00
|
|
|
KEEP(*(.vendorheader))
|
2017-10-25 22:07:16 +00:00
|
|
|
} >FLASH AT>FLASH
|
|
|
|
|
|
|
|
.header : ALIGN(4) {
|
2017-10-09 15:45:45 +00:00
|
|
|
KEEP(*(.header));
|
|
|
|
} >FLASH AT>FLASH
|
|
|
|
|
2018-06-20 12:55:30 +00:00
|
|
|
.flash2 : ALIGN(512) {
|
|
|
|
build/firmware/frozen_mpy.o(.rodata*);
|
|
|
|
. = ALIGN(512);
|
|
|
|
} >FLASH2 AT>FLASH2
|
|
|
|
|
2017-10-09 15:45:45 +00:00
|
|
|
.flash : ALIGN(512) {
|
|
|
|
KEEP(*(.vector_table));
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.text*);
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.rodata*);
|
|
|
|
. = ALIGN(512);
|
|
|
|
} >FLASH AT>FLASH
|
|
|
|
|
|
|
|
.data : ALIGN(4) {
|
|
|
|
*(.data*);
|
|
|
|
. = ALIGN(512);
|
|
|
|
} >SRAM AT>FLASH
|
|
|
|
|
|
|
|
.bss : ALIGN(4) {
|
|
|
|
*(.bss*);
|
|
|
|
. = ALIGN(4);
|
|
|
|
} >SRAM
|
|
|
|
|
|
|
|
.heap : ALIGN(4) {
|
|
|
|
. = 37K; /* this acts as a build time assertion that at least this much memory is available for heap use */
|
|
|
|
. = ABSOLUTE(sram_end - 16K); /* this explicitly sets the end of the heap effectively giving the stack at most 16K */
|
|
|
|
} >SRAM
|
|
|
|
|
|
|
|
.stack : ALIGN(8) {
|
|
|
|
. = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */
|
|
|
|
} >SRAM
|
|
|
|
}
|