git: deedeb1e4160 - main - awg: Use the MAC address of the FDT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Nov 2026 11:17:32 UTC
The branch main has been updated by manu:
URL: https://cgit.FreeBSD.org/src/commit/?id=deedeb1e4160509f0074d0055340c130c72466ce
commit deedeb1e4160509f0074d0055340c130c72466ce
Author: Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-13 10:46:33 +0000
Commit: Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-13 11:17:07 +0000
awg: Use the MAC address of the FDT
The firmware gives the MAC address of the controller in the FDT, in the
mac-address or local-mac-address property. awg(4) only used the address
in the registers, which is set when the firmware used the controller,
and the one created from the SID. On the Pine H64 the firmware does not
initialise the Ethernet and the SID driver does not support the H6, so a
random address was created and it changed at every boot.
Use fdt_ether_get_addr(), it takes the address of the FDT and keeps the
current one when there is none.
Tested on: H6
---
sys/arm/allwinner/if_awg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c
index 3459779743ba..24956c124580 100644
--- a/sys/arm/allwinner/if_awg.c
+++ b/sys/arm/allwinner/if_awg.c
@@ -51,6 +51,8 @@
#include <machine/bus.h>
+#include <dev/fdt/fdt_common.h>
+
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -1992,6 +1994,9 @@ awg_attach(device_t dev)
return (error);
}
+ /* The MAC address of the FDT, if any, is the one to use */
+ fdt_ether_get_addr(ofw_bus_get_node(dev), sc->ifp, eaddr);
+
/* Attach ethernet interface */
ether_ifattach(sc->ifp, eaddr);