From b3abcb807b7f6202158a47668af7f2505b6dd25e Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Mon, 20 Jan 2014 10:42:02 +0100 Subject: rombox: Do not copy .init section to ram on startup. This is pointless to copy this code as it can be run in-place. Change-Id: I73b4f4a3337a88434af457c3f1e40b8d55a5a79e --- firmware/rom.lds | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'firmware/rom.lds') diff --git a/firmware/rom.lds b/firmware/rom.lds index 7770ce9e5e..c959bf272d 100644 --- a/firmware/rom.lds +++ b/firmware/rom.lds @@ -56,18 +56,11 @@ STARTUP(crt0.o) #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) #define CODECORIG ENDAUDIOADDR -/* .init is copied to codec buffer */ -#define INITORIG CODECORIG -#define INITSIZE CODECSIZE - MEMORY { DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE -#ifdef HAVE_INIT_ATTR - INIT : ORIGIN = INITORIG, LENGTH = INITSIZE -#endif } SECTIONS @@ -93,6 +86,9 @@ SECTIONS KEEP(*(.resetvectors)); KEEP(*(.vectors)); . = ALIGN(0x200); +#ifdef HAVE_INIT_ATTR + *(.initdata*) +#endif *(.data*) . = ALIGN(0x4); _dataend = .; @@ -111,6 +107,14 @@ SECTIONS { *(.init.text) KEEP(*(.startup*)); +#ifdef HAVE_INIT_ATTR + /* all this symbols are set to the same address so .init copy loop + will be skiped in crt0.S */ + _initstart = .; + _initend = .; + _initcopy = .; + *(.init*) +#endif *(.text*) . = ALIGN(0x4); } > FLASH @@ -133,17 +137,6 @@ SECTIONS _iramend = .; } > IRAM -#ifdef HAVE_INIT_ATTR - .init INITORIG : AT ( _iramcopy + SIZEOF(.iram) ) - { - _initstart = .; - *(.init*) - *(.initdata*) - _initend = .; - } > INIT - _initcopy = LOADADDR(.init); -#endif - .ibss (NOLOAD) : { _iedata = .; -- cgit v1.2.3