summaryrefslogtreecommitdiff
path: root/src/soc/rockchip/common/cbmem.c
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-03-26 11:50:05 +0800
committerPatrick Georgi <pgeorgi@google.com>2016-05-09 08:45:35 +0200
commit19eb7509d380fd5d9e6d083ad0d2633820c8db4b (patch)
tree9a2241f7e47ff6d7cfb8e4f56c6c7acfc44b797c /src/soc/rockchip/common/cbmem.c
parentc4cbf482f796b12f240bb88340a61ecac12ee090 (diff)
downloadcoreboot-19eb7509d380fd5d9e6d083ad0d2633820c8db4b.tar.xz
rockchip: make sure sdram top does not spill into MMIO space
The base address of MMIO space is different for different Rockchip SOCs. Define them in the appropriate address map files and use the definition in common code. BRANCH=none BUG=chrome-os-partner:51537 TEST=emerge-kevin coreboot Change-Id: I615f3cadd6d5d994b7dd1defbd10d02ad5c994da Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 24f941e960e4a2cfb9fc26415f56e240de3d00d9 Original-Change-Id: Ia48d75e7de546b17636cde7829ee09837b9d7ac9 Original-Signed-off-by: Lin Huang <hl@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/337190 Original-Commit-Ready: Vadim Bendebury <vbendeb@chromium.org> Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://review.coreboot.org/14717 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/rockchip/common/cbmem.c')
-rw-r--r--src/soc/rockchip/common/cbmem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/soc/rockchip/common/cbmem.c b/src/soc/rockchip/common/cbmem.c
index d06b292424..401f8b2a65 100644
--- a/src/soc/rockchip/common/cbmem.c
+++ b/src/soc/rockchip/common/cbmem.c
@@ -14,11 +14,13 @@
*/
#include <cbmem.h>
-#include <stddef.h>
-#include <symbols.h>
+#include <soc/addressmap.h>
#include <soc/sdram.h>
+#include <stdlib.h>
+#include <symbols.h>
void *cbmem_top(void)
{
- return _dram + sdram_size_mb()*MiB;
+ return (void *)min((uintptr_t)_dram + sdram_size_mb() * MiB,
+ MAX_DRAM_ADDRESS);
}