[U-Boot] [PATCH v3 15/19] spl: Make CONFIG_SPL_FRAMEWORK board_init_f __weak

Tom Rini trini at ti.com
Thu Aug 23 01:19:41 CEST 2012


Some platforms may need to do more than simply call relocate_code prior
to board_init_r, or perhaps perform more work prior to calling
relocate_code.  Make our default weak to allow for this.  Part of this
requires us to add an extern for 'gdata' so that others can also call
relocate_code.

Signed-off-by: Tom Rini <trini at ti.com>
---

 common/spl/spl.c |    4 ++--
 include/spl.h    |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index b314ed7..d8ade27 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -40,7 +40,7 @@ u32 *boot_params_ptr = NULL;
 struct spl_image_info spl_image;
 
 /* Define global data structure pointer to it*/
-static gd_t gdata __attribute__ ((section(".data")));
+gd_t gdata __attribute__ ((section(".data")));
 static bd_t bdata __attribute__ ((section(".data")));
 
 inline void hang(void)
@@ -50,7 +50,7 @@ inline void hang(void)
 		;
 }
 
-void board_init_f(ulong dummy)
+void __weak board_init_f(ulong dummy)
 {
 	/*
 	 * We call relocate_code() with relocation target same as the
diff --git a/include/spl.h b/include/spl.h
index af9ef71..83e9f21 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -41,6 +41,7 @@ struct spl_image_info {
 
 extern struct spl_image_info spl_image;
 extern u32 *boot_params_ptr;
+extern gd_t gdata;
 
 /* SPL common functions */
 void preloader_console_init(void);
-- 
1.7.9.5



More information about the U-Boot mailing list