trezor-core/embed/bootloader/memory.ld

56 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-10-09 08:44:58 -07:00
/* TREZORv2 bootloader linker script */
2017-02-06 06:38:45 -08:00
2017-10-09 08:44:58 -07:00
ENTRY(reset_handler)
2017-02-06 06:38:45 -08:00
2017-10-09 08:44:58 -07:00
MEMORY {
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 128K
2017-10-09 08:44:58 -07:00
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
2017-10-11 14:36:07 -07:00
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K
2017-10-09 08:44:58 -07:00
}
2017-02-06 06:38:45 -08:00
2017-10-09 08:44:58 -07:00
main_stack_base = ORIGIN(CCMRAM) + LENGTH(CCMRAM); /* 8-byte aligned full descending stack */
2017-02-06 06:38:45 -08:00
2017-10-09 08:44:58 -07: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 06:38:45 -08: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 08:44:58 -07:00
sram_start = ORIGIN(SRAM);
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
_codelen = SIZEOF(.flash) + SIZEOF(.data);
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
.data : ALIGN(4) {
*(.data*);
. = ALIGN(512);
} >CCMRAM AT>FLASH
.bss : ALIGN(4) {
*(.bss*);
. = ALIGN(4);
} >CCMRAM
.stack : ALIGN(8) {
. = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */
} >CCMRAM
}