mediatek/mt8173: revise cbmem_top

Support memory range querying to above/below 4GiB.
Enable PRERAM_CBMEM_CONSOLE.

BRANCH=none
BUG=none
TEST=build and verified pass on oak board

Change-Id: If12ab2e9b8a129e2c82dd97b0493d9abdd6985a9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 139a3163ca867ec5676c6cb81fdec724c99a4a99
Original-Change-Id: Ie190f86f49ae88671f0738e2d6ceafdad58a93cc
Original-Signed-off-by: CC Ma <cc.ma@mediatek.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/292559
Original-Commit-Ready: Yidi Lin <yidi.lin@mediatek.com>
Original-Tested-by: Yidi Lin <yidi.lin@mediatek.com>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/13098
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
CC Ma 2015-08-06 14:07:50 +08:00 committed by Patrick Georgi
parent 767b45fe96
commit e3413cce3c
2 changed files with 4 additions and 3 deletions

View File

@ -15,9 +15,11 @@
#include <cbmem.h>
#include <stddef.h>
#include <stdlib.h>
#include <symbols.h>
void *cbmem_top(void)
{
return (void *)((uintptr_t) _dram + (CONFIG_DRAM_SIZE_MB << 20));
return (void *)min((uintptr_t)_dram + ((size_t)CONFIG_DRAM_SIZE_MB * MiB),
(uintptr_t)4 * GiB);
}

View File

@ -16,13 +16,12 @@
#include <cpu/cpu.h>
#include <console/console.h>
#include <device/device.h>
#include <symbols.h>
static void soc_read_resources(device_t dev)
{
ram_resource(dev, 0, (uintptr_t)_dram / KiB,
CONFIG_DRAM_SIZE_MB * KiB);
CONFIG_DRAM_SIZE_MB * (MiB / KiB));
}
static void soc_init(device_t dev)