Angel Pons | 5f249e6 | 2020-04-04 18:51:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
David Hendricks | 8cbd569 | 2017-12-01 20:49:48 -0800 | [diff] [blame] | 2 | |
| 3 | #include <cbmem.h> |
| 4 | #include <soc/addressmap.h> |
| 5 | #include <soc/sdram.h> |
David Hendricks | 8cbd569 | 2017-12-01 20:49:48 -0800 | [diff] [blame] | 6 | #include <symbols.h> |
| 7 | |
Arthur Heymans | 340e4b8 | 2019-10-23 17:25:58 +0200 | [diff] [blame] | 8 | void *cbmem_top_chipset(void) |
David Hendricks | 8cbd569 | 2017-12-01 20:49:48 -0800 | [diff] [blame] | 9 | { |
Patrick Rudolph | 52acef1 | 2018-08-08 12:46:18 +0200 | [diff] [blame] | 10 | /* Make sure not to overlap with reserved ATF scratchpad */ |
Patrick Rudolph | ab0a774 | 2019-01-02 14:04:02 +0100 | [diff] [blame] | 11 | return (void *)((uintptr_t)_dram + (sdram_size_mb() - 1) * MiB); |
David Hendricks | 8cbd569 | 2017-12-01 20:49:48 -0800 | [diff] [blame] | 12 | } |