[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
+3 -3
View File
@@ -459,13 +459,13 @@ int smscusb_fdt_fetch_mac ( struct smscusb_device *smscusb ) {
int rc;
/* Look for "ethernet[0]" alias */
if ( ( rc = fdt_alias ( "ethernet", &offset ) != 0 ) &&
( rc = fdt_alias ( "ethernet0", &offset ) != 0 ) ) {
if ( ( rc = fdt_alias ( &sysfdt, "ethernet", &offset ) != 0 ) &&
( rc = fdt_alias ( &sysfdt, "ethernet0", &offset ) != 0 ) ) {
return rc;
}
/* Fetch MAC address */
if ( ( rc = fdt_mac ( offset, netdev ) ) != 0 )
if ( ( rc = fdt_mac ( &sysfdt, offset, netdev ) ) != 0 )
return rc;
DBGC ( smscusb, "SMSCUSB %p using FDT MAC %s\n",