From 9e0cfa678382b607664300dc1c714c48c4e4ea50 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 19 Mar 2021 14:17:06 +0100 Subject: [PATCH] fix(core): we don't need separate linker script for zkp --- core/SConscript.firmware | 2 +- core/embed/firmware/memory_T_zkp.ld | 80 ----------------------------- 2 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 core/embed/firmware/memory_T_zkp.ld diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 8f456e4038..89fb16ac26 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -418,7 +418,7 @@ if TREZOR_MODEL == 'T': CPU_ASFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16' CPU_CCFLAGS = '-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 ' CPU_MODEL = 'STM32F427xx' - LD_VARIANT = '_zkp' if FEATURE_FLAGS["SECP256K1_ZKP"] else '' + LD_VARIANT = '' RUST_TARGET = 'thumbv7em-none-eabihf' elif TREZOR_MODEL == '1': CPU_ASFLAGS = '-mthumb -mcpu=cortex-m3 -mfloat-abi=soft' diff --git a/core/embed/firmware/memory_T_zkp.ld b/core/embed/firmware/memory_T_zkp.ld deleted file mode 100644 index 7ca3c0ddcd..0000000000 --- a/core/embed/firmware/memory_T_zkp.ld +++ /dev/null @@ -1,80 +0,0 @@ -/* TREZORv2 firmware linker script */ - -ENTRY(reset_handler) - -MEMORY { - FLASH (rx) : ORIGIN = 0x08040000, LENGTH = 768K - FLASH2 (r) : ORIGIN = 0x08120000, LENGTH = 896K - CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K - SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K -} - -main_stack_base = ORIGIN(SRAM) + LENGTH(SRAM); /* 8-byte aligned full descending stack */ -_estack = main_stack_base; - -/* 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); - -/* 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 */ -sram_start = ORIGIN(SRAM); -sram_end = ORIGIN(SRAM) + LENGTH(SRAM); -_ram_start = sram_start; -_ram_end = sram_end; - -_codelen = LENGTH(FLASH) - SIZEOF(.vendorheader) - SIZEOF(.header) + SIZEOF(.flash2); -_flash_start = ORIGIN(FLASH); -_flash_end = ORIGIN(FLASH) + LENGTH(FLASH); -_heap_start = ADDR(.heap); -_heap_end = ADDR(.heap) + SIZEOF(.heap); - -SECTIONS { - .vendorheader : ALIGN(4) { - KEEP(*(.vendorheader)) - } >FLASH AT>FLASH - - .header : ALIGN(4) { - KEEP(*(.header)); - } >FLASH AT>FLASH - - .flash2 : ALIGN(512) { - build/firmware/frozen_mpy.o(.rodata*); - build/firmware/vendor/secp256k1-zkp/src/secp256k1.o(.rodata*); - . = ALIGN(512); - } >FLASH2 AT>FLASH2 - - .flash : ALIGN(512) { - KEEP(*(.vector_table)); - . = ALIGN(4); - *(.text*); - . = ALIGN(4); - *(.rodata*); - . = ALIGN(4); - *(.bootloader*); - . = 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 -}