提交 84cc1535 编写于 作者: M Morten H. Larsen 提交者: Matt Turner

alpha: Fix de2104x driver failing to readout MAC address correctly

This patch fixes a missing read memory barrier that is needed for the
driver to readout the MAC address correctly from the on-board ROM.
Also it replaces the use of the deprecated functions readl()/writel().
Signed-off-by: NMorten H. Larsen <m-larsen@post6.tele.dk>
Signed-off-by: NMatt Turner <mattst88@gmail.com>
上级 932e0c20
...@@ -367,8 +367,8 @@ static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; ...@@ -367,8 +367,8 @@ static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
#define dr32(reg) readl(de->regs + (reg)) #define dr32(reg) ioread32(de->regs + (reg))
#define dw32(reg,val) writel((val), de->regs + (reg)) #define dw32(reg, val) iowrite32((val), de->regs + (reg))
static void de_rx_err_acct (struct de_private *de, unsigned rx_tail, static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
...@@ -1706,6 +1706,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de) ...@@ -1706,6 +1706,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de)
int value, boguscnt = 100000; int value, boguscnt = 100000;
do { do {
value = dr32(ROMCmd); value = dr32(ROMCmd);
rmb();
} while (value < 0 && --boguscnt > 0); } while (value < 0 && --boguscnt > 0);
de->dev->dev_addr[i] = value; de->dev->dev_addr[i] = value;
udelay(1); udelay(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册