rockchip: rk3288: move dram_init_banksize() into soc file
authorKever Yang <kever.yang@rock-chips.com>
Mon, 22 Jul 2019 11:59:26 +0000 (19:59 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 29 Jul 2019 02:25:27 +0000 (10:25 +0800)
Mov edram_init_banksize() into rk3288.c so that we can re-use
the common SPL board file later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288/rk3288.c

index 13cd86079bd433dfae37cdc4e4da6b09e3b6b81f..97853ccdc778f46a879b60e506d4990660f5ecd0 100644 (file)
@@ -156,18 +156,3 @@ void board_init_f(ulong dummy)
        }
 #endif
 }
-
-#ifdef CONFIG_SPL_OS_BOOT
-
-#define PMU_BASE               0xff730000
-int dram_init_banksize(void)
-{
-       struct rk3288_pmu *const pmu = (void *)PMU_BASE;
-       size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
-
-       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
-       gd->bd->bi_dram[0].size = size;
-
-       return 0;
-}
-#endif
index 7552472fbc4ea1d4e70b91c86d52c8ee32ab1719..0a185d676bf80e91cd55d837c65cb5a19d1e1981 100644 (file)
@@ -6,6 +6,10 @@
 #include <asm/io.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/pmu_rk3288.h>
+#include <asm/arch-rockchip/sdram_common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define GRF_BASE       0xff770000
 
@@ -57,3 +61,18 @@ void board_debug_uart_init(void)
                     GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+
+#define PMU_BASE               0xff730000
+int dram_init_banksize(void)
+{
+       struct rk3288_pmu *const pmu = (void *)PMU_BASE;
+       size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
+
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = size;
+
+       return 0;
+}
+#endif