
On Thu, Feb 09, 2023 at 06:07:04PM +0200, Ioana Ciornei wrote:
In the process of adopting CONFIG_DM_ETH on the DPAA2 based platforms, interfaces which were previously defined as "xgmii" were transitioned to be defined as "xfi" in the DTS. See the commit below for reference: commit 87274918f2f4 ("arm: dts: ls2088ardb: add DPMAC and PHY nodes")
Then Vladimir's commit replaced all occurrences of "xfi" with "10gbase-r" in an effort to make U-Boot work with the same device tree as Linux. commit 77b11f760416 ("net: replace the "xfi" phy-mode with "10gbase-r"")
These changes to the phy_interface_t of an Ethernet port meant that the mc_fixup_mac_addrs() function was no longer capable to properly fixup the MAC addresses. The problem arises from the fact that the hardcoded information about an interface (wriop_get_enet_if()) was no longer matching any actual device.
For example, the function tried to search for "DPMAC1@xgmii1" by name using eth_get_dev_by_name() when only "DPMAC1@10gbase-r" was available.
This function removes the need to rely on the hardcoded information by iterating through all the UCLASS_ETH devices which are DPAA2 and request a fixup for each of them.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com Reviewed-by: Ramon Fried rfried.dev@gmail.com
Applied to u-boot/master, thanks!