From: Christian DREHER Date: Tue, 28 Apr 2026 18:04:06 +0000 (+0200) Subject: net: macb: use SA1 for MAC filtering on GEM X-Git-Tag: v2026.07-rc2~15^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=361bb8f827b094cfff6adb56fc247e8d847209cd;p=thirdparty%2Fu-boot.git 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 --- 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; }