net/macb: clear unused address register
authorJoachim Eastwood <manabian@gmail.com>
Sun, 11 Nov 2012 13:56:28 +0000 (13:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Nov 2012 23:51:03 +0000 (18:51 -0500)
Only the first register set is used for matching but
we support getting the initial hw addr from any of
the registers.

To prevent stale entries and false matches clear unused
register sets. This most important for the at91_ether
driver where u-boot always uses the 2nd register set.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/cadence/macb.h

index ca34efc62baeed98b74dfbffc22a353d612491f1..edb2aba9045c0e182d7d8188731fb61646e88766 100644 (file)
@@ -108,6 +108,14 @@ void macb_set_hwaddr(struct macb *bp)
        macb_or_gem_writel(bp, SA1B, bottom);
        top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
        macb_or_gem_writel(bp, SA1T, top);
+
+       /* Clear unused address register sets */
+       macb_or_gem_writel(bp, SA2B, 0);
+       macb_or_gem_writel(bp, SA2T, 0);
+       macb_or_gem_writel(bp, SA3B, 0);
+       macb_or_gem_writel(bp, SA3T, 0);
+       macb_or_gem_writel(bp, SA4B, 0);
+       macb_or_gem_writel(bp, SA4T, 0);
 }
 EXPORT_SYMBOL_GPL(macb_set_hwaddr);
 
index 864e38042b2d9497d5cf8882afcee46435008663..44144218dd3751ac25b9bde316e12842176bf0ec 100644 (file)
 #define GEM_HRT                                        0x0084
 #define GEM_SA1B                               0x0088
 #define GEM_SA1T                               0x008C
+#define GEM_SA2B                               0x0090
+#define GEM_SA2T                               0x0094
+#define GEM_SA3B                               0x0098
+#define GEM_SA3T                               0x009C
+#define GEM_SA4B                               0x00A0
+#define GEM_SA4T                               0x00A4
 #define GEM_OTX                                        0x0100
 #define GEM_DCFG1                              0x0280
 #define GEM_DCFG2                              0x0284