@@ -57,9 +57,15 @@ static void __macb_set_hwaddr(struct macb *bp)
u16 top;
bottom = cpu_to_le32(*((u32 *)bp->dev->dev_addr));
- macb_writel(bp, SA1B, bottom);
top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
- macb_writel(bp, SA1T, top);
+
+ if (!bp->is_gem) {
+ macb_writel(bp, SA1B, bottom);
+ macb_writel(bp, SA1T, top);
+ } else {
+ gem_writel(bp, SA1B, bottom);
+ gem_writel(bp, SA1T, top);
+ }
}
static void __init macb_get_hwaddr(struct macb *bp)
@@ -68,8 +74,13 @@ static void __init macb_get_hwaddr(struct macb *bp)
u16 top;
u8 addr[6];
- bottom = macb_readl(bp, SA1B);
- top = macb_readl(bp, SA1T);
+ if (!bp->is_gem) {
+ bottom = macb_readl(bp, SA1B);
+ top = macb_readl(bp, SA1T);
+ } else {
+ bottom = gem_readl(bp, SA1B);
+ top = gem_readl(bp, SA1T);
+ }
addr[0] = bottom & 0xff;
addr[1] = (bottom >> 8) & 0xff;
@@ -60,6 +60,10 @@
#define MACB_USRIO 0x00c0
#define MACB_WOL 0x00c4
+/* GEM register offsets. */
+#define GEM_SA1B 0x0088
+#define GEM_SA1T 0x008C
+
/* Bitfields in NCR */
#define MACB_LB_OFFSET 0
#define MACB_LB_SIZE 1
GEM has it's hardware address registers in a different location to MACB so we need to make this conditional on type. Signed-off-by: Jamie Iles <jamie@jamieiles.com> --- drivers/net/macb.c | 19 +++++++++++++++---- drivers/net/macb.h | 4 ++++ 2 files changed, 19 insertions(+), 4 deletions(-)