Since we have the function of_get_mac_address we can use it to set the default mac address vom the dts. Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx> --- net/eth.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/eth.c b/net/eth.c index 84f99d3aa8..baebf89d89 100644 --- a/net/eth.c +++ b/net/eth.c @@ -11,6 +11,7 @@ #include <net.h> #include <dma.h> #include <of.h> +#include <of_net.h> #include <linux/phy.h> #include <errno.h> #include <malloc.h> @@ -431,6 +432,14 @@ int eth_register(struct eth_device *edev) if (!ret) found = 1; + if (!found && edev->parent) { + const u8 *maddr = of_get_mac_address(edev->parent->device_node); + if (maddr) { + memcpy(ethaddr, maddr, ETH_ALEN); + found = 1; + } + } + if (!found) { ret = edev->get_ethaddr(edev, ethaddr); if (!ret) -- 2.29.2 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox