X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Finit%2Fboard_init.c;h=4a391beba98092ab93715ca86973580170afcbe6;hb=fc8523a1474d33dcc5f7fd1823563fbd73aa1876;hp=d98648eaa6fc26fbb9836622fbfee2552534d826;hpb=4edde96111aefac63d6aaca6ba87a90d149e973e;p=u-boot diff --git a/common/init/board_init.c b/common/init/board_init.c index d98648eaa6..4a391beba9 100644 --- a/common/init/board_init.c +++ b/common/init/board_init.c @@ -11,16 +11,6 @@ DECLARE_GLOBAL_DATA_PTR; -/* - * It isn't trivial to figure out whether memcpy() exists. The arch-specific - * memcpy() is not normally available in SPL due to code size. - */ -#if !defined(CONFIG_SPL_BUILD) || \ - (defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && \ - !defined(CONFIG_USE_ARCH_MEMSET)) -#define _USE_MEMCPY -#endif - /* Unfortunately x86 or ARM can't compile this code as gd cannot be assigned */ #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) __weak void arch_setup_gd(struct global_data *gd_ptr) @@ -56,8 +46,8 @@ __weak void arch_setup_gd(struct global_data *gd_ptr) ulong board_init_f_alloc_reserve(ulong top) { /* Reserve early malloc arena */ -#if defined(CONFIG_SYS_MALLOC_F) - top -= CONFIG_SYS_MALLOC_F_LEN; +#if CONFIG_VAL(SYS_MALLOC_F_LEN) + top -= CONFIG_VAL(SYS_MALLOC_F_LEN); #endif /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */ top = rounddown(top-sizeof(struct global_data), 16); @@ -110,9 +100,6 @@ ulong board_init_f_alloc_reserve(ulong top) void board_init_f_init_reserve(ulong base) { struct global_data *gd_ptr; -#ifndef _USE_MEMCPY - int *ptr; -#endif /* * clear GD entirely and set it up. @@ -121,14 +108,9 @@ void board_init_f_init_reserve(ulong base) gd_ptr = (struct global_data *)base; /* zero the area */ -#ifdef _USE_MEMCPY memset(gd_ptr, '\0', sizeof(*gd)); -#else - for (ptr = (int *)gd_ptr; ptr < (int *)(gd_ptr + 1); ) - *ptr++ = 0; -#endif /* set GD unless architecture did it already */ -#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) +#if !defined(CONFIG_ARM) arch_setup_gd(gd_ptr); #endif /* next alloc will be higher by one GD plus 16-byte alignment */ @@ -139,10 +121,15 @@ void board_init_f_init_reserve(ulong base) * Use gd as it is now properly set for all architectures. */ -#if defined(CONFIG_SYS_MALLOC_F) +#if CONFIG_VAL(SYS_MALLOC_F_LEN) /* go down one 'early malloc arena' */ gd->malloc_base = base; /* next alloc will be higher by one 'early malloc arena' size */ - base += CONFIG_SYS_MALLOC_F_LEN; + base += CONFIG_VAL(SYS_MALLOC_F_LEN); #endif } + +/* + * Board-specific Platform code can reimplement show_boot_progress () if needed + */ +__weak void show_boot_progress(int val) {}