Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy/micrel: change phy_id_mask for KSZ9021 and KS8001

On a freescale imx6q platform, a hardware phy chip KSZ9021 is
recognized as a KS8001 chip by the current driver like this:
eth0: Freescale FEC PHY driver [Micrel KS8001 or KS8721]

KSZ9021 has phy_id 0x00221610, while KSZ8001 has phy_id
0x0022161a, the current phy_id_mask (0x00fffff0/0x00ffff10) can't
distinguish them. So change phy_id_mask to resolve this problem.

Although the micrel datasheet says that the 4 LSB of phyid2 register
contains the chip revision number and the current driver is designed
to follow this rule, in reality the chip implementation doesn't follow
it.

Cc: David J. Choi <david.choi@micrel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Hui Wang <jason77.wang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jason Wang and committed by
David S. Miller
48d7d0ad 39d84a58

+4 -4
+4 -4
drivers/net/phy/micrel.c
··· 161 161 static struct phy_driver ks8001_driver = { 162 162 .phy_id = PHY_ID_KS8001, 163 163 .name = "Micrel KS8001 or KS8721", 164 - .phy_id_mask = 0x00fffff0, 164 + .phy_id_mask = 0x00ffffff, 165 165 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 166 166 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 167 167 .config_init = kszphy_config_init, ··· 174 174 175 175 static struct phy_driver ksz9021_driver = { 176 176 .phy_id = PHY_ID_KSZ9021, 177 - .phy_id_mask = 0x000fff10, 177 + .phy_id_mask = 0x000ffffe, 178 178 .name = "Micrel KSZ9021 Gigabit PHY", 179 179 .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause 180 180 | SUPPORTED_Asym_Pause), ··· 240 240 MODULE_LICENSE("GPL"); 241 241 242 242 static struct mdio_device_id __maybe_unused micrel_tbl[] = { 243 - { PHY_ID_KSZ9021, 0x000fff10 }, 244 - { PHY_ID_KS8001, 0x00fffff0 }, 243 + { PHY_ID_KSZ9021, 0x000ffffe }, 244 + { PHY_ID_KS8001, 0x00ffffff }, 245 245 { PHY_ID_KS8737, 0x00fffff0 }, 246 246 { PHY_ID_KS8041, 0x00fffff0 }, 247 247 { PHY_ID_KS8051, 0x00fffff0 },