From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chakra Divi <2chakrass@gmail.com> Date: Wed, 27 Sep 2017 23:03:14 +0530 Subject: [U-Boot] [PATCH v2 5/5] rk3288: spl: Add dram_init_banksize In-Reply-To: <1506533594-9741-1-git-send-email-chakra.divi@openedev.com> References: <1506533594-9741-1-git-send-email-chakra.divi@openedev.com> Message-ID: <1506533594-9741-6-git-send-email-chakra.divi@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Jagan Teki 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 Reviewed-by: Philipp Tomsich Acked-by: Philipp Tomsich --- Changes for v2: - none arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 #include #include +#include #include +#include #include #include #include @@ -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 -- 2.7.4