Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157383216
D56782.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56782.diff
View Options
diff --git a/sys/dev/eqos/if_eqos_starfive.c b/sys/dev/eqos/if_eqos_starfive.c
--- a/sys/dev/eqos/if_eqos_starfive.c
+++ b/sys/dev/eqos/if_eqos_starfive.c
@@ -17,6 +17,7 @@
#include <sys/socket.h>
#include <machine/bus.h>
+#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
@@ -40,6 +41,7 @@
#define JH7110_CSR_FREQ 198000000
#define WR4(sc, o, v) bus_write_4(sc->base.res[EQOS_RES_MEM], (o), (v))
+#define RD4(sc, o) bus_read_4(sc->base.res[EQOS_RES_MEM], (o))
static const struct ofw_compat_data compat_data[] = {
{"starfive,jh7110-dwmac", 1},
@@ -131,6 +133,8 @@
struct if_eqos_starfive_softc *sc = device_get_softc(dev);
hwreset_t rst_ahb, rst_stmmaceth;
phandle_t node;
+ uint8_t eaddr[ETHER_ADDR_LEN];
+ uint32_t maclo, machi;
node = ofw_bus_get_node(dev);
@@ -186,6 +190,14 @@
return (ENXIO);
}
+ if (OF_getprop(node, "local-mac-address", eaddr, sizeof(eaddr)) ==
+ sizeof(eaddr)) {
+ machi = eaddr[5] | (eaddr[4] << 8);
+ WR4(sc, GMAC_MAC_ADDRESS0_HIGH, machi);
+ maclo = eaddr[3] | (eaddr[2] << 8) | (eaddr[1] << 16) |
+ (eaddr[0] << 24);
+ WR4(sc, GMAC_MAC_ADDRESS0_LOW, maclo);
+ }
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 21, 8:40 PM (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33016038
Default Alt Text
D56782.diff (1 KB)
Attached To
Mode
D56782: Correctly set the MAC address for ethernet interfaces on Starfive VisionFiv2 2, riscv64 SBC
Attached
Detach File
Event Timeline
Log In to Comment