[fdt] Allow for the existence of multiple device trees

When running on a platform that uses FDT as its hardware description
mechanism, we are likely to have multiple device tree structures.  At
a minimum, there will be the device tree passed to us from the
previous boot stage (e.g. OpenSBI), and the device tree that we
construct to be passed to the booted operating system.

Update the internal FDT API to include an FDT pointer in all function
parameter lists.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-03-28 12:42:30 +00:00
parent 09fbebc084
commit 2399c79980
7 changed files with 120 additions and 109 deletions

View File

@@ -53,9 +53,9 @@ static void efi_fdt_init ( void ) {
}
DBGC ( &efi_fdt, "EFIFDT configuration table at %p\n", efi_fdt );
/* Register device tree */
if ( ( rc = register_fdt ( efi_fdt ) ) != 0 ) {
DBGC ( &efi_fdt, "EFIFDT could not register: %s\n",
/* Parse as system device tree */
if ( ( rc = fdt_parse ( &sysfdt, efi_fdt ) ) != 0 ) {
DBGC ( &efi_fdt, "EFIFDT could not parse: %s\n",
strerror ( rc ) );
return;
}