mach-k3: common_fdt: create a reserved memory node

Some device trees may not have a reserved-memory node. Rather than
exiting early we should create a new reserved-memory node along with
the memory carveout for the firmware we (U-Boot) have placed.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
This commit is contained in:
Bryan Brattlof 2025-02-27 11:14:41 -06:00 committed by Tom Rini
parent 5c2ad07997
commit 096aa229a9

View File

@ -122,10 +122,8 @@ int fdt_fixup_reserved(void *blob, const char *name,
/* Find reserved-memory */ /* Find reserved-memory */
nodeoffset = fdt_subnode_offset(blob, 0, "reserved-memory"); nodeoffset = fdt_subnode_offset(blob, 0, "reserved-memory");
if (nodeoffset < 0) { if (nodeoffset < 0)
debug("Could not find reserved-memory node\n"); goto add_carveout;
return 0;
}
/* Find existing matching subnode and remove it */ /* Find existing matching subnode and remove it */
fdt_for_each_subnode(subnode, blob, nodeoffset) { fdt_for_each_subnode(subnode, blob, nodeoffset) {
@ -154,6 +152,7 @@ int fdt_fixup_reserved(void *blob, const char *name,
} }
} }
add_carveout:
struct fdt_memory carveout = { struct fdt_memory carveout = {
.start = new_address, .start = new_address,
.end = new_address + new_size - 1, .end = new_address + new_size - 1,