From patchwork Fri Jul 6 11:30:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: seedshope X-Patchwork-Id: 169449 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E7D442C0082 for ; Fri, 6 Jul 2012 21:30:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2170A28093; Fri, 6 Jul 2012 13:30:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9lWnblA8kPi4; Fri, 6 Jul 2012 13:30:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 538B028097; Fri, 6 Jul 2012 13:30:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 181D828097 for ; Fri, 6 Jul 2012 13:30:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O17JihLedNcD for ; Fri, 6 Jul 2012 13:30:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 1105D28093 for ; Fri, 6 Jul 2012 13:30:35 +0200 (CEST) Received: by pbcwy7 with SMTP id wy7so13412909pbc.3 for ; Fri, 06 Jul 2012 04:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vErxWxZSPIoWZlfZAhRiZFuu0wuNTuCDtfy8gWR1ioA=; b=oJJ7kijrYEzWqG8K+mbf/DysNE1yp3/cJxTOA/SN/UuQdhAxi3ncB5Xiwn6bYTpIYW iJ2hXP7A3k1R7+dtSjzbdlZaDVtSGTLHuT9flGYc1IFCnUDElJPvc9DA36vD0A2hnJz3 S+mlkjKd+r7UUOWZc1rCOqzdS/rd5M694098iLwz6xRdrQaAV8fxkVYS4aV5oPBBwAFg r1QqBVirgV8uMjLe8jNmg9jRXTuU5jKSEZN2SWgLa3R5b0JZNkI5vuI4uJ5/ieGp9O34 2EF9nw9eFfWSfFIQQq9rNbvkkjPeU1xjrkhdfiZmPPsQ+c29Q8m9NzM3lgLRvcxgeSED xjRw== Received: by 10.68.232.197 with SMTP id tq5mr36079466pbc.53.1341574233766; Fri, 06 Jul 2012 04:30:33 -0700 (PDT) Received: from [192.168.1.102] ([221.221.18.144]) by mx.google.com with ESMTPS id ob9sm21730784pbb.28.2012.07.06.04.30.30 (version=SSLv3 cipher=OTHER); Fri, 06 Jul 2012 04:30:32 -0700 (PDT) Message-ID: <4FF6CC49.8@gmail.com> Date: Fri, 06 Jul 2012 19:30:17 +0800 From: Zhong Hongbo User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: =?UTF-8?B?QW5kcmVhcyBCaWXDn21hbm4=?= References: <1341498915-19127-1-git-send-email-bocui107@gmail.com> <4FF5B50A.9010500@gmail.com> In-Reply-To: <4FF5B50A.9010500@gmail.com> Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] armv7: Fix to mistake clean the memory space X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hi Andreas, On 07/05/2012 11:38 PM, Andreas Bießmann wrote: > Dear Zhong Hongbo, > > this is arm related and should therefore apply to all the different > arch/arm/cpu/*/start.S (as long as they have SPL support). Ok, I will do it. Thanks for your advise. > > On 05.07.2012 16:35, Zhong Hongbo wrote: >> From: Zhong Hongbo >> >> In currently, when __bss_start is equal to __bss_end__, >> The bss loop will clear all the things in memory space. > > I ask myself why there is no bss at all. Have you just initialized data > in your spl code? Yes > >> >> But just only when __bss_end__ greater than __bss_start__, >> we do the clear bss section operation. >> >> Signed-off-by: Hongbo Zhong >> --- >> arch/arm/cpu/armv7/start.S | 9 ++++++--- >> 1 files changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S >> index 22a3ced..2e583ee 100644 >> --- a/arch/arm/cpu/armv7/start.S >> +++ b/arch/arm/cpu/armv7/start.S >> @@ -259,10 +259,13 @@ clear_bss: >> #endif >> mov r2, #0x00000000 /* clear */ >> >> -clbss_l:str r2, [r0] /* clear loop... */ >> +clbss_l: >> + cmp r1, r0 >> + bls clbss_end >> + str r2, [r0] /* clear loop... */ >> add r0, r0, #4 >> - cmp r0, r1 >> - bne clbss_l >> + b clbss_l >> +clbss_end: > > Looks sane, I maybe had checked before clbss_l, jumped over clear loop > if r0 and r1 equal (to emphasize the fact that this is a check for entry > correctness) and wouldn't change the loop at all. To be more precise we > could also check if end is after start. I check the starts of arm92ejs, I found the issue display in other arm platform. As following: commit 8f1da53508c78789ebeea98a92a3f55c3f84dc5d Author: Christian Riesch Date: Wed Nov 30 22:27:37 2011 +0000 arm, arm926ejs: Fix clear bss loop for zero length bss This patch fixes the clear bss loop for bss sections that have zero length, i.e., where __bss_start == __bss_end__. Signed-off-by: Christian Riesch Cc: Albert Aribaud Thanks, hongbo > >> >> /* >> * We are done. Do not return, instead branch to second part of board >> > > Best regards > > Andreas Bießmann > diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S index 339c5ed..bb4d00b 100644 --- a/arch/arm/cpu/arm926ejs/start.S +++ b/arch/arm/cpu/arm926ejs/start.S @@ -301,10 +301,12 @@ clear_bss: #endif mov r2, #0x00000000 /* clear */ -clbss_l:str r2, [r0] /* clear loop... */ +clbss_l:cmp r0, r1 /* clear loop... */ + bhs clbss_e /* if reached end of bss, exit */ + str r2, [r0] add r0, r0, #4 - cmp r0, r1 - bne clbss_l + b clbss_l +clbss_e: