de2104x: disable autonegotiation on broken hardware
Subsystems (2)
PATCH 1/1 de2104x: disable autonegotiation on broken hardware
At least on older 21041-AA chips (mine is rev. 11), TP duplex autonegotiation causes the card not to work at all (link is up but no packets are transmitted).
de4x5 disables autonegotiation completely. But it seems to work on newer (21041-PA rev. 21) so disable it only on rev<20 chips.
drivers/net/tulip/de2104x.c +10 -2
@@ -364,6 +364,8 @@ static u16 t21040_csr15[] = { 0, 0, 0x00/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ static u16 t21041_csr13[] = {0xEF01 ,0xEF09 ,0xEF09 ,0xEF01 ,0xEF09 , };static u16 t21041_csr14[] = {0xFFFF ,0xF7FD ,0xF7FD ,0x6F3F ,0x6F3D , }; +/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ +static u16 t21041_csr14_brk[] = {0xFF3F ,0xF7FD ,0xF7FD ,0x6F3F ,0x6F3D , };static u16 t21041_csr15[] = {0x0008 ,0x0006 ,0x000E ,0x0008 ,0x0008 , };
@@ -1911,8 +1913,14 @@ fill_defaults:for (i =0 ; i <DE_MAX_MEDIA ; i++) {if (de->media[i].csr13 ==0xffff ) de->media[i].csr13 = t21041_csr13[i]; -if (de->media[i].csr14 ==0xffff ) - de->media[i].csr14 = t21041_csr14[i]; +if (de->media[i].csr14 ==0xffff ) { +/* autonegotiation is broken at least on some chip +revisions - rev. 0x21 works, 0x11 does not */ +if (de->pdev->revision <0x20 ) + de->media[i].csr14 = t21041_csr14_brk[i]; +else + de->media[i].csr14 = t21041_csr14[i]; + }if (de->media[i].csr15 ==0xffff ) de->media[i].csr15 = t21041_csr15[i]; }
Signature · 1 line
Ondrej Zary
Quoted 23 lines · Ondrej Zary
At least on older 21041-AA chips (mine is rev. 11), TP duplex autonegotiation causes the card not to work at all (link is up but no packets are transmitted).
de4x5 disables autonegotiation completely. But it seems to work on newer (21041-PA rev. 21) so disable it only on rev<20 chips.
Signed-off-by Ondrej Zary <[email protected]>drivers/net/tulip/de2104x.c 2010-09-24 00:27:41.000000000 +0200 renamed from drivers/net/tulip/de2104x.c 2010-08-29 17:36:04.000000000 +0200 +2
-0@@ -364,6 +364,8 @@ static u16 t21040_csr15[] = { 0, 0, 0x00 /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; +/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ +static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };@@ -1911,8 +1913,14 @@ fill_defaults: for (i = 0; i < DE_MAX_MEDIA; i++) { if (de->media[i].csr13 == 0xffff) de->media[i].csr13 = t21041_csr13[i];
drivers/net/tulip/de2104x.c 2010-09-24 00:27:41.000000000 +0200 fill_defaults: · line 1923
Quoted 10 lines
drivers/net/tulip/de2104x.c 2010-09-24 00:27:41.000000000 +0200 renamed from drivers/net/tulip/de2104x.c 2010-08-29 17:36:04.000000000 +0200 +8
-2- if (de->media[i].csr14 == 0xffff) - de->media[i].csr14 = t21041_csr14[i]; + if (de->media[i].csr14 == 0xffff) { + /* autonegotiation is broken at least on some chip + revisions - rev. 0x21 works, 0x11 does not */ + if (de->pdev->revision < 0x20) + de->media[i].csr14 = t21041_csr14_brk[i]; + else + de->media[i].csr14 = t21041_csr14[i]; + }
Interesting... I never knew about that quirk.
Quoted 1 line · On Thursday 23 September 2010 23:03:13 Jeff Garzik wrote:
On Thu, Sep 23, 2010 at 4:59 PM, Ondrej Zary <[email protected]>
Quoted 22 lines · wrote:
Quoted 22 lines
At least on older 21041-AA chips (mine is rev. 11), TP duplex autonegotiation causes the card not to work at all (link is up but no packets are transmitted).
de4x5 disables autonegotiation completely. But it seems to work on newer (21041-PA rev. 21) so disable it only on rev<20 chips.
Signed-off-by Ondrej Zary <[email protected]>---
linux-2.6.36-rc3-orig/drivers/net/tulip/de2104x.c2010-08-29 17:36:04.000000000 +0200 +++linux-2.6.36-rc3/drivers/net/tulip/de2104x.c2010-09-24 00:27:41.000000000 +0200 @@ -364,6 +364,8 @@ static u16t21040_csr15[] = { 0, 0,
0x00
/* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ static u16 t21041_csr13[] = {0xEF01,0xEF09,0xEF09,0xEF01,0xEF09, }; static u16 t21041_csr14[] = {0xFFFF,0xF7FD,0xF7FD,0x6F3F,0x6F3D, }; +/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ +static u16 t21041_csr14_brk[] = {0xFF3F,0xF7FD,0xF7FD,0x6F3F,0x6F3D, }; static u16 t21041_csr15[] = {0x0008,0x0006,0x000E,0x0008,0x0008, };
Quoted 16 lines
Quoted 8 lines
drivers/net/tulip/de2104x.c +2
-2@@ -1911,8 +1913,14 @@ fill_defaults: for (i = 0; i < DE_MAX_MEDIA; i++) { if (de->media[i].csr13 == 0xffff) de->media[i].csr13 = t21041_csr13[i]; - if (de->media[i].csr14 == 0xffff) - de->media[i].csr14 = t21041_csr14[i]; + if (de->media[i].csr14 == 0xffff) { + /* autonegotiation is broken at least on someQuoted 6 lines
chip + revisions - rev.
0x21works,0x11does not */ + if (de->pdev->revision<0x20)
+ de->media[i].csr14 = t21041_csr14_brk[i];
+ else
+ de->media[i].csr14 = t21041_csr14[i];
+ }Interesting... I never knew about that quirk.
This errata document says that autonegotiation is somehow broken but it does not specify it further:
http://ftp.nluug.nl/ftp/ftp/pub/os/NetBSD/misc/dec-docs/ec-qd2ma-te.ps.gz
Signature · 1 line
Ondrej Zary
From: Ondrej Zary <[email protected]>
Date: Thu, 23 Sep 2010 23:18:08 +0200
Quoted 11 lines · On Thursday 23 September 2010 23:03:13 Jeff Garzik wrote:
Quoted 1 line
On Thu, Sep 23, 2010 at 4:59 PM, Ondrej Zary <[email protected]>
Quoted 8 lines · wrote:
Quoted 8 lines
At least on older 21041-AA chips (mine is rev. 11), TP duplex autonegotiation causes the card not to work at all (link is up but no packets are transmitted).
de4x5 disables autonegotiation completely. But it seems to work on newer (21041-PA rev. 21) so disable it only on rev<20 chips.
Signed-off-by Ondrej Zary <[email protected]>
...
Quoted 5 lines
Quoted 1 line
Interesting... I never knew about that quirk.
This errata document says that autonegotiation is somehow broken but it does not specify it further:
http://ftp.nluug.nl/ftp/ftp/pub/os/NetBSD/misc/dec-docs/ec-qd2ma-te.ps.gz
Applied, thanks guys!