[U-Boot] [PATCH v2 02/10] sparc: Add function to fixup command tables
Francois Retief
fgretief at spaceteq.co.za
Wed Nov 5 13:08:15 CET 2014
Add a function to fixup the command tables to board_init_r.c file when
the CONFIG_NEEDS_MANUAL_RELOC variable has been defined. This is used
by the SPARC, AVR32, NDS32 and M68K architectures.
Signed-off-by: Francois Retief <fgretief at spaceteq.co.za>
---
Changes in v2:
- Add patch to relocate the command tables
common/board_r.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/common/board_r.c b/common/board_r.c
index 6d6c7e8..04d2e61 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -569,6 +569,16 @@ static int initr_status_led(void)
}
#endif
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+static int initr_cmdtable_reloc(void)
+{
+ /* We have to relocate the command table manually */
+ fixup_cmdtable( ll_entry_start(cmd_tbl_t, cmd),
+ ll_entry_count(cmd_tbl_t, cmd) );
+ return 0;
+}
+#endif
+
#if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
extern int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]);
@@ -872,6 +882,9 @@ init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_BOARD_LATE_INIT
board_late_init,
#endif
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+ initr_cmdtable_reloc,
+#endif
#if defined(CONFIG_CMD_AMBAPP)
ambapp_init_reloc,
#if defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
--
1.9.3
________________________________
Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za <http://www.spaceteq.co.za/home/emaildisclaimer/>
More information about the U-Boot
mailing list