From 9c1b53dca1ffb018e6277afd35fc0badb065af70 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Thu, 5 Jan 2017 10:23:36 -0800 Subject: [PATCH] UPSTREAM: soc/intel/quark: Return NULL for top_of_memory Return NULL for top_of_memory when the register has not been set. TEST=Build and run on Galileo Gen2 Change-Id: I86684044fc282eaa8deda2b5dbd8ab6cae095d72 Signed-off-by: Patrick Georgi Original-Commit-Id: 6edb3140501ad6ad4224e9c79e7d63b8af970466 Original-Change-Id: If79cac68c2a64aa9bf3be72d3cfc4c73fceef12b Original-Signed-off-by: Lee Leahy Original-Reviewed-on: https://review.coreboot.org/18802 Original-Reviewed-by: Paul Menzel Original-Tested-by: Martin Roth Original-Reviewed-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/455822 --- src/soc/intel/quark/memmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/quark/memmap.c b/src/soc/intel/quark/memmap.c index 53a1b24094..d67856cc74 100644 --- a/src/soc/intel/quark/memmap.c +++ b/src/soc/intel/quark/memmap.c @@ -26,7 +26,8 @@ void *cbmem_top(void) top_of_memory <<= 16; /* Reserve 64 KiB for RMU firmware */ - top_of_memory -= 0x10000; + if (top_of_memory) + top_of_memory -= 0x10000; /* Return the top of memory */ return (void *)top_of_memory;