aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/phy/micrel.c44
-rw-r--r--include/linux/micrel_phy.h1
2 files changed, 45 insertions, 0 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 2165d5fdb8c0..b983596abcbb 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -127,6 +127,39 @@ static int ks8051_config_init(struct phy_device *phydev)
127 return 0; 127 return 0;
128} 128}
129 129
130#define KSZ8873MLL_GLOBAL_CONTROL_4 0x06
131#define KSZ8873MLL_GLOBAL_CONTROL_4_DUPLEX (1 << 6)
132#define KSZ8873MLL_GLOBAL_CONTROL_4_SPEED (1 << 4)
133int ksz8873mll_read_status(struct phy_device *phydev)
134{
135 int regval;
136
137 /* dummy read */
138 regval = phy_read(phydev, KSZ8873MLL_GLOBAL_CONTROL_4);
139
140 regval = phy_read(phydev, KSZ8873MLL_GLOBAL_CONTROL_4);
141
142 if (regval & KSZ8873MLL_GLOBAL_CONTROL_4_DUPLEX)
143 phydev->duplex = DUPLEX_HALF;
144 else
145 phydev->duplex = DUPLEX_FULL;
146
147 if (regval & KSZ8873MLL_GLOBAL_CONTROL_4_SPEED)
148 phydev->speed = SPEED_10;
149 else
150 phydev->speed = SPEED_100;
151
152 phydev->link = 1;
153 phydev->pause = phydev->asym_pause = 0;
154
155 return 0;
156}
157
158static int ksz8873mll_config_aneg(struct phy_device *phydev)
159{
160 return 0;
161}
162
130static struct phy_driver ksphy_driver[] = { 163static struct phy_driver ksphy_driver[] = {
131{ 164{
132 .phy_id = PHY_ID_KS8737, 165 .phy_id = PHY_ID_KS8737,
@@ -204,6 +237,16 @@ static struct phy_driver ksphy_driver[] = {
204 .ack_interrupt = kszphy_ack_interrupt, 237 .ack_interrupt = kszphy_ack_interrupt,
205 .config_intr = ksz9021_config_intr, 238 .config_intr = ksz9021_config_intr,
206 .driver = { .owner = THIS_MODULE, }, 239 .driver = { .owner = THIS_MODULE, },
240}, {
241 .phy_id = PHY_ID_KSZ8873MLL,
242 .phy_id_mask = 0x00fffff0,
243 .name = "Micrel KSZ8873MLL Switch",
244 .features = (SUPPORTED_Pause | SUPPORTED_Asym_Pause),
245 .flags = PHY_HAS_MAGICANEG,
246 .config_init = kszphy_config_init,
247 .config_aneg = ksz8873mll_config_aneg,
248 .read_status = ksz8873mll_read_status,
249 .driver = { .owner = THIS_MODULE, },
207} }; 250} };
208 251
209static int __init ksphy_init(void) 252static int __init ksphy_init(void)
@@ -232,6 +275,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = {
232 { PHY_ID_KSZ8021, 0x00ffffff }, 275 { PHY_ID_KSZ8021, 0x00ffffff },
233 { PHY_ID_KSZ8041, 0x00fffff0 }, 276 { PHY_ID_KSZ8041, 0x00fffff0 },
234 { PHY_ID_KSZ8051, 0x00fffff0 }, 277 { PHY_ID_KSZ8051, 0x00fffff0 },
278 { PHY_ID_KSZ8873MLL, 0x00fffff0 },
235 { } 279 { }
236}; 280};
237 281
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index de201203bc7c..adfe8c058f29 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -15,6 +15,7 @@
15 15
16#define MICREL_PHY_ID_MASK 0x00fffff0 16#define MICREL_PHY_ID_MASK 0x00fffff0
17 17
18#define PHY_ID_KSZ8873MLL 0x000e7237
18#define PHY_ID_KSZ9021 0x00221610 19#define PHY_ID_KSZ9021 0x00221610
19#define PHY_ID_KS8737 0x00221720 20#define PHY_ID_KS8737 0x00221720
20#define PHY_ID_KSZ8021 0x00221555 21#define PHY_ID_KSZ8021 0x00221555