summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173/cbmem.c
diff options
context:
space:
mode:
authorYidi Lin <yidi.lin@mediatek.com>2016-02-04 17:26:48 +0800
committerPatrick Georgi <pgeorgi@google.com>2016-03-12 09:14:33 +0100
commitc6d7dcc832521ad6e5d90ad82af384ec3d24aa09 (patch)
treedd6c1ac29bca30d69b717d719b9aba05bee08007 /src/soc/mediatek/mt8173/cbmem.c
parent9a64ec4dd239f2b757dff9effe3b10510034e62c (diff)
mediatek/mt8173: detect sdram size at runtime
Remove DRAM_SIZE_MB Kconfig setting and use sdram_size_mb() to detect the DRAM size at runtime. BUG=chrome-os-partner:49427 BRANCH=none TEST=Boot to kernel Change-Id: I0c3245db73335fb4f1c89c1debde715fc96ecba7 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 00f6f2bbed0e7d23181337b9274191b31e73e223 Original-Change-Id: I409163fe527e966c184f28d7d9bbc809ae2308ed Original-Signed-off-by: PH Hsu <ph.hsu@mediatek.com> Original-Signed-off-by: Yidi Lin <yidi.lin@mediatek.com> Original-Reviewed-on: https://chromium-review.googlesource.com/327961 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/331176 Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Original-Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/13988 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8173/cbmem.c')
-rw-r--r--src/soc/mediatek/mt8173/cbmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/mediatek/mt8173/cbmem.c b/src/soc/mediatek/mt8173/cbmem.c
index c7afd6c08e..1967a2c4d3 100644
--- a/src/soc/mediatek/mt8173/cbmem.c
+++ b/src/soc/mediatek/mt8173/cbmem.c
@@ -17,9 +17,9 @@
#include <stddef.h>
#include <stdlib.h>
#include <symbols.h>
+#include <soc/emi.h>
void *cbmem_top(void)
{
- return (void *)min((uintptr_t)_dram + ((size_t)CONFIG_DRAM_SIZE_MB * MiB),
- (uintptr_t)4 * GiB);
+ return (void *)min((uintptr_t)_dram + sdram_size(), (uintptr_t)4 * GiB);
}