i386: Final Relocation

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
This commit is contained in:
Graeme Russ
2009-11-24 20:04:21 +11:00
committed by Wolfgang Denk
parent cabe579480
commit 1c409bc710
11 changed files with 159 additions and 213 deletions

View File

@@ -23,4 +23,6 @@
TEXT_BASE = 0x38040000
CFLAGS_dlmalloc.o += -Wa,--no-warn -fno-strict-aliasing
PLATFORM_RELFLAGS += -fvisibility=hidden
PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
PLATFORM_LDFLAGS += -pic --emit-relocs -Bsymbolic -Bsymbolic-functions

View File

@@ -47,7 +47,6 @@ void init_sc520_enet (void)
{
/* Set CPU Speed to 100MHz */
sc520_mmcr->cpuctl = 0x01;
gd->cpu_clk = 100000000;
/* wait at least one millisecond */
asm("movl $0x2000,%%ecx\n"
@@ -67,7 +66,7 @@ void init_sc520_enet (void)
/*
* Miscellaneous platform dependent initializations
*/
int board_init(void)
int board_early_init_f(void)
{
init_sc520_enet();
@@ -117,6 +116,14 @@ int board_init(void)
sc520_mmcr->sysarbctl = 0x06;
sc520_mmcr->sysarbmenb = 0x0003;
return 0;
}
int board_early_init_r(void)
{
/* CPU Speed to 100MHz */
gd->cpu_clk = 100000000;
/* Crystal is 33.000MHz */
gd->bus_clk = 33000000;

View File

@@ -28,28 +28,48 @@ ENTRY(_start)
SECTIONS
{
. = 0x38040000; /* Location of bootcode in flash */
_i386boot_text_start = .;
.text : { *(.text); }
. = ALIGN(4);
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
_i386boot_text_size = SIZEOF(.text) + SIZEOF(.rodata);
. = 0x03FF0000; /* Ram data segment to use */
_i386boot_romdata_dest = ABSOLUTE(.);
.data : AT ( LOADADDR(.rodata) + SIZEOF(.rodata) ) { *(.data) }
_i386boot_romdata_start = LOADADDR(.data);
. = ALIGN(4);
.got : AT ( LOADADDR(.data) + SIZEOF(.data) ) { *(.got) }
.data : { *(.data) }
. = ALIGN(4);
.interp : { *(.interp) }
. = ALIGN(4);
.dynsym : { *(.dynsym) }
. = ALIGN(4);
.dynstr : { *(.dynstr) }
. = ALIGN(4);
.hash : { *(.hash) }
. = ALIGN(4);
.got : { *(.got) }
. = ALIGN(4);
.got.plt : { *(.got.plt) }
. = ALIGN(4);
.dynamic (NOLOAD) : { *(.dynamic) }
. = ALIGN(4);
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
. = ALIGN(4);
__u_boot_cmd_end = .;
_i386boot_cmd_start = LOADADDR(.u_boot_cmd);
_i386boot_romdata_size = SIZEOF(.data) + SIZEOF(.got) + SIZEOF(.u_boot_cmd);
_i386boot_rel_dyn_start = .;
.rel.dyn : { *(.rel.dyn) }
_i386boot_rel_dyn_end = .;
. = ALIGN(4);
_i386boot_bss_start = ABSOLUTE(.);
@@ -57,7 +77,7 @@ SECTIONS
_i386boot_bss_size = SIZEOF(.bss);
/* 16bit realmode trampoline code */
.realmode 0x7c0 : AT ( LOADADDR(.got) + SIZEOF(.got) + SIZEOF(.u_boot_cmd)) { *(.realmode) }
.realmode 0x7c0 : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { *(.realmode) }
_i386boot_realmode = LOADADDR(.realmode);
_i386boot_realmode_size = SIZEOF(.realmode);