From: Tom Rini Date: Mon, 2 Nov 2015 18:25:16 -0500 Subject: [U-Boot] [PATCH v2 2/2] fdt: Rewrite the logic in fdt_fixup_ethernet() In-Reply-To: <1446451095-18495-2-git-send-email-bmeng.cn@gmail.com> References: <1446451095-18495-1-git-send-email-bmeng.cn@gmail.com> <1446451095-18495-2-git-send-email-bmeng.cn@gmail.com> Message-ID: <20151102232516.GC8499@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, Nov 01, 2015 at 11:58:15PM -0800, Bin Meng wrote: > Currently in fdt_fixup_ethernet() the MAC address fix up is > handled in a loop of which the exit condition is to test the > "eth%daddr" env is not NULL. However this creates unnecessary > constrains that those "eth%daddr" env variables must be > sequential even if "ethernet%d" does not start from 0 in the > "/aliases" node. For example, with "/aliases" node below: > > aliases { > ethernet3 = &enet3; > ethernet4 = &enet4; > }; > > "ethaddr", "eth1addr", "eth2addr" must exist in order to fix > up ethernet3's MAC address successfully. > > Now we change the loop logic to iterate the properties in the > "/aliases" node. For each property, test if it is in a format > of "ethernet%d", then get its MAC address from corresponding > "eth%daddr" env and fix it up in the dtb. > > Signed-off-by: Bin Meng > Reviewed-by: Tom Rini > Acked-by: Joe Hershberger > Reviewed-by: Tom Rini On OMAP4 Panda (+v4.3 kernel) Tested-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: