| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <cbmem.h> |
| 4 | #include <ramdetect.h> |
| 5 | #include <symbols.h> |
| 6 | #include <commonlib/device_tree.h> |
| 7 | |
| 8 | DECLARE_REGION(fdt) |
| 9 | uintptr_t cbmem_top_chipset(void) |
| 10 | { |
| 11 | uint64_t top; |
| 12 | |
| 13 | top = fdt_get_memory_top((void *)_fdt); |
| 14 | if (top) |
| 15 | return MIN(top, (uint64_t)4 * GiB - 1); |
| 16 | |
| 17 | return (uintptr_t)_dram + (probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB) * MiB); |
| 18 | } |