blob: d6d5861014555207410cc06c1af73c7fb9f71670 [file] [log] [blame]
David Milosevicad83eb12023-11-16 05:11:18 +01001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <cbmem.h>
4#include <symbols.h>
Maximilian Bruneda336cd2023-09-16 20:08:41 +02005#include <commonlib/device_tree.h>
David Milosevicad83eb12023-11-16 05:11:18 +01006#include <console/console.h>
7
8DECLARE_REGION(fdt_pointer)
9uintptr_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}