From 07387d1769c7cc29ff2402117148477263c4c5ce Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2014 13:20:05 -0700 Subject: x86: Use the standard dram_init() function Instead of having an x86-specific DRAM init function, adjust things so we can use the normal one. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/board_f.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index b5bebc9dc86..1d81ed7c6a1 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -902,14 +902,10 @@ static init_fnc_t init_sequence_f[] = { #endif #if defined(CONFIG_HARD_SPI) init_func_spi, -#endif -#ifdef CONFIG_X86 - dram_init_f, /* configure available RAM banks */ - calculate_relocation_address, #endif announce_dram_init, /* TODO: unify all these dram functions? */ -#ifdef CONFIG_ARM +#if defined(CONFIG_ARM) || defined(CONFIG_X86) dram_init, /* configure available RAM banks */ #endif #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) -- cgit v1.3.1 From 8b37c7694f1eace82626d00fbfb85311ebf0d220 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2014 13:20:06 -0700 Subject: x86: Use the standard arch_cpu_init() function Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one for this purpose. Also remove a useless/misleading comment. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/coreboot/coreboot.c | 11 +++++------ arch/x86/cpu/cpu.c | 1 - arch/x86/include/asm/u-boot-x86.h | 1 + common/board_f.c | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index e24f13afaf1..4e1349f9508 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -20,18 +20,17 @@ DECLARE_GLOBAL_DATA_PTR; -/* - * Miscellaneous platform dependent initializations - */ -int cpu_init_f(void) +int arch_cpu_init(void) { int ret = get_coreboot_info(&lib_sysinfo); - if (ret != 0) + if (ret != 0) { printf("Failed to parse coreboot tables.\n"); + return ret; + } timestamp_init(); - return ret; + return x86_cpu_init_f(); } int board_early_init_f(void) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 2e252532d61..d6ba246b6fd 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -130,7 +130,6 @@ int x86_cpu_init_f(void) return 0; } -int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f"))); int x86_cpu_init_r(void) { diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 89618c7f644..fdb8a6c9a3b 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -9,6 +9,7 @@ #define _U_BOOT_I386_H_ 1 /* cpu/.../cpu.c */ +int arch_cpu_init(void); int x86_cpu_init_r(void); int cpu_init_r(void); int x86_cpu_init_f(void); diff --git a/common/board_f.c b/common/board_f.c index 1d81ed7c6a1..23d8f6461a5 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -818,7 +818,6 @@ static init_fnc_t init_sequence_f[] = { #endif arch_cpu_init, /* basic arch cpu dependent setup */ #ifdef CONFIG_X86 - cpu_init_f, /* TODO(sjg@chromium.org): remove */ # ifdef CONFIG_OF_CONTROL find_fdt, /* TODO(sjg@chromium.org): remove */ # endif -- cgit v1.3.1 From 768e0f52f2d1a9d19842c8d1ded22a96b080a266 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 10 Nov 2014 18:00:18 -0700 Subject: Move early malloc() to before arch_cpu_init() For some CPUs, having malloc() available very early is useful. There is no reason to delay this since early malloc is allocated before board_init_f() is called. Move early malloc() init nearer to the start of the init sequence. Signed-off-by: Simon Glass --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index 23d8f6461a5..f81f70d442f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -812,6 +812,7 @@ static init_fnc_t init_sequence_f[] = { setup_mon_len, setup_fdt, trace_early_init, + initf_malloc, #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) /* TODO: can this go into arch_cpu_init()? */ probecpu, @@ -826,7 +827,6 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_OF_CONTROL fdtdec_check_fdt, #endif - initf_malloc, initf_dm, #if defined(CONFIG_BOARD_EARLY_INIT_F) board_early_init_f, -- cgit v1.3.1 From 003504b6fe2296f581191b77fd2f1e98c4f4720c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 10 Nov 2014 18:00:25 -0700 Subject: x86: Remove unnecessary find_fdt(), prepare_fdt() functions These are no-longer needed so drop them. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/include/asm/init_helpers.h | 2 -- arch/x86/lib/init_helpers.c | 27 --------------------------- common/board_f.c | 5 ----- 3 files changed, 34 deletions(-) (limited to 'common') diff --git a/arch/x86/include/asm/init_helpers.h b/arch/x86/include/asm/init_helpers.h index b07887eadcf..8cbe08eb565 100644 --- a/arch/x86/include/asm/init_helpers.h +++ b/arch/x86/include/asm/init_helpers.h @@ -13,7 +13,5 @@ int calculate_relocation_address(void); int init_cache_f_r(void); int init_bd_struct_r(void); int init_func_spi(void); -int find_fdt(void); -int prepare_fdt(void); #endif /* !_INIT_HELPERS_H_ */ diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index b5d937feb3a..be4eb12c53c 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -87,30 +87,3 @@ int init_func_spi(void) puts("ready\n"); return 0; } - -int find_fdt(void) -{ -#ifdef CONFIG_OF_EMBED - /* Get a pointer to the FDT */ - gd->fdt_blob = __dtb_dt_begin; -#elif defined CONFIG_OF_SEPARATE - /* FDT is at end of image */ - gd->fdt_blob = (ulong *)&_end; -#endif - /* Allow the early environment to override the fdt address */ - gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, - (uintptr_t)gd->fdt_blob); - - return 0; -} - -int prepare_fdt(void) -{ - /* For now, put this check after the console is ready */ - if (fdtdec_prepare_fdt()) { - panic("** CONFIG_OF_CONTROL defined but no FDT - please see " - "doc/README.fdt-control"); - } - - return 0; -} diff --git a/common/board_f.c b/common/board_f.c index f81f70d442f..6e6a1a2b984 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -818,11 +818,6 @@ static init_fnc_t init_sequence_f[] = { probecpu, #endif arch_cpu_init, /* basic arch cpu dependent setup */ -#ifdef CONFIG_X86 -# ifdef CONFIG_OF_CONTROL - find_fdt, /* TODO(sjg@chromium.org): remove */ -# endif -#endif mark_bootstage, #ifdef CONFIG_OF_CONTROL fdtdec_check_fdt, -- cgit v1.3.1