All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] init_func: Add x86 support
Date: Mon, 23 Apr 2012 01:23:07 +1000	[thread overview]
Message-ID: <1335108188-21875-3-git-send-email-graeme.russ@gmail.com> (raw)
In-Reply-To: <1335108188-21875-1-git-send-email-graeme.russ@gmail.com>


Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
---
 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 <common.h>
+#include <init_func.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
 #include <asm/u-boot-x86.h>
@@ -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)
 {
-- 
1.7.7.6

  parent reply	other threads:[~2012-04-22 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22 15:23 [U-Boot] [PATCH 0/3] Initialisation Sequence Framework Graeme Russ
2012-04-22 15:23 ` [U-Boot] [PATCH 1/3] init_func: Add fundamental framework Graeme Russ
2012-05-03  0:08   ` Marek Vasut
2012-05-03  3:06     ` Graeme Russ
2012-05-03  3:18       ` Marek Vasut
2012-05-03  4:12         ` Graeme Russ
2012-05-03 14:38           ` Marek Vasut
2012-04-22 15:23 ` Graeme Russ [this message]
2012-04-22 15:23 ` [U-Boot] [PATCH 3/3] init_func: Use for eNET board Graeme Russ
2012-05-02 23:50 ` [U-Boot] [PATCH 0/3] Initialisation Sequence Framework Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335108188-21875-3-git-send-email-graeme.russ@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.