From patchwork Sun Apr 3 08:58:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 89485 X-Patchwork-Delegate: wd@denx.de 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 E8712B6F8D for ; Sun, 3 Apr 2011 19:01:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F1382811C; Sun, 3 Apr 2011 11:00:40 +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 SyggtNdooo-4; Sun, 3 Apr 2011 11:00:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58BBB2810D; Sun, 3 Apr 2011 10:59:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4045F2809D for ; Sun, 3 Apr 2011 10:59:24 +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 5xv1mLzMBvdm for ; Sun, 3 Apr 2011 10:59:23 +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 smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by theia.denx.de (Postfix) with ESMTPS id 0100A280A6 for ; Sun, 3 Apr 2011 10:58:52 +0200 (CEST) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8C8351B4027 for ; Sun, 3 Apr 2011 08:58:50 +0000 (UTC) From: Mike Frysinger To: u-boot@lists.denx.de Date: Sun, 3 Apr 2011 04:58:21 -0400 Message-Id: <1301821121-26743-15-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301821121-26743-1-git-send-email-vapier@gentoo.org> References: <1301821121-26743-1-git-send-email-vapier@gentoo.org> Subject: [U-Boot] [PATCH 14/34] Blackfin: fix bd_t handling X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The recent global data changes (making the size autogenerated) broke the board info handling on Blackfin ports as we were lying and lumping the bd_t size in with the gd_t size. So use the new dedicated bd_t size to setup its own address in memory. Signed-off-by: Mike Frysinger --- arch/blackfin/include/asm/config.h | 5 ++++- arch/blackfin/lib/board.c | 10 ++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/blackfin/include/asm/config.h b/arch/blackfin/include/asm/config.h index f0f3a39..89814cd 100644 --- a/arch/blackfin/include/asm/config.h +++ b/arch/blackfin/include/asm/config.h @@ -109,8 +109,11 @@ #ifndef CONFIG_SYS_GBL_DATA_ADDR # define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE) #endif +#ifndef CONFIG_SYS_BD_INFO_ADDR +# define CONFIG_SYS_BD_INFO_ADDR (CONFIG_SYS_GBL_DATA_ADDR - GENERATED_BD_INFO_SIZE) +#endif #ifndef CONFIG_STACKBASE -# define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4) +# define CONFIG_STACKBASE (CONFIG_SYS_BD_INFO_ADDR - 4) #endif #ifndef CONFIG_SYS_MEMTEST_START # define CONFIG_SYS_MEMTEST_START 0 diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 2b1f78c..47d487f 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -207,7 +207,6 @@ extern int timer_init(void); void board_init_f(ulong bootflag) { - ulong addr; bd_t *bd; char buf[32]; @@ -244,14 +243,9 @@ void board_init_f(ulong bootflag) gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR); memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE); - /* Board data initialization */ - addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t)); - - /* Align to 4 byte boundary */ - addr &= ~(4 - 1); - bd = (bd_t *) addr; + bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR); gd->bd = bd; - memset((void *)bd, 0, sizeof(bd_t)); + memset((void *)bd, 0, GENERATED_BD_INFO_SIZE); bd->bi_r_version = version_string; bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);