diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2016-11-24 08:26:03 +0100 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2016-12-06 18:51:13 +0100 |
commit | 1e910c901b436adc6a0590e89b4b71262d23fcc9 (patch) | |
tree | cd58b4a868de5dd5c7d9345a186d40a30160136b /src/soc/lowrisc | |
parent | 30140d2be95acb683d74d6a3ac13ce1cf791971b (diff) |
soc/lowrisc: Place CBMEM at top of autodetected RAM
Change-Id: I9f169db330d1792128db7a6308ed3afbe5803c03
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/17708
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/soc/lowrisc')
-rw-r--r-- | src/soc/lowrisc/lowrisc/cbmem.c | 12 |
1 files 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 <console/console.h> #include <cbmem.h> +#include <commonlib/configstring.h> 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); } |