LXT971 driver in the phy lib
Subsystems (2)
Hello,
I try to get an network interface running that has an LXT971A[1].
If I apply the following patch, the target can detect the phy.
drivers/net/phy/lxt.c +2 -2
@@ -137,9 +137,9 @@ static struct phy_driver lxt970_driver = };static struct phy_driver lxt971_driver = { - .phy_id =0x0001378e , + .phy_id =0x001378e0 , .name ="LXT971" , - .phy_id_mask =0x0fffffff , + .phy_id_mask =0xfffffff0 , .features =PHY_BASIC_FEATURES , .flags =PHY_HAS_INTERRUPT , .config_aneg = genphy_config_aneg,
According to
http://www.intel.com/design/network/products/LAN/datashts/24941402.pdf
page 90f the id registers yield 0x001378eX (with X being current revision ID)
uzeisberger@io:~/gsrc/linux-2.6$ git grep -i 1378e drivers/net/ drivers/net/arm/at91_ether.h:#define MII_LXT971A_ID 0x001378E0 drivers/net/e1000/e1000_hw.h:#define L1LXT971A_PHY_ID 0x001378E0 drivers/net/fec.c: .id = 0x0001378e, drivers/net/fec_8xx/fec_mii.c: .id = 0x0001378e, drivers/net/phy/lxt.c: .phy_id = 0x0001378e,
So both variants occur more than once. (I only took a quick glance at the usage of these ids, but I think they all use it in the same way. That is, ID1 << 16 | ID2.)
"My" phy reports 0x001378e2 and now I wonder if there are different chips out there with the same name.
Can anybody explain this mismatch to me? (Or point me to the right query for google.)
Best regards
Uwe
[1] Actually it's an LXT972A, but that only means my phy lacks four address pins. Nothing software has to handle.
Signature · 5 lines
Uwe Zeisberger FS Forth-Systeme GmbH, A Digi International Company Kueferstrasse 8, D-79206 Breisach, Germany Phone: +49 (7667) 908 0 Fax: +49 (7667) 908 200 Web: www.fsforth.de, www.digi.com
Quoted 12 lines · Uwe Zeisberger
Hello,
I try to get an network interface running that has an LXT971A[1].
If I apply the following patch, the target can detect the phy.
drivers/net/phy/lxt.c +0
-0@@ -137,9 +137,9 @@ static struct phy_driver lxt970_driver = };
drivers/net/phy/lxt.c static struct phy_driver lxt970_driver = · line 145
Quoted 10 lines
drivers/net/phy/lxt.c +2
-2static struct phy_driver lxt971_driver = { - .phy_id =0x0001378e , + .phy_id =0x001378e0 , .name ="LXT971" , - .phy_id_mask =0x0fffffff , + .phy_id_mask =0xfffffff0 , .features =PHY_BASIC_FEATURES , .flags =PHY_HAS_INTERRUPT , .config_aneg = genphy_config_aneg,
This looks good.
Quoted 9 lines
According to
http://www.intel.com/design/network/products/LAN/datashts/
24941402.pdfpage 90f the id registers yield 0x001378eX (with X being current revision ID)
Quoted 6 lines
uzeisberger@io:~/gsrc/linux-2.6$ git grep -i 1378e drivers/net/ drivers/net/arm/at91_ether.h:#define MII_LXT971A_ID 0x001378E0 drivers/net/e1000/e1000_hw.h:#define L1LXT971A_PHY_ID 0x001378E0 drivers/net/fec.c: .id = 0x0001378e, drivers/net/fec_8xx/fec_mii.c: .id = 0x0001378e, drivers/net/phy/lxt.c: .phy_id = 0x0001378e,
The fec.c and fec_mii.c drivers used a shift by 4 to chop off the end of the ID. When the PHY Layer switched to using a mask, not all of the drivers got properly switched.
Quoted 4 lines
So both variants occur more than once. (I only took a quick glance at the usage of these ids, but I think they all use it in the same way. That is, ID1 << 16 | ID2.)
The fec-style drivers do this:
if(phy_info[i]->id == (fep->phy_id >> 4))
Anyway, your patch is correct.
Quoted 6 lines
"My" phy reports
0x001378e2and now I wonder if there are different chips out there with the same name.Can anybody explain this mismatch to me? (Or point me to the right query for google.)
PATCH 1/1 Fix phy id for LXT971A/LXT972A
---
drivers/net/phy/lxt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
4406e908ff6896400290bb4ae1337c8cfa589f15
drivers/net/phy/lxt.c +2 -2
@@ -137,9 +137,9 @@ static struct phy_driver lxt970_driver = };static struct phy_driver lxt971_driver = { - .phy_id =0x0001378e , + .phy_id =0x001378e0 , .name ="LXT971" , - .phy_id_mask =0x0fffffff , + .phy_id_mask =0xfffffff0 , .features =PHY_BASIC_FEATURES , .flags =PHY_HAS_INTERRUPT , .config_aneg = genphy_config_aneg,
Signature · 9 lines
1.3.2.g25a9 -- Uwe Zeisberger FS Forth-Systeme GmbH, A Digi International Company Kueferstrasse 8, D-79206 Breisach, Germany Phone: +49 (7667) 908 0 Fax: +49 (7667) 908 200 Web: www.fsforth.de, www.digi.com