From a1d57b7aba85abc787675952b40c550bf3a595f8 Mon Sep 17 00:00:00 2001 From: Graeme Russ Date: Fri, 23 Dec 2011 21:14:22 +1100 Subject: x86: Convert board_init_f_r to a processing loop Create an init function array for board_init_f_r - This finalises the migration to a purely array based initialisation mechanism Also tweak a few comments while we are at it so everything is 'correct' -- Changes for v2: - Renamed to a more apt name - Fix bug in set_reloc_flag_r - Re-instate gd->flags = boot_flags; in board_init_f - Added commit message --- arch/x86/lib/relocate.c | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'arch/x86/lib/relocate.c') diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index badb5f84f1..200baaba6a 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -34,13 +34,10 @@ #include #include #include +#include #include -static int copy_uboot_to_ram(void); -static int clear_bss(void); -static int do_elf_reloc_fixups(void); - -static int copy_uboot_to_ram(void) +int copy_uboot_to_ram(void) { size_t len = (size_t)&__data_end - (size_t)&__text_start; @@ -49,7 +46,7 @@ static int copy_uboot_to_ram(void) return 0; } -static int clear_bss(void) +int clear_bss(void) { ulong dst_addr = (ulong)&__bss_start + gd->reloc_off; size_t len = (size_t)&__bss_end - (size_t)&__bss_start; @@ -59,7 +56,7 @@ static int clear_bss(void) return 0; } -static int do_elf_reloc_fixups(void) +int do_elf_reloc_fixups(void) { Elf32_Rel *re_src = (Elf32_Rel *)(&__rel_dyn_start); Elf32_Rel *re_end = (Elf32_Rel *)(&__rel_dyn_end); @@ -92,24 +89,3 @@ static int do_elf_reloc_fixups(void) return 0; } - -void relocate_code(ulong dummy_1, gd_t *id, ulong dummy_2) -{ - /* - * Copy U-Boot into RAM, clear the BSS and perform relocation - * adjustments - */ - copy_uboot_to_ram(); - clear_bss(); - do_elf_reloc_fixups(); - - /* - * Transfer execution from Flash to RAM by calculating the address - * of the in-RAM copy of board_init_r() and calling it - */ - (board_init_r + gd->reloc_off)(gd, gd->relocaddr); - - /* NOTREACHED - board_init_r() does not return */ - while (1) - ; -} -- cgit v1.2.1