X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=common%2Fboard_f.c;h=2c8859507822d7015b02deac8e8ac23b665ca347;hb=0a0e53cb2ee625f603b7e2bb0caba23946f5fe40;hp=a960144b02f362434fe5985f22e6b56da16e5a91;hpb=928f6054555618c9700bc5ebc16b9a661fd3ead7;p=karo-tx-uboot.git diff --git a/common/board_f.c b/common/board_f.c index a960144b02..2c88595078 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -45,14 +45,17 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #if defined(CONFIG_X86) || defined(CONFIG_ARC) #include +#endif +#if defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_XTENSA) #include #endif #ifdef CONFIG_SANDBOX @@ -116,10 +119,11 @@ static int init_func_watchdog_init(void) # if defined(CONFIG_HW_WATCHDOG) && (defined(CONFIG_BLACKFIN) || \ defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \ defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \ + defined(CONFIG_DESIGNWARE_WATCHDOG) || \ defined(CONFIG_IMX_WATCHDOG)) hw_watchdog_init(); -# endif puts(" Watchdog enabled\n"); +# endif WATCHDOG_RESET(); return 0; @@ -269,11 +273,12 @@ static int setup_mon_len(void) gd->mon_len = (ulong)&__bss_end - (ulong)_start; #elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP) gd->mon_len = (ulong)&_end - (ulong)_init; -#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) +#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) || \ + defined(CONFIG_XTENSA) gd->mon_len = CONFIG_SYS_MONITOR_LEN; #elif defined(CONFIG_NDS32) gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start); -#else +#elif defined(CONFIG_SYS_MONITOR_BASE) /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; #endif @@ -285,6 +290,11 @@ __weak int arch_cpu_init(void) return 0; } +__weak int mach_cpu_init(void) +{ + return 0; +} + #ifdef CONFIG_SANDBOX static int setup_ram_buf(void) { @@ -338,7 +348,7 @@ static int setup_dest_addr(void) * Record secure memory location. Need recalcuate if memory splits * into banks, or the ram base is not zero. */ - gd->secure_ram = gd->ram_size; + gd->arch.secure_ram = gd->ram_size; #endif /* * Subtract specified amount of memory to hide so that it won't @@ -431,6 +441,15 @@ static int reserve_mmu(void) gd->arch.tlb_addr = gd->relocaddr; debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, gd->arch.tlb_addr + gd->arch.tlb_size); + +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + /* + * Record allocated tlb_addr in case gd->tlb_addr to be overwritten + * with location within secure ram. + */ + gd->arch.tlb_allocated = gd->arch.tlb_addr; +#endif + return 0; } #endif @@ -805,6 +824,11 @@ static int initf_dm(void) if (ret) return ret; #endif +#ifdef CONFIG_TIMER_EARLY + ret = dm_timer_init(); + if (ret) + return ret; +#endif return 0; } @@ -841,6 +865,7 @@ static init_fnc_t init_sequence_f[] = { x86_fsp_init, #endif arch_cpu_init, /* basic arch cpu dependent setup */ + mach_cpu_init, /* SoC/machine dependent CPU setup */ initf_dm, arch_cpu_init_dm, mark_bootstage, /* need timer, go after init dm */ @@ -955,7 +980,7 @@ static init_fnc_t init_sequence_f[] = { * - board info struct */ setup_dest_addr, -#if defined(CONFIG_BLACKFIN) +#if defined(CONFIG_BLACKFIN) || defined(CONFIG_XTENSA) /* Blackfin u-boot monitor should be on top of the ram */ reserve_uboot, #endif @@ -987,7 +1012,7 @@ static init_fnc_t init_sequence_f[] = { # endif #endif /* CONFIG_DM_VIDEO */ reserve_trace, -#if !defined(CONFIG_BLACKFIN) +#if !defined(CONFIG_BLACKFIN) && !defined(CONFIG_XTENSA) reserve_uboot, #endif #ifndef CONFIG_SPL_BUILD @@ -1020,6 +1045,9 @@ static init_fnc_t init_sequence_f[] = { clear_bss, do_elf_reloc_fixups, #endif +#if defined(CONFIG_XTENSA) + clear_bss, +#endif #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) jump_to_copy, #endif @@ -1089,6 +1117,13 @@ void board_init_f_r(void) if (initcall_run_list(init_sequence_f_r)) hang(); + /* + * The pre-relocation drivers may be using memory that has now gone + * away. Mark serial as unavailable - this will fall back to the debug + * UART if available. + */ + gd->flags &= ~GD_FLG_SERIAL_READY; + /* * U-Boot has been copied into SDRAM, the BSS has been cleared etc. * Transfer execution from Flash to RAM by calculating the address