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 <christian.dreher@nanoxplore.com>
This commit is contained in:
Christian DREHER
2026-04-28 20:04:06 +02:00
committed by Jerome Forissier
parent 9e23095298
commit 361bb8f827

View File

@@ -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;
}