[PATCH 2/4] net: macb: use SA1 for MAC filtering on GEM
Christian DREHER via B4 Relay
devnull+christian.dreher.nanoxplore.com at kernel.org
Tue Apr 28 20:04:06 CEST 2026
From: Christian DREHER <christian.dreher at nanoxplore.com>
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 <christian.dreher at nanoxplore.com>
---
drivers/net/macb.c | 9 +++++++--
1 file 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;
}
--
2.47.3
More information about the U-Boot
mailing list