mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 07:50:57 +00:00
boardloader: simplify linker script (#27)
This commit is contained in:
parent
fda9f584e8
commit
b0c54e2a4b
@ -3,15 +3,13 @@
|
|||||||
ENTRY(reset_handler)
|
ENTRY(reset_handler)
|
||||||
|
|
||||||
MEMORY {
|
MEMORY {
|
||||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
|
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K
|
||||||
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
|
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
|
||||||
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 128K /* note: the boardloader uses mostly CCMRAM */
|
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||||
}
|
}
|
||||||
|
|
||||||
main_stack_base = ORIGIN(CCMRAM) + LENGTH(CCMRAM); /* 8-byte aligned full descending stack */
|
main_stack_base = ORIGIN(CCMRAM) + LENGTH(CCMRAM); /* 8-byte aligned full descending stack */
|
||||||
|
|
||||||
minimum_stack_size = 4K; /* reserve a chunk for stack space */
|
|
||||||
|
|
||||||
/* used by the startup code to populate variables used by the C code */
|
/* used by the startup code to populate variables used by the C code */
|
||||||
data_lma = LOADADDR(.data);
|
data_lma = LOADADDR(.data);
|
||||||
data_vma = ADDR(.data);
|
data_vma = ADDR(.data);
|
||||||
@ -25,50 +23,32 @@ ccmram_end = ORIGIN(CCMRAM) + LENGTH(CCMRAM);
|
|||||||
sram_start = ORIGIN(SRAM);
|
sram_start = ORIGIN(SRAM);
|
||||||
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
||||||
|
|
||||||
/* alignment references refer to sections in the ARM v7-M Architecture Reference Manual */
|
|
||||||
|
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
.vector_table : ALIGN(512) { /* B1.5.3 and Table 61 of STM32F405 Reference Manual (RM0090) */
|
.vector_table : ALIGN(512) {
|
||||||
KEEP(*(.vector_table))
|
KEEP(*(.vector_table));
|
||||||
} >FLASH AT>FLASH
|
} >FLASH AT>FLASH
|
||||||
|
|
||||||
.text : ALIGN(4) { /* A3.3.1 - needs at least 2 */
|
.text : ALIGN(4) {
|
||||||
KEEP(*(.text)) /* does not match all .text*, but influences their positioning */
|
*(.text*);
|
||||||
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
|
. = ALIGN(4); /* make the section size a multiple of the word size */
|
||||||
} >FLASH AT>FLASH
|
} >FLASH AT>FLASH
|
||||||
|
|
||||||
.rodata : ALIGN(4) {
|
.rodata : ALIGN(4) {
|
||||||
KEEP(*(.rodata)) /* does not match all .rodata*, but influences their positioning */
|
*(.rodata*);
|
||||||
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
|
. = ALIGN(4); /* make the section size a multiple of the word size */
|
||||||
} >FLASH AT>FLASH
|
} >FLASH AT>FLASH
|
||||||
|
|
||||||
.data : ALIGN(4) {
|
.data : ALIGN(4) {
|
||||||
KEEP(*(.data*)) /* combine all the .data* so that the startup code can copy it in all at once */
|
*(.data*);
|
||||||
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
|
. = ALIGN(4); /* make the section size a multiple of the word size */
|
||||||
} >CCMRAM AT>FLASH
|
} >CCMRAM AT>FLASH
|
||||||
|
|
||||||
.bss : ALIGN(4) {
|
.bss : ALIGN(4) {
|
||||||
KEEP(*(.bss)) /* does not match all .bss*, but influences their positioning */
|
*(.bss*);
|
||||||
. = ALIGN(4); /* force the section to end on an word-aligned boundary */
|
. = ALIGN(4); /* make the section size a multiple of the word size */
|
||||||
} >CCMRAM
|
} >CCMRAM
|
||||||
|
|
||||||
.stack : ALIGN(8) { /* B1.5.7 */
|
.stack : ALIGN(8) {
|
||||||
. += minimum_stack_size;
|
. = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */
|
||||||
. = ALIGN(8); /* force the section to end on an double word-aligned boundary */
|
|
||||||
} >CCMRAM
|
} >CCMRAM
|
||||||
|
|
||||||
/* 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user