From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=SPF record not found (domain: fensystems.co.uk, ip: 212.13.204.60, mailfrom: mbrown@fensystems.co.uk) Received: from duck.fensystems.co.uk (duck.fensystems.co.uk [212.13.204.60]) by groups.io with SMTP; Fri, 19 Jul 2019 10:29:39 -0700 Received: from pudding.home (unknown [IPv6:2001:470:1dbe:1:ffff::c5f1]) by duck.fensystems.co.uk (Postfix) with ESMTPSA id 1BC2B159FE; Fri, 19 Jul 2019 18:29:37 +0100 (BST) From: Michael Brown To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, pete@akeo.ie, Michael Brown Subject: [edk2-platforms: PATCH 1/1] Platform/RPi3: Accept "ethernet" or "ethernet0" aliases in device tree Date: Fri, 19 Jul 2019 18:29:07 +0100 Message-Id: <20190719172907.788170-2-mbrown@fensystems.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719172907.788170-1-mbrown@fensystems.co.uk> References: <20190719172907.788170-1-mbrown@fensystems.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Older device trees tend to use the alias "ethernet". Newer device trees tend to use "ethernet0" since older versions of U-Boot would skip aliases that do not include an index number. See, for example, Linux kernel commit 10b6c0c ("ARM: dts: bcm2835: add index to the ethernet alias") and U-Boot commit f8e57c6 ("fdt_support: Fixup 'ethernet' aliases not ending in digits"). Accept either "ethernet" or "ethernet0" as being the alias to the node for which the MAC address should be updated. Signed-off-by: Michael Brown --- Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c b/Platform= /RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c index 83446e3e45..e80bc2c391 100644 --- a/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c @@ -35,11 +35,14 @@ UpdateMacAddress ( UINT8 MacAddress[6]; =20 // - // Locate the node that the 'ethernet' alias refers to + // Locate the node that the 'ethernet[0]' alias refers to // Node =3D fdt_path_offset (mFdtImage, "ethernet"); if (Node < 0) { - DEBUG ((DEBUG_ERROR, "%a: failed to locate 'ethernet' alias\n", __FU= NCTION__)); + Node =3D fdt_path_offset (mFdtImage, "ethernet0"); + } + if (Node < 0) { + DEBUG ((DEBUG_ERROR, "%a: failed to locate 'ethernet[0]' alias\n", _= _FUNCTION__)); return; } =20 --=20 2.20.1