diff options
author | Przemyslaw Marczak <p.marczak@samsung.com> | 2015-03-04 14:01:22 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-03-09 11:13:28 -0400 |
commit | 114c86d82654801fb77c5b2522739559a09997d3 (patch) | |
tree | 0ef926e4e8172d0454ae6bb914e4733ea5bdac54 /arch/arm | |
parent | 929d9a29e14cbfd890502e6d06b33d37172cacf4 (diff) | |
download | u-boot-imx-114c86d82654801fb77c5b2522739559a09997d3.zip u-boot-imx-114c86d82654801fb77c5b2522739559a09997d3.tar.gz u-boot-imx-114c86d82654801fb77c5b2522739559a09997d3.tar.bz2 |
arm: relocation: clear .bss section with arch memset if defined
For ARM architecture, enable the CONFIG_USE_ARCH_MEMSET/MEMCPY,
will highly increase the memset/memcpy performance. This is able
thanks to the ARM multiple register instructions.
Unfortunatelly the relocation is done without the cache enabled,
so it takes some time, but zeroing the BSS memory takes much more
longer, especially for the configs with big static buffers.
A quick test confirms, that the boot time improvement after using
the arch memcpy for relocation has no significant meaning.
The same test confirms that enable the memset for zeroing BSS,
reduces the boot time.
So this patch enables the arch memset for zeroing the BSS after
the relocation process. For ARM boards, this can be enabled
in board configs by defining: 'CONFIG_USE_ARCH_MEMSET'.
This was tested on Trats2.
A quick test with trace. Boot time from start to main_loop() entry:
- ~1384ms - before this change
- ~888ms - after this change
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/lib/crt0.S | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 7939ced..92d3732 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -122,14 +122,22 @@ here: movne sp, r0 # endif ldr r0, =__bss_start /* this is auto-relocated! */ - ldr r1, =__bss_end /* this is auto-relocated! */ +#ifdef CONFIG_USE_ARCH_MEMSET + ldr r3, =__bss_end /* this is auto-relocated! */ + mov r1, #0x00000000 /* prepare zero to clear BSS */ + + subs r2, r3, r0 /* r2 = memset len */ + bl memset +#else + ldr r1, =__bss_end /* this is auto-relocated! */ mov r2, #0x00000000 /* prepare zero to clear BSS */ clbss_l:cmp r0, r1 /* while not at end of BSS */ strlo r2, [r0] /* clear 32-bit BSS word */ addlo r0, r0, #4 /* move to next */ blo clbss_l +#endif #if ! defined(CONFIG_SPL_BUILD) bl coloured_LED_init |