From patchwork Thu Dec 1 08:27:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Riesch X-Patchwork-Id: 128664 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 698991007D1 for ; Thu, 1 Dec 2011 19:27:37 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 906C428091; Thu, 1 Dec 2011 09:27:34 +0100 (CET) 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 vkoSXVekyV9y; Thu, 1 Dec 2011 09:27:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 036A228094; Thu, 1 Dec 2011 09:27:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 90E2F28094 for ; Thu, 1 Dec 2011 09:27:30 +0100 (CET) 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 FlFhhuWMAagZ for ; Thu, 1 Dec 2011 09:27:29 +0100 (CET) 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 ns.omicron.at (ns.omicron.at [212.183.10.25]) by theia.denx.de (Postfix) with ESMTPS id E224F28091 for ; Thu, 1 Dec 2011 09:27:27 +0100 (CET) Received: from counter.omicron.at ([212.183.10.29]) by ns.omicron.at (8.13.1/8.13.1) with ESMTP id pB18RFDq025953; Thu, 1 Dec 2011 09:27:20 +0100 Received: from mary.at.omicron.at (mary.at.omicron.at [172.22.100.48]) by counter.omicron.at (8.14.4/8.14.4) with ESMTP id pB18RFLC025361; Thu, 1 Dec 2011 09:27:15 +0100 Received: from localhost.localdomain (172.22.1.62) by mary-special.at.omicron.at (172.22.100.48) with Microsoft SMTP Server id 8.3.192.1; Thu, 1 Dec 2011 09:27:11 +0100 From: Christian Riesch To: Date: Thu, 1 Dec 2011 09:27:37 +0100 Message-ID: <1322728057-7662-1-git-send-email-christian.riesch@omicron.at> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Cc: Christian Riesch Subject: [U-Boot] [PATCH v6] arm, arm926ejs: Fix clear bss loop for zero length bss 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 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 --- Hi, this is v6 of a patch out of my recent patchset [PATCH v3 00/15] Add an SPL to boot the da850evm from SPI http://lists.denx.de/pipermail/u-boot/2011-November/111182.html Changes for v6: - replace beq clbss_e to allow for cases where r1-r0 is not a multiple of 4, as suggested by Albert Aribaud. Changes for v5: - correct subject line Changes for v4: - split the patchset since it is getting quite big Regards, Christian arch/arm/cpu/arm926ejs/start.S | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S index 8b5355b..6a09c02 100644 --- a/arch/arm/cpu/arm926ejs/start.S +++ b/arch/arm/cpu/arm926ejs/start.S @@ -299,10 +299,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: #ifndef CONFIG_SPL_BUILD bl coloured_LED_init