From c876d3bbefe0dc00c27ca0c12d29da5874946962 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 15 Dec 2021 21:04:28 +0100 Subject: rbutil: Merge rbutil with utils folder. rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21 --- utils/mks5lboot/dualboot/dualboot.lds | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 utils/mks5lboot/dualboot/dualboot.lds (limited to 'utils/mks5lboot/dualboot/dualboot.lds') diff --git a/utils/mks5lboot/dualboot/dualboot.lds b/utils/mks5lboot/dualboot/dualboot.lds new file mode 100644 index 0000000000..cb92e2a286 --- /dev/null +++ b/utils/mks5lboot/dualboot/dualboot.lds @@ -0,0 +1,59 @@ +#define ASM +#include "config.h" +#include "cpu.h" +#include "mks5lboot.h" + +ENTRY(_start) +OUTPUT_FORMAT(elf32-littlearm) +OUTPUT_ARCH(arm) + +#define BIN_ORIG DFU_LOADADDR + BIN_OFFSET +#define BIN_SIZE MAX_PAYLOAD + +MEMORY +{ + IRAM : ORIGIN = BIN_ORIG, LENGTH = BIN_SIZE +} + +SECTIONS +{ + .text : { + *(.init.text*) + *(.text*) + *(.icode*) + . = ALIGN(4); + } > IRAM + + /* include initialized BSS (if any) into DFU image */ + .bss : { + *(.bss*) + *(.ibss*) + *(COMMON) + . = ALIGN(4); + } > IRAM + +#if 1 + /* reuse pwnage as stack, 0x30c bytes available */ + _exception_stack = BIN_ORIG; + _supervisor_stack = _exception_stack; +#else + /* include stack into DFU image */ + .stack : { + . += 0x400; + _supervisor_stack = .; + . += 0x200; + _exception_stack = .; + } > IRAM +#endif + + .data : { + *(.data*) + *(.rodata*) + *(.idata*) + *(.irodata*) + /* place bootloader IM3 header at the end, mkdfu + will concatenate the bootloader binary here */ + . = ALIGN(16); + *(.im3info.data*) + } > IRAM +} -- cgit v1.2.3