diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index 1f8eed8..f20ce74 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -48,6 +48,12 @@ "1: bne 1b\n" /* irq (interrupt) */ "1: bne 1b\n" /* fiq (fast interrupt) */ #endif + ".word 0x65726162\n" /* 'bare' */ + ".word 0x00786f62\n" /* 'box' */ + ".word _text\n" /* text base. If copied there, + * barebox can skip relocation + */ + ".word _barebox_image_size\n" /* image size to copy */ ); } diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S index 7683f73..81a9123 100644 --- a/arch/arm/lib/barebox.lds.S +++ b/arch/arm/lib/barebox.lds.S @@ -93,4 +93,5 @@ .bss : { *(.bss*) } __bss_stop = .; _end = .; + _barebox_image_size = __bss_start - _text; } diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index c5d60a9..1f48fb8 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -4,5 +4,8 @@ extern char _text[], _stext[], _etext[]; extern char __bss_start[], __bss_stop[]; extern char _end[]; +extern void *_barebox_image_size; + +#define barebox_image_size (unsigned int)&_barebox_image_size #endif /* _ASM_GENERIC_SECTIONS_H_ */