From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=cyoiJ/GX; spf=pass (domain: linaro.org, ip: 209.85.128.67, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by groups.io with SMTP; Tue, 23 Jul 2019 03:34:41 -0700 Received: by mail-wm1-f67.google.com with SMTP id f17so38011094wme.2 for ; Tue, 23 Jul 2019 03:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JXFb2Oz4vG54srUvVXe8pkWGmLfWC+ykdBAW1E4cQdY=; b=cyoiJ/GX4nznWhS6eAruqjekElwcT6i3DemErrac/uPnWws7zOTXzoqL+3jfnGSmWz +QPCxI2fSutyAtyUJXZzUZUwB8ZpdnJX4lNFauoo61exT6Kjgc7H7dolt38MNrDMGM08 sV5FHrwoHCB20GNJbpRbU/r7Zv8YE0qm3ATahvNjhdw7J/1NP3BrntbXBz+/BtTo/cry PE9UX5Z17n1xAhVy2qzHrjp4MaZ5Xlvh38JZV+LuJlGB30UY7LV1CuBr/OV6L9lPGQnR /TZDhJK//Bh08V3xDygJiy49W/pPRk78a9xrMqHvQTH/kxyBpnp9xviyb3EWzVelFqkp oyEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JXFb2Oz4vG54srUvVXe8pkWGmLfWC+ykdBAW1E4cQdY=; b=Q9zjUrrBB5WqmlfhgQ8IqpBP5LvTPKg4Xp4ekcCKog79V2ftzeYC6bt5Ge5IBkVHsW ADmHx2ZfJ/TjJLVN7+TPQ6tHs2ehTXV285Iru1Fx/ffTUeDLWV1nXxg0aGFSTe+HC/7F L/rwUVFkv1VPhnFIaBTR0zXQmfv88wESu5M/kPDsGr/goHQ3+T0JZiFOlI3YIIOlNzV7 RKDeFJRoJE1OyCJAeJl/dUy1yVbPlvSkQVTBbEvPuWnMAwN3o5tMYM30rktMOK3TBBHb P3kz6ITbuars+rag+vdjiGf6BI2Nh98uVRKsLOvtBkFevqYY1LYGwpnGg2K1QIwRVFhR WxOg== X-Gm-Message-State: APjAAAVEmNQJCC6CpqOcBuBv5EJ27hu9rEx6ae+W1nM9f68eFCqa3zHQ cQtkNWm3fLdxgX2fD1eHi9MeRw== X-Google-Smtp-Source: APXvYqw+DYu2EaTadLj0df7G6fVxa4QDM+W1mKDUTK+BvasNUTVT6q0YRVaBbFrUZXzY9F82zGnunQ== X-Received: by 2002:a05:600c:228b:: with SMTP id 11mr69943919wmf.26.1563878079625; Tue, 23 Jul 2019 03:34:39 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j10sm40956831wrw.96.2019.07.23.03.34.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:34:38 -0700 (PDT) Date: Tue, 23 Jul 2019 11:34:37 +0100 From: "Leif Lindholm" To: Michael Brown Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org, pete@akeo.ie Subject: Re: [edk2-platforms: PATCH 1/1] Platform/RPi3: Accept "ethernet" or "ethernet0" aliases in device tree Message-ID: <20190723103436.GF11541@bivouac.eciton.net> References: <20190719172907.788170-1-mbrown@fensystems.co.uk> <20190719172907.788170-2-mbrown@fensystems.co.uk> MIME-Version: 1.0 In-Reply-To: <20190719172907.788170-2-mbrown@fensystems.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jul 19, 2019 at 06:29:07PM +0100, Michael Brown wrote: > 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. Why is this patch useful? I understand the problem, but we include the .dtb from our own edk2-non-osi tree. And it seems that device tree already provides an alias to support both: https://github.com/tianocore/edk2-non-osi/blob/master/Platform/RaspberryPi/RPi3/DeviceTree/bcm2710-rpi-3-b.dts Would it be more useful to warn loudly if "ethernet" isn't present? (And just *replace* ethernet[0] with ethernet below.) Regards, Leif > 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]; > > // > - // Locate the node that the 'ethernet' alias refers to > + // Locate the node that the 'ethernet[0]' alias refers to > // > Node = fdt_path_offset (mFdtImage, "ethernet"); > if (Node < 0) { > - DEBUG ((DEBUG_ERROR, "%a: failed to locate 'ethernet' alias\n", __FUNCTION__)); > + Node = fdt_path_offset (mFdtImage, "ethernet0"); > + } > + if (Node < 0) { > + DEBUG ((DEBUG_ERROR, "%a: failed to locate 'ethernet[0]' alias\n", __FUNCTION__)); > return; > } > > -- > 2.20.1 >