From: Simon Glass Date: Wed, 14 Dec 2016 20:27:37 -0700 Subject: [U-Boot] [PATCH 06/29] blackfin: Clear the BSS in C code In-Reply-To: <1481772480-29544-1-git-send-email-sjg@chromium.org> References: <1481772480-29544-1-git-send-email-sjg@chromium.org> Message-ID: <1481772480-29544-7-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- arch/blackfin/cpu/cpu.c | 3 +++ arch/blackfin/cpu/start.S | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/arch/blackfin/cpu/cpu.c b/arch/blackfin/cpu/cpu.c index 529322a..ef362d4 100644 --- a/arch/blackfin/cpu/cpu.c +++ b/arch/blackfin/cpu/cpu.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -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 diff --git a/arch/blackfin/cpu/start.S b/arch/blackfin/cpu/start.S index 6265a51..01985ea 100644 --- a/arch/blackfin/cpu/start.S +++ b/arch/blackfin/cpu/start.S @@ -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); -- 2.8.0.rc3.226.g39d4020