I'm trying to track down where the initial MAC address is set during early boot when not explicitly set in the device tree, probably at driver-probe time.
The context is that compatible = "qcom,ipq4019-ess-edma"
is picking up a MAC address from the U-Boot environment if it is present, and assigning a seemingly random, locally administered MAC when not. In the case of the EA8300, the value in the U-Boot environment is "always" 00:03:7f:ba:db:ad
which can lead to MAC conflicts if multiples are present. (The "real" MAC address is in a different partition, strings /dev/mtdblock9
).
Working on transitioning to DSA, I'd like to clear this up at the same time.
I'd prefer not to alter the U-Boot environment on everybody's devices, especially silently. To be able to accomplish this, finding out where in the code the decision to read the U-Boot environment would be very helpful.
drivers/net/ethernet/qualcomm/ipqess/ipqess.c
has led me down a few rabbit holes.
static int __init ipqess_init(struct net_device *netdev)
{
struct ipqess *ess = netdev_priv(netdev);
struct device_node *of_node = ess->pdev->dev.of_node;
return phylink_of_phy_connect(ess->phylink, of_node, 0);
}
suggests to me that the MAC address is somehow merged into the run-time device tree. (I've confirmed that changing the U-Boot environment variable changes the MAC, as well as removing it results in a locally administered value).
Pointers would be greatly appreciated. TIA