diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2011-12-23 21:14:22 +1100 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2012-01-04 22:53:14 +1100 |
commit | a1d57b7aba85abc787675952b40c550bf3a595f8 (patch) | |
tree | 22c6d8302e518c516ca4655cbcf03f36d5c9a453 /arch/x86/lib/relocate.c | |
parent | d47ab0ecde1c9a66acbaf421ddd92c888d2ef344 (diff) | |
download | u-boot-imx-a1d57b7aba85abc787675952b40c550bf3a595f8.zip u-boot-imx-a1d57b7aba85abc787675952b40c550bf3a595f8.tar.gz u-boot-imx-a1d57b7aba85abc787675952b40c550bf3a595f8.tar.bz2 |
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
Diffstat (limited to 'arch/x86/lib/relocate.c')
-rw-r--r-- | arch/x86/lib/relocate.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index badb5f8..200baab 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -34,13 +34,10 @@ #include <common.h> #include <malloc.h> #include <asm/u-boot-x86.h> +#include <asm/relocate.h> #include <elf.h> -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) - ; -} |