From fc5e6c6696b7c7f6af0311dbb0870602b12bed73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Thu, 24 Nov 2016 08:25:29 +0100 Subject: [PATCH] soc/ucb/riscv: Place CBMEM at top of autodetected RAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ida016aec11ccdb8da8d2ae1d30ddca16b069be11 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/17595 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/soc/ucb/riscv/cbmem.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/soc/ucb/riscv/cbmem.c b/src/soc/ucb/riscv/cbmem.c index 0e0eec196b..44ffa26939 100644 --- a/src/soc/ucb/riscv/cbmem.c +++ b/src/soc/ucb/riscv/cbmem.c @@ -12,9 +12,14 @@ */ #include +#include void *cbmem_top(void) { - // TODO: find out how RISCV stores this. - return (void *)((uintptr_t)3*GiB); + uintptr_t base; + size_t size; + + query_mem(configstring(), &base, &size); + + return (void *)(base + size); }