Angel Pons | 5de47d0 | 2020-04-04 18:51:30 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 2 | |
| 3 | #include <cbmem.h> |
Elyes HAOUAS | ba9b504 | 2019-12-19 07:47:52 +0100 | [diff] [blame] | 4 | #include <commonlib/helpers.h> |
Philipp Hug | bb7f41d | 2018-07-07 14:21:30 +0200 | [diff] [blame] | 5 | #include <soc/addressmap.h> |
| 6 | #include <soc/sdram.h> |
Philipp Hug | bb7f41d | 2018-07-07 14:21:30 +0200 | [diff] [blame] | 7 | #include <symbols.h> |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 8 | |
Elyes Haouas | 799c321 | 2022-11-09 14:00:44 +0100 | [diff] [blame^] | 9 | uintptr_t cbmem_top_chipset(void) |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 10 | { |
Elyes Haouas | 799c321 | 2022-11-09 14:00:44 +0100 | [diff] [blame^] | 11 | return MIN((uintptr_t)_dram + sdram_size_mb() * MiB, FU540_MAXDRAM); |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 12 | } |