From patchwork Sun Apr 22 15:23:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 154287 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 44B71B6FC8 for ; Mon, 23 Apr 2012 01:24:28 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 066BE281B9; Sun, 22 Apr 2012 17:23:55 +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 tQvDpZgPRYFu; Sun, 22 Apr 2012 17:23:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4ADDF2819D; Sun, 22 Apr 2012 17:23:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 321B328182 for ; Sun, 22 Apr 2012 17:23:39 +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 42M1vX1UdwCy for ; Sun, 22 Apr 2012 17:23:38 +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-pz0-f49.google.com (mail-pz0-f49.google.com [209.85.210.49]) by theia.denx.de (Postfix) with ESMTPS id 52CC72812F for ; Sun, 22 Apr 2012 17:23:26 +0200 (CEST) Received: by dadq36 with SMTP id q36so14340980dad.22 for ; Sun, 22 Apr 2012 08:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=qQug9gh8AgQr931rKkHkFOSj8GEoAKoOBXAbWLP0/ns=; b=oJM/IgT6l+GRz63XKs/OLFjfJgaC9SQlnHrjYh5cbbJvy7+rz4CAMZKGksxhc0ePa0 vvuphKxEDuRP1P0lRoblibo4iinxRtNiCvK4NiFqiRf2QuWIGFXuFhIFxm18r8L5dG51 d2oDJbSpM4I1hVvoDscunVMP9gqkrEDyaj199BLwa346GGIZ8nTrY5BHLZo6RPHsSRoz fSJ4OmsQ90/sElBvWdimUAlu+sXAcOPtDLI/XrpNKO9fOnlN5Xhh+stwmOQeNanBbxYL YUYu9uA+75G9+QTqjomTx0Wq/jFYsZt5O7b2Q+QbCVF2cv8JY7YXMdjRtVP+++HrVTUa x0lQ== Received: by 10.68.234.138 with SMTP id ue10mr9248190pbc.21.1335108202035; Sun, 22 Apr 2012 08:23:22 -0700 (PDT) Received: from dingo.localhost (d110-32-170-80.sbr801.nsw.optusnet.com.au. [110.32.170.80]) by mx.google.com with ESMTPS id wn3sm11636628pbc.74.2012.04.22.08.23.20 (version=SSLv3 cipher=OTHER); Sun, 22 Apr 2012 08:23:21 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Mon, 23 Apr 2012 01:23:07 +1000 Message-Id: <1335108188-21875-3-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1335108188-21875-1-git-send-email-graeme.russ@gmail.com> References: <1335108188-21875-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 2/3] init_func: Add x86 support 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Graeme Russ --- arch/x86/cpu/u-boot.lds | 23 +++++++++++++++++++++++ arch/x86/lib/board.c | 10 +++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index fe28030..b88fd57 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -28,6 +28,27 @@ ENTRY(_start) SECTIONS { +#ifdef MAKE_INIT_LDS + .initfuncs : { KEEP(*(.initfuncs*)) } + + /DISCARD/ : { *(.text*) } + /DISCARD/ : { *(.debug*) } + /DISCARD/ : { *(.u_boot_cmd*) } + /DISCARD/ : { *(.rodata*) } + /DISCARD/ : { *(.data*) } + /DISCARD/ : { *(.dynsym*) } + /DISCARD/ : { *(.hash*) } + /DISCARD/ : { *(.bss*) } + /DISCARD/ : { *(.bss) } + /DISCARD/ : { *(.rel.dyn*) } + /DISCARD/ : { *(.rel.dyn) } + /DISCARD/ : { *(.dynstr*) } + /DISCARD/ : { *(.dynamic*) } + /DISCARD/ : { *(.plt*) } + /DISCARD/ : { *(.interp*) } + /DISCARD/ : { *(.gnu*) } + /DISCARD/ : { *(.comment*) } +#else . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */ __text_start = .; .text : { *(.text*); } @@ -72,6 +93,7 @@ SECTIONS /DISCARD/ : { *(.plt*) } /DISCARD/ : { *(.interp*) } /DISCARD/ : { *(.gnu*) } + /DISCARD/ : { *(.initfuncs*) } /* 16bit realmode trampoline code */ .realmode REALMODE_BASE : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) } @@ -94,4 +116,5 @@ SECTIONS . = RESET_VEC_LOC; .resetvec : AT (CONFIG_SYS_TEXT_BASE + (CONFIG_SYS_MONITOR_LEN - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); } +#endif } diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 5f0b62c..5789581 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -77,13 +78,7 @@ * - All remaining initialisation */ -/* - * The requirements for any new initalization function is simple: it is - * a function with no parameters which returns an integer return code, - * where 0 means "continue" and != 0 means "fatal error, hang the system" - */ -typedef int (init_fnc_t) (void); - +#ifndef CONFIG_INIT_FUNC /* * init_sequence_f is the list of init functions which are run when U-Boot * is executing from Flash with a limited 'C' environment. The following @@ -206,6 +201,7 @@ init_fnc_t *init_sequence_r[] = { #endif NULL, }; +#endif static void do_init_loop(init_fnc_t **init_fnc_ptr) {