diff options
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/bcm87xx.c | 2 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 45 | ||||
-rw-r--r-- | drivers/net/phy/smsc.c | 28 |
3 files changed, 65 insertions, 10 deletions
diff --git a/drivers/net/phy/bcm87xx.c b/drivers/net/phy/bcm87xx.c index 2346b38b983..799789518e8 100644 --- a/drivers/net/phy/bcm87xx.c +++ b/drivers/net/phy/bcm87xx.c | |||
@@ -229,3 +229,5 @@ static void __exit bcm87xx_exit(void) | |||
229 | ARRAY_SIZE(bcm87xx_driver)); | 229 | ARRAY_SIZE(bcm87xx_driver)); |
230 | } | 230 | } |
231 | module_exit(bcm87xx_exit); | 231 | module_exit(bcm87xx_exit); |
232 | |||
233 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index cf287e0eb40..2165d5fdb8c 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -21,6 +21,12 @@ | |||
21 | #include <linux/phy.h> | 21 | #include <linux/phy.h> |
22 | #include <linux/micrel_phy.h> | 22 | #include <linux/micrel_phy.h> |
23 | 23 | ||
24 | /* Operation Mode Strap Override */ | ||
25 | #define MII_KSZPHY_OMSO 0x16 | ||
26 | #define KSZPHY_OMSO_B_CAST_OFF (1 << 9) | ||
27 | #define KSZPHY_OMSO_RMII_OVERRIDE (1 << 1) | ||
28 | #define KSZPHY_OMSO_MII_OVERRIDE (1 << 0) | ||
29 | |||
24 | /* general Interrupt control/status reg in vendor specific block. */ | 30 | /* general Interrupt control/status reg in vendor specific block. */ |
25 | #define MII_KSZPHY_INTCS 0x1B | 31 | #define MII_KSZPHY_INTCS 0x1B |
26 | #define KSZPHY_INTCS_JABBER (1 << 15) | 32 | #define KSZPHY_INTCS_JABBER (1 << 15) |
@@ -101,6 +107,13 @@ static int kszphy_config_init(struct phy_device *phydev) | |||
101 | return 0; | 107 | return 0; |
102 | } | 108 | } |
103 | 109 | ||
110 | static int ksz8021_config_init(struct phy_device *phydev) | ||
111 | { | ||
112 | const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE; | ||
113 | phy_write(phydev, MII_KSZPHY_OMSO, val); | ||
114 | return 0; | ||
115 | } | ||
116 | |||
104 | static int ks8051_config_init(struct phy_device *phydev) | 117 | static int ks8051_config_init(struct phy_device *phydev) |
105 | { | 118 | { |
106 | int regval; | 119 | int regval; |
@@ -128,9 +141,22 @@ static struct phy_driver ksphy_driver[] = { | |||
128 | .config_intr = ks8737_config_intr, | 141 | .config_intr = ks8737_config_intr, |
129 | .driver = { .owner = THIS_MODULE,}, | 142 | .driver = { .owner = THIS_MODULE,}, |
130 | }, { | 143 | }, { |
131 | .phy_id = PHY_ID_KS8041, | 144 | .phy_id = PHY_ID_KSZ8021, |
145 | .phy_id_mask = 0x00ffffff, | ||
146 | .name = "Micrel KSZ8021", | ||
147 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | | ||
148 | SUPPORTED_Asym_Pause), | ||
149 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | ||
150 | .config_init = ksz8021_config_init, | ||
151 | .config_aneg = genphy_config_aneg, | ||
152 | .read_status = genphy_read_status, | ||
153 | .ack_interrupt = kszphy_ack_interrupt, | ||
154 | .config_intr = kszphy_config_intr, | ||
155 | .driver = { .owner = THIS_MODULE,}, | ||
156 | }, { | ||
157 | .phy_id = PHY_ID_KSZ8041, | ||
132 | .phy_id_mask = 0x00fffff0, | 158 | .phy_id_mask = 0x00fffff0, |
133 | .name = "Micrel KS8041", | 159 | .name = "Micrel KSZ8041", |
134 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 160 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
135 | | SUPPORTED_Asym_Pause), | 161 | | SUPPORTED_Asym_Pause), |
136 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | 162 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, |
@@ -141,9 +167,9 @@ static struct phy_driver ksphy_driver[] = { | |||
141 | .config_intr = kszphy_config_intr, | 167 | .config_intr = kszphy_config_intr, |
142 | .driver = { .owner = THIS_MODULE,}, | 168 | .driver = { .owner = THIS_MODULE,}, |
143 | }, { | 169 | }, { |
144 | .phy_id = PHY_ID_KS8051, | 170 | .phy_id = PHY_ID_KSZ8051, |
145 | .phy_id_mask = 0x00fffff0, | 171 | .phy_id_mask = 0x00fffff0, |
146 | .name = "Micrel KS8051", | 172 | .name = "Micrel KSZ8051", |
147 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 173 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
148 | | SUPPORTED_Asym_Pause), | 174 | | SUPPORTED_Asym_Pause), |
149 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | 175 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, |
@@ -154,8 +180,8 @@ static struct phy_driver ksphy_driver[] = { | |||
154 | .config_intr = kszphy_config_intr, | 180 | .config_intr = kszphy_config_intr, |
155 | .driver = { .owner = THIS_MODULE,}, | 181 | .driver = { .owner = THIS_MODULE,}, |
156 | }, { | 182 | }, { |
157 | .phy_id = PHY_ID_KS8001, | 183 | .phy_id = PHY_ID_KSZ8001, |
158 | .name = "Micrel KS8001 or KS8721", | 184 | .name = "Micrel KSZ8001 or KS8721", |
159 | .phy_id_mask = 0x00ffffff, | 185 | .phy_id_mask = 0x00ffffff, |
160 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), | 186 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), |
161 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | 187 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, |
@@ -201,10 +227,11 @@ MODULE_LICENSE("GPL"); | |||
201 | 227 | ||
202 | static struct mdio_device_id __maybe_unused micrel_tbl[] = { | 228 | static struct mdio_device_id __maybe_unused micrel_tbl[] = { |
203 | { PHY_ID_KSZ9021, 0x000ffffe }, | 229 | { PHY_ID_KSZ9021, 0x000ffffe }, |
204 | { PHY_ID_KS8001, 0x00ffffff }, | 230 | { PHY_ID_KSZ8001, 0x00ffffff }, |
205 | { PHY_ID_KS8737, 0x00fffff0 }, | 231 | { PHY_ID_KS8737, 0x00fffff0 }, |
206 | { PHY_ID_KS8041, 0x00fffff0 }, | 232 | { PHY_ID_KSZ8021, 0x00ffffff }, |
207 | { PHY_ID_KS8051, 0x00fffff0 }, | 233 | { PHY_ID_KSZ8041, 0x00fffff0 }, |
234 | { PHY_ID_KSZ8051, 0x00fffff0 }, | ||
208 | { } | 235 | { } |
209 | }; | 236 | }; |
210 | 237 | ||
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 6d6192316b3..88e3991464e 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c | |||
@@ -56,6 +56,32 @@ static int smsc_phy_config_init(struct phy_device *phydev) | |||
56 | return smsc_phy_ack_interrupt (phydev); | 56 | return smsc_phy_ack_interrupt (phydev); |
57 | } | 57 | } |
58 | 58 | ||
59 | static int lan87xx_config_init(struct phy_device *phydev) | ||
60 | { | ||
61 | /* | ||
62 | * Make sure the EDPWRDOWN bit is NOT set. Setting this bit on | ||
63 | * LAN8710/LAN8720 PHY causes the PHY to misbehave, likely due | ||
64 | * to a bug on the chip. | ||
65 | * | ||
66 | * When the system is powered on with the network cable being | ||
67 | * disconnected all the way until after ifconfig ethX up is | ||
68 | * issued for the LAN port with this PHY, connecting the cable | ||
69 | * afterwards does not cause LINK change detection, while the | ||
70 | * expected behavior is the Link UP being detected. | ||
71 | */ | ||
72 | int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); | ||
73 | if (rc < 0) | ||
74 | return rc; | ||
75 | |||
76 | rc &= ~MII_LAN83C185_EDPWRDOWN; | ||
77 | |||
78 | rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, rc); | ||
79 | if (rc < 0) | ||
80 | return rc; | ||
81 | |||
82 | return smsc_phy_ack_interrupt(phydev); | ||
83 | } | ||
84 | |||
59 | static int lan911x_config_init(struct phy_device *phydev) | 85 | static int lan911x_config_init(struct phy_device *phydev) |
60 | { | 86 | { |
61 | return smsc_phy_ack_interrupt(phydev); | 87 | return smsc_phy_ack_interrupt(phydev); |
@@ -162,7 +188,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
162 | /* basic functions */ | 188 | /* basic functions */ |
163 | .config_aneg = genphy_config_aneg, | 189 | .config_aneg = genphy_config_aneg, |
164 | .read_status = genphy_read_status, | 190 | .read_status = genphy_read_status, |
165 | .config_init = smsc_phy_config_init, | 191 | .config_init = lan87xx_config_init, |
166 | 192 | ||
167 | /* IRQ related */ | 193 | /* IRQ related */ |
168 | .ack_interrupt = smsc_phy_ack_interrupt, | 194 | .ack_interrupt = smsc_phy_ack_interrupt, |