From 2421dffc74e523f33f4fe972a1ac217bca470fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Thu, 24 Nov 2016 08:26:03 +0100 Subject: [PATCH] UPSTREAM: soc/lowrisc: Place CBMEM at top of autodetected RAM BUG=None BRANCH=None TEST=None Signed-off-by: Jonathan Neuschfer Reviewed-on: https://review.coreboot.org/17708 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich Change-Id: I9f169db330d1792128db7a6308ed3afbe5803c03 Reviewed-on: https://chromium-review.googlesource.com/417074 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/soc/lowrisc/lowrisc/cbmem.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/soc/lowrisc/lowrisc/cbmem.c b/src/soc/lowrisc/lowrisc/cbmem.c index ea7ad7027c..44ffa26939 100644 --- a/src/soc/lowrisc/lowrisc/cbmem.c +++ b/src/soc/lowrisc/lowrisc/cbmem.c @@ -11,13 +11,15 @@ * GNU General Public License for more details. */ -#include #include +#include void *cbmem_top(void) { - // TODO: find out how the lowrisc SOC decides to provide - // this information, when they know. - printk(BIOS_SPEW, "Returning hard-coded 128M; fix me\n"); - return (void *)((uintptr_t)(2ULL*GiB+128*MiB)); + uintptr_t base; + size_t size; + + query_mem(configstring(), &base, &size); + + return (void *)(base + size); }