diff options
Diffstat (limited to 'arch/arm/mach-rockchip/rk3188-board.c')
-rw-r--r-- | arch/arm/mach-rockchip/rk3188-board.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c index 16f3855..c370156 100644 --- a/arch/arm/mach-rockchip/rk3188-board.c +++ b/arch/arm/mach-rockchip/rk3188-board.c @@ -56,8 +56,22 @@ err: int dram_init(void) { - /* FIXME: read back ram size from sys_reg2 */ - gd->ram_size = 0x40000000; + struct ram_info ram; + struct udevice *dev; + int ret; + + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + debug("DRAM init failed: %d\n", ret); + return ret; + } + ret = ram_get_info(dev, &ram); + if (ret) { + debug("Cannot get DRAM size: %d\n", ret); + return ret; + } + debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size); + gd->ram_size = ram.size; return 0; } |