netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support
@ 2020-12-30 12:53 Marek Vasut
  2020-12-30 12:53 ` [PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY Marek Vasut
  2020-12-30 15:43 ` [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support Andrew Lunn
  0 siblings, 2 replies; 10+ messages in thread
From: Marek Vasut @ 2020-12-30 12:53 UTC (permalink / raw)
  To: netdev; +Cc: Marek Vasut, Andrew Lunn, Heiner Kallweit, Lukas Wunner

The KS8851 has a reduced internal PHY, which is accessible through its
registers at offset 0xe4. The PHY is compatible with KS886x PHY present
in Micrel switches, except the PHY ID Low/High registers are swapped.
Add PHY ID for this KS8851 PHY and use custom PHY ID mask due to the swap.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Lukas Wunner <lukas@wunner.de>
To: netdev@vger.kernel.org
---
 drivers/net/phy/micrel.c   | 9 +++++++++
 include/linux/micrel_phy.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 54e0d75203da..ca6da128e37a 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -1386,6 +1386,14 @@ static struct phy_driver ksphy_driver[] = {
 	.read_status	= ksz8873mll_read_status,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
+}, {
+	.phy_id		= PHY_ID_KSZ8851,
+	.phy_id_mask	= 0xfff000ff,
+	.name		= "Micrel KSZ8851 Ethernet MAC",
+	/* PHY_BASIC_FEATURES */
+	.config_init	= kszphy_config_init,
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
 }, {
 	.phy_id		= PHY_ID_KSZ886X,
 	.phy_id_mask	= MICREL_PHY_ID_MASK,
@@ -1432,6 +1440,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = {
 	{ PHY_ID_KSZ8061, MICREL_PHY_ID_MASK },
 	{ PHY_ID_KSZ8081, MICREL_PHY_ID_MASK },
 	{ PHY_ID_KSZ8873MLL, MICREL_PHY_ID_MASK },
+	{ PHY_ID_KSZ8851, 0xfff000ff },
 	{ PHY_ID_KSZ886X, MICREL_PHY_ID_MASK },
 	{ PHY_ID_LAN8814, MICREL_PHY_ID_MASK },
 	{ }
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 416ee6dd2574..1c26e4ac0dc9 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -29,6 +29,8 @@
 #define PHY_ID_KSZ9131		0x00221640
 #define PHY_ID_LAN8814		0x00221660
 
+/* The PHY ID Low/High registers are swapped on KSZ8851 */
+#define PHY_ID_KSZ8851		0x14300022
 #define PHY_ID_KSZ886X		0x00221430
 #define PHY_ID_KSZ8863		0x00221435
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-03 18:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 12:53 [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support Marek Vasut
2020-12-30 12:53 ` [PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY Marek Vasut
2020-12-30 16:00   ` Andrew Lunn
2021-01-03 12:58     ` Marek Vasut
2021-01-03 16:25       ` Andrew Lunn
2020-12-31  1:23   ` kernel test robot
2020-12-30 15:43 ` [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support Andrew Lunn
2021-01-03 12:55   ` Marek Vasut
2021-01-03 16:55     ` Andrew Lunn
2021-01-03 18:44       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).