1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 00:08:10 +00:00
trezor-firmware/embed/boardloader/memory.ld

75 lines
2.8 KiB
Plaintext
Raw Normal View History

2017-09-10 19:23:47 +00:00
/* TREZORv2 boardloader linker script */
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
ENTRY(reset_handler)
MEMORY {
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 128K /* note: the boardloader uses mostly CCMRAM */
2017-02-06 14:38:45 +00:00
}
2017-09-10 19:23:47 +00:00
main_stack_base = ORIGIN(CCMRAM) + LENGTH(CCMRAM); /* 8-byte aligned full descending stack */
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
minimum_stack_size = 4K; /* reserve a chunk for stack space */
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +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-09-10 19:23:47 +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-09-10 19:23:47 +00:00
/* used by the startup code to wipe memory */
sram_start = ORIGIN(SRAM);
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
/* alignment references refer to sections in the ARM v7-M Architecture Reference Manual */
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
SECTIONS {
.vector_table : ALIGN(512) { /* B1.5.3 and Table 61 of STM32F405 Reference Manual (RM0090) */
KEEP(*(.vector_table))
} >FLASH AT>FLASH
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
.text : ALIGN(4) { /* A3.3.1 - needs at least 2 */
KEEP(*(.text)) /* does not match all .text*, but influences their positioning */
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
} >FLASH AT>FLASH
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
.rodata : ALIGN(4) {
KEEP(*(.rodata)) /* does not match all .rodata*, but influences their positioning */
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
} >FLASH AT>FLASH
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
.data : ALIGN(4) {
KEEP(*(.data*)) /* combine all the .data* so that the startup code can copy it in all at once */
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
} >CCMRAM AT>FLASH
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
.bss : ALIGN(4) {
KEEP(*(.bss)) /* does not match all .bss*, but influences their positioning */
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
} >CCMRAM
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
.stack : ALIGN(8) { /* B1.5.7 */
. += minimum_stack_size;
. = ALIGN(8); /* force the section to end on an double word-aligned boundary */
} >CCMRAM
2017-02-06 14:38:45 +00:00
2017-09-10 19:23:47 +00:00
/* todo: reduce unused stuff being linked and garbage collected */
/* requires moving code around and updating build scripts. */
/DISCARD/ : {
*/embed/extmod/modtrezorui/display.o (.text.get_glyph)
*/embed/extmod/modtrezorui/display.o (.text.display_image)
*/embed/extmod/modtrezorui/display.o (.text.display_avatar)
*/embed/extmod/modtrezorui/display.o (.text.display_icon)
*/embed/extmod/modtrezorui/display.o (.text.display_qrcode)
*/embed/extmod/modtrezorui/display.o (.text.display_loader)
*/embed/extmod/modtrezorui/display.o (.text.display_text)
*/embed/extmod/modtrezorui/display.o (.text.display_text_width)
*/embed/extmod/modtrezorui/display.o (.text.display_text_center)
*/embed/extmod/modtrezorui/display.o (.text.display_text_right)
}
}