]> git.sur5r.net Git - u-boot/commitdiff
x86: Use the standard dram_init() function
authorSimon Glass <sjg@chromium.org>
Thu, 6 Nov 2014 20:20:05 +0000 (13:20 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 21 Nov 2014 06:24:09 +0000 (07:24 +0100)
Instead of having an x86-specific DRAM init function, adjust things so we
can use the normal one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/coreboot/sdram.c
arch/x86/include/asm/u-boot-x86.h
common/board_f.c

index 959feaaea3407b7c92da443b22c1c795ab4753f9..ca651c7584e4bde992fe7b415284d444363fbbd4 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/e820.h>
 #include <asm/u-boot-x86.h>
 #include <asm/global_data.h>
+#include <asm/init_helpers.h>
 #include <asm/processor.h>
 #include <asm/sections.h>
 #include <asm/arch/sysinfo.h>
@@ -79,7 +80,7 @@ ulong board_get_usable_ram_top(ulong total_size)
        return (ulong)dest_addr;
 }
 
-int dram_init_f(void)
+int dram_init(void)
 {
        int i;
        phys_size_t ram_size = 0;
@@ -94,7 +95,8 @@ int dram_init_f(void)
        gd->ram_size = ram_size;
        if (ram_size == 0)
                return -1;
-       return 0;
+
+       return calculate_relocation_address();
 }
 
 int dram_init_banksize(void)
@@ -116,8 +118,3 @@ int dram_init_banksize(void)
        }
        return 0;
 }
-
-int dram_init(void)
-{
-       return dram_init_banksize();
-}
index 9e525dd7820b7f4ef7e77d25cdfafad83d784df3..89618c7f6440b0460b6680f00bc2661ef47bd0c8 100644 (file)
@@ -27,8 +27,8 @@ unsigned long get_tbclk_mhz(void);
 void timer_set_base(uint64_t base);
 int pcat_timer_init(void);
 
-/* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */
-int dram_init_f(void);
+/* Architecture specific DRAM init */
+int dram_init(void);
 
 /* cpu/.../interrupts.c */
 int cpu_init_interrupts(void);
index b5bebc9dc862727b7aa2386f64691ace23475cc0..1d81ed7c6a12c440f026fc096d0a42a119f10e9b 100644 (file)
@@ -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)