From 49cc425e528453074f39c230c22ebbb50d7b376a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Sun, 4 Dec 2016 08:49:38 +0100 Subject: [PATCH] UPSTREAM: mb/lowrisc/nexys4ddr: Read RAM information from the config string BUG=None BRANCH=None TEST=None Signed-off-by: Jonathan Neuschfer Reviewed-on: https://review.coreboot.org/17710 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich Change-Id: I9147eca0b536b6267d58f6e8baa37b6950b35160 Reviewed-on: https://chromium-review.googlesource.com/417076 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/mainboard/lowrisc/nexys4ddr/mainboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mainboard/lowrisc/nexys4ddr/mainboard.c b/src/mainboard/lowrisc/nexys4ddr/mainboard.c index 8b6bcb2442..aae3b9b93d 100644 --- a/src/mainboard/lowrisc/nexys4ddr/mainboard.c +++ b/src/mainboard/lowrisc/nexys4ddr/mainboard.c @@ -14,17 +14,17 @@ */ #include +#include #include #include static void mainboard_enable(device_t dev) { - /* - * TODO: Get this size from the hardware-supplied configuration string. - */ - const size_t ram_size = 1*GiB; + uintptr_t ram_base; + size_t ram_size; - ram_resource(dev, 0, (uintptr_t)_dram / KiB, ram_size / KiB); + query_mem(configstring(), &ram_base, &ram_size); + ram_resource(dev, 0, ram_base / KiB, ram_size / KiB); cbmem_initialize_empty(); }