Angel Pons | 5de47d0 | 2020-04-04 18:51:30 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 3 | |
| 4 | #include <cbmem.h> |
Elyes HAOUAS | ba9b504 | 2019-12-19 07:47:52 +0100 | [diff] [blame] | 5 | #include <commonlib/helpers.h> |
Philipp Hug | bb7f41d | 2018-07-07 14:21:30 +0200 | [diff] [blame] | 6 | #include <soc/addressmap.h> |
| 7 | #include <soc/sdram.h> |
Philipp Hug | bb7f41d | 2018-07-07 14:21:30 +0200 | [diff] [blame] | 8 | #include <symbols.h> |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 9 | |
Arthur Heymans | 340e4b8 | 2019-10-23 17:25:58 +0200 | [diff] [blame] | 10 | void *cbmem_top_chipset(void) |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 11 | { |
Elyes HAOUAS | ba9b504 | 2019-12-19 07:47:52 +0100 | [diff] [blame] | 12 | return (void *)MIN((uintptr_t)_dram + sdram_size_mb() * MiB, |
Philipp Hug | bb7f41d | 2018-07-07 14:21:30 +0200 | [diff] [blame] | 13 | FU540_MAXDRAM); |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 14 | } |