Angel Pons | e67ab18 | 2020-04-04 18:51:11 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 2 | |
3 | #include <cbmem.h> | ||||
Elyes HAOUAS | ba9b504 | 2019-12-19 07:47:52 +0100 | [diff] [blame] | 4 | #include <commonlib/helpers.h> |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 5 | #include <symbols.h> |
Yidi Lin | c6d7dcc | 2016-02-04 17:26:48 +0800 | [diff] [blame] | 6 | #include <soc/emi.h> |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 7 | |
Tristan Shieh | 4c8d487 | 2018-06-06 13:35:12 +0800 | [diff] [blame] | 8 | #define MAX_DRAM_ADDRESS ((uintptr_t)4 * GiB) |
9 | |||||
Elyes Haouas | 799c321 | 2022-11-09 14:00:44 +0100 | [diff] [blame] | 10 | uintptr_t cbmem_top_chipset(void) |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 11 | { |
Elyes Haouas | 799c321 | 2022-11-09 14:00:44 +0100 | [diff] [blame] | 12 | return MIN((uintptr_t)_dram + sdram_size(), MAX_DRAM_ADDRESS); |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 13 | } |