X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fboard_f.c;h=7d1ede0404df64673f85c9f674b04dde727ec3c0;hb=02ccab1908c405fe1449457d4a0d343784a30acb;hp=9ef998f9ed239337f542f9f875e826e4050a270e;hpb=19d051a2b78b626ea3f8103a9a08e73508ba9fa6;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/board_f.c b/common/board_f.c index 9ef998f..7d1ede0 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #if defined(CONFIG_X86) || defined(CONFIG_ARC) @@ -276,7 +276,7 @@ static int setup_mon_len(void) #elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) || \ defined(CONFIG_XTENSA) gd->mon_len = CONFIG_SYS_MONITOR_LEN; -#elif defined(CONFIG_NDS32) +#elif defined(CONFIG_NDS32) || defined(CONFIG_SH) gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start); #elif defined(CONFIG_SYS_MONITOR_BASE) /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ @@ -325,15 +325,6 @@ __weak ulong board_get_usable_ram_top(ulong total_size) return gd->ram_top; } -__weak phys_size_t board_reserve_ram_top(phys_size_t ram_size) -{ -#ifdef CONFIG_SYS_MEM_TOP_HIDE - return ram_size - CONFIG_SYS_MEM_TOP_HIDE; -#else - return ram_size; -#endif -} - static int setup_dest_addr(void) { debug("Monitor len: %08lX\n", gd->mon_len); @@ -341,26 +332,19 @@ static int setup_dest_addr(void) * Ram is setup, size stored in gd !! */ debug("Ram size: %08lX\n", (ulong)gd->ram_size); -#ifdef CONFIG_SYS_MEM_RESERVE_SECURE - /* Reserve memory for secure MMU tables, and/or security monitor */ - gd->ram_size -= CONFIG_SYS_MEM_RESERVE_SECURE; - /* - * Record secure memory location. Need recalcuate if memory splits - * into banks, or the ram base is not zero. - */ - gd->arch.secure_ram = gd->ram_size; -#endif +#if defined(CONFIG_SYS_MEM_TOP_HIDE) /* * Subtract specified amount of memory to hide so that it won't * get "touched" at all by U-Boot. By fixing up gd->ram_size * the Linux kernel should now get passed the now "corrected" - * memory size and won't touch it either. This has been used - * by arch/powerpc exclusively. Now ARMv8 takes advantage of - * thie mechanism. If memory is split into banks, addresses - * need to be calculated. + * memory size and won't touch it either. This should work + * for arch/ppc and arch/powerpc. Only Linux board ports in + * arch/powerpc with bootwrapper support, that recalculate the + * memory size from the SDRAM controller setup will have to + * get fixed. */ - gd->ram_size = board_reserve_ram_top(gd->ram_size); - + gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; +#endif #ifdef CONFIG_SYS_SDRAM_BASE gd->ram_top = CONFIG_SYS_SDRAM_BASE; #endif @@ -619,7 +603,8 @@ static int display_new_sp(void) return 0; } -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) +#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ + defined(CONFIG_SH) static int setup_board_part1(void) { bd_t *bd = gd->bd; @@ -767,7 +752,8 @@ static int setup_reloc(void) } /* ARM calls relocate_code from its crt0.S */ -#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) +#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \ + !CONFIG_IS_ENABLED(X86_64) static int jump_to_copy(void) { @@ -844,7 +830,7 @@ __weak int arch_cpu_init_dm(void) return 0; } -static init_fnc_t init_sequence_f[] = { +static const init_fnc_t init_sequence_f[] = { #ifdef CONFIG_SANDBOX setup_ram_buf, #endif @@ -857,10 +843,6 @@ static init_fnc_t init_sequence_f[] = { #endif initf_malloc, initf_console_record, -#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) - /* TODO: can this go into arch_cpu_init()? */ - probecpu, -#endif #if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP) x86_fsp_init, #endif @@ -884,14 +866,9 @@ static init_fnc_t init_sequence_f[] = { #endif #if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \ defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \ - defined(CONFIG_SPARC) + defined(CONFIG_SH) || defined(CONFIG_SPARC) timer_init, /* initialize timer */ #endif -#ifdef CONFIG_SYS_ALLOC_DPRAM -#if !defined(CONFIG_CPM2) - dpram_init, -#endif -#endif #if defined(CONFIG_BOARD_POSTCLK_INIT) board_postclk_init, #endif @@ -912,9 +889,6 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_SANDBOX sandbox_early_getopt_check, #endif -#ifdef CONFIG_OF_CONTROL - fdtdec_prepare_fdt, -#endif display_options, /* say that we are here */ display_text_info, /* show debugging info if required */ #if defined(CONFIG_MPC8260) @@ -924,13 +898,12 @@ static init_fnc_t init_sequence_f[] = { #if defined(CONFIG_MPC83xx) prt_83xx_rsr, #endif -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SH) checkcpu, #endif +#if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ -#if defined(CONFIG_MPC5xxx) - prt_mpc5xxx_clks, -#endif /* CONFIG_MPC5xxx */ +#endif #if defined(CONFIG_DISPLAY_BOARDINFO) show_board_info, #endif @@ -948,7 +921,8 @@ static init_fnc_t init_sequence_f[] = { announce_dram_init, /* TODO: unify all these dram functions? */ #if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \ - defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) + defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || \ + defined(CONFIG_SH) dram_init, /* configure available RAM banks */ #endif #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K) @@ -1026,7 +1000,8 @@ static init_fnc_t init_sequence_f[] = { reserve_stacks, setup_dram_config, show_dram_config, -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) +#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ + defined(CONFIG_SH) setup_board_part1, #endif #if defined(CONFIG_PPC) || defined(CONFIG_M68K) @@ -1042,13 +1017,14 @@ static init_fnc_t init_sequence_f[] = { setup_reloc, #if defined(CONFIG_X86) || defined(CONFIG_ARC) copy_uboot_to_ram, - clear_bss, do_elf_reloc_fixups, + clear_bss, #endif #if defined(CONFIG_XTENSA) clear_bss, #endif -#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) +#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \ + !CONFIG_IS_ENABLED(X86_64) jump_to_copy, #endif NULL, @@ -1058,7 +1034,7 @@ void board_init_f(ulong boot_flags) { #ifdef CONFIG_SYS_GENERIC_GLOBAL_DATA /* - * For some archtectures, global data is initialized and used before + * For some architectures, global data is initialized and used before * calling this function. The data should be preserved. For others, * CONFIG_SYS_GENERIC_GLOBAL_DATA should be defined and use the stack * here to host global data until relocation. @@ -1070,7 +1046,7 @@ void board_init_f(ulong boot_flags) /* * Clear global data before it is accessed at debug print * in initcall_run_list. Otherwise the debug print probably - * get the wrong vaule of gd->have_console. + * get the wrong value of gd->have_console. */ zero_global_data(); #endif @@ -1082,7 +1058,7 @@ void board_init_f(ulong boot_flags) hang(); #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \ - !defined(CONFIG_EFI_APP) + !defined(CONFIG_EFI_APP) && !CONFIG_IS_ENABLED(X86_64) /* NOTREACHED - jump_to_copy() does not return */ hang(); #endif @@ -1106,8 +1082,10 @@ void board_init_f(ulong boot_flags) * NOTE: At present only x86 uses this route, but it is intended that * all archs will move to this when generic relocation is implemented. */ -static init_fnc_t init_sequence_f_r[] = { +static const init_fnc_t init_sequence_f_r[] = { +#if !CONFIG_IS_ENABLED(X86_64) init_cache_f_r, +#endif NULL, };