@@ -18,6 +18,7 @@
#include <asm/blackfin.h>
#include <asm/cplb.h>
#include <asm/clock.h>
+#include <asm/sections.h>
#include <asm/mach-common/bits/core.h>
#include <asm/mach-common/bits/ebiu.h>
#include <asm/mach-common/bits/trace.h>
@@ -323,6 +324,8 @@ void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
memcpy(&_sdata_l1, &_data_l1_lma, (unsigned long)_data_l1_len);
}
+ memset(__bss_start, '\0', __bss_stop - __bss_start);
+
/*
* Make sure our async settings are committed. Some bootroms
* (like the BF537) will reset some registers on us after it
@@ -191,19 +191,6 @@ ENTRY(_start)
#endif
.Lnorelocate:
- /* Initialize BSS section ... we know that memset() does not
- * use the BSS, so it is safe to call here. The bootrom LDR
- * takes care of clearing things for us.
- */
- serial_early_puts("Zero BSS");
- r0.l = ___bss_start;
- r0.h = ___bss_start;
- r1 = 0 (x);
- r2.l = __bss_len;
- r2.h = __bss_len;
- call _memset;
-
-
/* Setup the actual stack in external memory */
sp.h = HI(CONFIG_STACKBASE);
sp.l = LO(CONFIG_STACKBASE);
We don't need to clear BSS in assembler. Move it to C to reduce the amount of assembly code needed. Signed-off-by: Simon Glass <sjg@chromium.org> --- arch/blackfin/cpu/cpu.c | 3 +++ arch/blackfin/cpu/start.S | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-)