summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian DREHER <[email protected]>2026-04-28 20:04:06 +0200
committerJerome Forissier <[email protected]>2026-05-06 11:07:22 +0200
commit361bb8f827b094cfff6adb56fc247e8d847209cd (patch)
tree49ae67a44345f6ff91ec139e40f3fdbdf850c5ca
parent9e23095298d12e086dd3d5d35972eb3e588d190d (diff)
net: macb: use SA1 for MAC filtering on GEM
The MACB uses specific address registers (SA Top and Bottom) to filter source or destination MAC addresses. On the Gigabit Ethernet version, SA1B is @0x88. On the non-GEM version, SA1B is @0x98. Before this commit, the code was always writing 0x98. By chance, on GEM, this is the address of SA3B, allowing the driver to work anyway. The motivation for this change is to be able to use the driver on an instance of the GEM with less than 4 SA registers. Signed-off-by: Christian DREHER <[email protected]>
-rw-r--r--drivers/net/macb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 719aef39a3f..807a038e071 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1007,9 +1007,14 @@ static int _macb_write_hwaddr(struct macb_device *macb, unsigned char *enetaddr)
/* set hardware address */
hwaddr_bottom = enetaddr[0] | enetaddr[1] << 8 |
enetaddr[2] << 16 | enetaddr[3] << 24;
- macb_writel(macb, SA1B, hwaddr_bottom);
hwaddr_top = enetaddr[4] | enetaddr[5] << 8;
- macb_writel(macb, SA1T, hwaddr_top);
+ if (macb_is_gem(macb)) {
+ gem_writel(macb, SA1B, hwaddr_bottom);
+ gem_writel(macb, SA1T, hwaddr_top);
+ } else {
+ macb_writel(macb, SA1B, hwaddr_bottom);
+ macb_writel(macb, SA1T, hwaddr_top);
+ }
return 0;
}