diff mbox series

[U-Boot,v2,5/5] rk3288: spl: Add dram_init_banksize

Message ID 1506533594-9741-6-git-send-email-chakra.divi@openedev.com
State Accepted
Commit 2ee3021ae1808828c74b7eb6ae68d8d511bc4c30
Delegated to: Philipp Tomsich
Headers show
Series rk3288: Falcon mode support | expand

Commit Message

Chakra Divi Sept. 27, 2017, 5:33 p.m. UTC
From: Jagan Teki <jagan@amarulasolutions.com>

Falcon mode, is updating DDR dt node configuration through
spl_fixup_fdt() so add appropriate DDR base and size through
dram_init_banksize.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---
Changes for v2:
- none 

 arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Philipp Tomsich Sept. 29, 2017, 5:58 p.m. UTC | #1
> From: Jagan Teki <jagan@amarulasolutions.com>
> 
> Falcon mode, is updating DDR dt node configuration through
> spl_fixup_fdt() so add appropriate DDR base and size through
> dram_init_banksize.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> Changes for v2:
> - none 
> 
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 5239cbc..7b7fd5a 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -19,7 +19,9 @@ 
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
+#include <asm/arch/pmu_rk3288.h>
 #include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 #include <dm/pinctrl.h>
@@ -290,3 +292,18 @@  err:
 	/* No way to report error here */
 	hang();
 }
+
+#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