| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <cbmem.h> |
| 4 | #include <symbols.h> |
| 5 | #include <commonlib/device_tree.h> |
| 6 | #include <console/console.h> |
| 7 | |
| 8 | DECLARE_REGION(fdt_pointer) |
| 9 | uintptr_t cbmem_top_chipset(void) |
| 10 | { |
| 11 | const uint64_t top = fdt_get_memory_top((void *) *((uintptr_t *)_fdt_pointer)); |
| 12 | |
| 13 | if (top == 0) { |
| 14 | /* corrupted FDT? */ |
| 15 | die("Could not find top of memory in FDT!"); |
| 16 | } |
| 17 | |
| 18 | printk(BIOS_DEBUG, "%s: 0x%llx\n", __func__, top); |
| 19 | return (uintptr_t)top; |
| 20 | } |