Commit 58dbc691 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

r6040: use MAC_RST bit definition with MCR1 read/writes

MAC_RST bit is already defined, use it instead of 0x1 where applicable.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e16d6eb
...@@ -371,7 +371,7 @@ static void r6040_init_mac_regs(struct net_device *dev) ...@@ -371,7 +371,7 @@ static void r6040_init_mac_regs(struct net_device *dev)
iowrite16(MAC_RST, ioaddr + MCR1); iowrite16(MAC_RST, ioaddr + MCR1);
while (limit--) { while (limit--) {
cmd = ioread16(ioaddr + MCR1); cmd = ioread16(ioaddr + MCR1);
if (cmd & 0x1) if (cmd & MAC_RST)
break; break;
} }
/* Reset internal state machine */ /* Reset internal state machine */
...@@ -453,7 +453,7 @@ static void r6040_down(struct net_device *dev) ...@@ -453,7 +453,7 @@ static void r6040_down(struct net_device *dev)
iowrite16(MAC_RST, ioaddr + MCR1); /* Reset RDC MAC */ iowrite16(MAC_RST, ioaddr + MCR1); /* Reset RDC MAC */
while (limit--) { while (limit--) {
cmd = ioread16(ioaddr + MCR1); cmd = ioread16(ioaddr + MCR1);
if (cmd & 0x1) if (cmd & MAC_RST)
break; break;
} }
...@@ -735,7 +735,7 @@ static void r6040_mac_address(struct net_device *dev) ...@@ -735,7 +735,7 @@ static void r6040_mac_address(struct net_device *dev)
u16 *adrp; u16 *adrp;
/* MAC operation register */ /* MAC operation register */
iowrite16(0x01, ioaddr + MCR1); /* Reset MAC */ iowrite16(MAC_RST, ioaddr + MCR1); /* Reset MAC */
iowrite16(2, ioaddr + MAC_SM); /* Reset internal state machine */ iowrite16(2, ioaddr + MAC_SM); /* Reset internal state machine */
iowrite16(0, ioaddr + MAC_SM); iowrite16(0, ioaddr + MAC_SM);
mdelay(5); mdelay(5);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment