X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=arch%2Fx86%2Flib%2Finit_helpers.c;h=d10a846cfdcb73be337638b5384205cc1c1948e2;hb=8313315b9ab3a130784a2a7d0c4f329808690c0b;hp=547b1805922e1420f20242b27b3b741d8fbae13a;hpb=d47ab0ecde1c9a66acbaf421ddd92c888d2ef344;p=platform%2Fkernel%2Fu-boot.git diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 547b180..d10a846 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include #include @@ -70,6 +72,45 @@ int init_baudrate_f(void) return 0; } +int calculate_relocation_address(void) +{ + ulong text_start = (ulong)&__text_start; + ulong bss_end = (ulong)&__bss_end; + ulong dest_addr; + + /* + * NOTE: All destination address are rounded down to 16-byte + * boundary to satisfy various worst-case alignment + * requirements + */ + + /* Stack is at top of available memory */ + dest_addr = gd->ram_size; + gd->start_addr_sp = dest_addr; + + /* U-Boot is below the stack */ + dest_addr -= CONFIG_SYS_STACK_SIZE; + dest_addr -= (bss_end - text_start); + dest_addr &= ~15; + gd->relocaddr = dest_addr; + gd->reloc_off = (dest_addr - text_start); + + return 0; +} + +int init_cache_f_r(void) +{ + /* Initialise the CPU cache(s) */ + return init_cache(); +} + +int set_reloc_flag_r(void) +{ + gd->flags = GD_FLG_RELOC; + + return 0; +} + int mem_malloc_init_r(void) { mem_malloc_init(((gd->relocaddr - CONFIG_SYS_MALLOC_LEN)+3)&~3, @@ -104,14 +145,6 @@ int flash_init_r(void) } #endif -int init_ip_address_r(void) -{ - /* IP Address */ - bd_data.bi_ip_addr = getenv_IPaddr("ipaddr"); - - return 0; -} - #ifdef CONFIG_STATUS_LED int status_led_set_r(void) { @@ -121,22 +154,18 @@ int status_led_set_r(void) } #endif -int set_bootfile_r(void) +int set_load_addr_r(void) { - char *s; - - s = getenv("bootfile"); - - if (s != NULL) - copy_filename(BootFile, s, sizeof(BootFile)); + /* Initialize from environment */ + load_addr = getenv_ulong("loadaddr", 16, load_addr); return 0; } -int set_load_addr_r(void) +int init_func_spi(void) { - /* Initialize from environment */ - load_addr = getenv_ulong("loadaddr", 16, load_addr); - + puts("SPI: "); + spi_init(); + puts("ready\n"); return 0; }