blob: 1967a2c4d30923a463eba4af4616d610863cd436 [file] [log] [blame]
Yidi Lin3d7b6062015-07-31 17:10:40 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2015 MediaTek Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Yidi Lin3d7b6062015-07-31 17:10:40 +080014 */
15
16#include <cbmem.h>
17#include <stddef.h>
CC Mae3413cc2015-08-06 14:07:50 +080018#include <stdlib.h>
Yidi Lin3d7b6062015-07-31 17:10:40 +080019#include <symbols.h>
Yidi Linc6d7dcc2016-02-04 17:26:48 +080020#include <soc/emi.h>
Yidi Lin3d7b6062015-07-31 17:10:40 +080021
22void *cbmem_top(void)
23{
Yidi Linc6d7dcc2016-02-04 17:26:48 +080024 return (void *)min((uintptr_t)_dram + sdram_size(), (uintptr_t)4 * GiB);
Yidi Lin3d7b6062015-07-31 17:10:40 +080025}