From patchwork Tue Nov 30 19:11:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 73641 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 653AB1007D1 for ; Wed, 1 Dec 2010 06:11:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A26528173; Tue, 30 Nov 2010 20:11:52 +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 3RthiCpet2uf; Tue, 30 Nov 2010 20:11:52 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 22C642817A; Tue, 30 Nov 2010 20:11:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0A1662817A for ; Tue, 30 Nov 2010 20:11:50 +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 juUoJFBqnwuW for ; Tue, 30 Nov 2010 20:11:48 +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 gate.crashing.org (gate.crashing.org [63.228.1.57]) by theia.denx.de (Postfix) with ESMTPS id 076EB28173 for ; Tue, 30 Nov 2010 20:11:46 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id oAUJBgEK017285 for ; Tue, 30 Nov 2010 13:11:43 -0600 From: Kumar Gala To: u-boot@lists.denx.de Date: Tue, 30 Nov 2010 13:11:41 -0600 Message-Id: <1291144301-19594-1-git-send-email-galak@kernel.crashing.org> X-Mailer: git-send-email 1.6.0.6 Subject: [U-Boot] [PATCH v2] hwconfig: Fix dummy initialization of {board, cpu}_hwconfig 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 Since board_hwconfig & cpu_hwconfig are defined as weak and dont have a default value they will get put into the BSS if they aren't defined elsewhere. This is problematic as we try to utilize hwconfig before we've relocated and thus BSS isn't setup. Instead of giving dummy values in the board files that utilize this feature, we can just initialize the variables to an empty string and thus move them out of the BSS if they aren't defined elsewhere. Also made board_hwconfig & cpu_hwconfig arrays to reduce size associated with string pointers vs arrays. Signed-off-by: Kumar Gala --- * Incorporate Jocke about use of arrays vs pointers board/freescale/mpc8641hpcn/mpc8641hpcn.c | 3 --- board/freescale/p2020ds/p2020ds.c | 3 --- common/hwconfig.c | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 812111d..882ff0b 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -60,9 +60,6 @@ int checkboard(void) return 0; } -const char *board_hwconfig = "foo:bar=baz"; -const char *cpu_hwconfig = "foo:bar=baz"; - phys_size_t initdram(int board_type) { diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index b507677..b05ef98 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -69,9 +69,6 @@ int checkboard(void) return 0; } -const char *board_hwconfig = "foo:bar=baz"; -const char *cpu_hwconfig = "foo:bar=baz"; - phys_size_t initdram(int board_type) { phys_size_t dram_size = 0; diff --git a/common/hwconfig.c b/common/hwconfig.c index 3c9759f..752bfc3 100644 --- a/common/hwconfig.c +++ b/common/hwconfig.c @@ -68,8 +68,8 @@ next: return NULL; } -const char *cpu_hwconfig __attribute__((weak)); -const char *board_hwconfig __attribute__((weak)); +const char cpu_hwconfig[] __attribute__((weak)) = ""; +const char board_hwconfig[] __attribute__((weak)) = ""; #define HWCONFIG_PRE_RELOC_BUF_SIZE 128