aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/phy/micrel.c27
-rw-r--r--include/linux/micrel_phy.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index cf287e0eb408..e8e00dc087f1 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
110static 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
104static int ks8051_config_init(struct phy_device *phydev) 117static int ks8051_config_init(struct phy_device *phydev)
105{ 118{
106 int regval; 119 int regval;
@@ -128,6 +141,19 @@ 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}, {
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}, {
131 .phy_id = PHY_ID_KS8041, 157 .phy_id = PHY_ID_KS8041,
132 .phy_id_mask = 0x00fffff0, 158 .phy_id_mask = 0x00fffff0,
133 .name = "Micrel KS8041", 159 .name = "Micrel KS8041",
@@ -203,6 +229,7 @@ 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_KS8001, 0x00ffffff },
205 { PHY_ID_KS8737, 0x00fffff0 }, 231 { PHY_ID_KS8737, 0x00fffff0 },
232 { PHY_ID_KSZ8021, 0x00ffffff },
206 { PHY_ID_KS8041, 0x00fffff0 }, 233 { PHY_ID_KS8041, 0x00fffff0 },
207 { PHY_ID_KS8051, 0x00fffff0 }, 234 { PHY_ID_KS8051, 0x00fffff0 },
208 { } 235 { }
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 61f0905bdc48..be7f366e37f0 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -5,6 +5,7 @@
5 5
6#define PHY_ID_KSZ9021 0x00221610 6#define PHY_ID_KSZ9021 0x00221610
7#define PHY_ID_KS8737 0x00221720 7#define PHY_ID_KS8737 0x00221720
8#define PHY_ID_KSZ8021 0x00221555
8#define PHY_ID_KS8041 0x00221510 9#define PHY_ID_KS8041 0x00221510
9#define PHY_ID_KS8051 0x00221550 10#define PHY_ID_KS8051 0x00221550
10/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ 11/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */