* [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C
@ 2025-11-22 13:32 Daniel Golle
2025-11-22 13:33 ` [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 Daniel Golle
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Daniel Golle @ 2025-11-22 13:32 UTC (permalink / raw)
To: Xu Liang, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-kernel
From: Chad Monroe <chad@monroe.io>
MxL86211C is a smaller and more efficient version of the GPY211C.
Add the PHY ID and phy_driver instance to the mxl-gpy driver.
Signed-off-by: Chad Monroe <chad@monroe.io>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2:
* add entry in MODULE_DEVICE_TABLE
* unify spelling
drivers/net/phy/mxl-gpy.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index 0c8dc16ee7bde..bea9072ac4a8d 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -30,6 +30,7 @@
#define PHY_ID_GPY241B 0x67C9DE40
#define PHY_ID_GPY241BM 0x67C9DE80
#define PHY_ID_GPY245B 0x67C9DEC0
+#define PHY_ID_MXL86211C 0xC1335400
#define PHY_CTL1 0x13
#define PHY_CTL1_MDICD BIT(3)
@@ -1268,6 +1269,28 @@ static struct phy_driver gpy_drivers[] = {
.get_wol = gpy_get_wol,
.set_loopback = gpy_loopback,
},
+ {
+ PHY_ID_MATCH_MODEL(PHY_ID_MXL86211C),
+ .name = "Maxlinear Ethernet MxL86211C",
+ .get_features = genphy_c45_pma_read_abilities,
+ .config_init = gpy_config_init,
+ .probe = gpy_probe,
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ .config_aneg = gpy_config_aneg,
+ .aneg_done = genphy_c45_aneg_done,
+ .read_status = gpy_read_status,
+ .config_intr = gpy_config_intr,
+ .handle_interrupt = gpy_handle_interrupt,
+ .set_wol = gpy_set_wol,
+ .get_wol = gpy_get_wol,
+ .set_loopback = gpy_loopback,
+ .led_brightness_set = gpy_led_brightness_set,
+ .led_hw_is_supported = gpy_led_hw_is_supported,
+ .led_hw_control_get = gpy_led_hw_control_get,
+ .led_hw_control_set = gpy_led_hw_control_set,
+ .led_polarity_set = gpy_led_polarity_set,
+ },
};
module_phy_driver(gpy_drivers);
@@ -1284,6 +1307,7 @@ static const struct mdio_device_id __maybe_unused gpy_tbl[] = {
{PHY_ID_MATCH_MODEL(PHY_ID_GPY241B)},
{PHY_ID_MATCH_MODEL(PHY_ID_GPY241BM)},
{PHY_ID_MATCH_MODEL(PHY_ID_GPY245B)},
+ {PHY_ID_MATCH_MODEL(PHY_ID_MXL86211C)},
{ }
};
MODULE_DEVICE_TABLE(mdio, gpy_tbl);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 2025-11-22 13:32 [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Daniel Golle @ 2025-11-22 13:33 ` Daniel Golle 2025-11-23 23:57 ` Andrew Lunn 2025-11-23 23:56 ` [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Andrew Lunn 2025-11-26 3:20 ` patchwork-bot+netdevbpf 2 siblings, 1 reply; 5+ messages in thread From: Daniel Golle @ 2025-11-22 13:33 UTC (permalink / raw) To: Xu Liang, Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel Add PHY driver support for Maxlinear MxL86252 and MxL86282 switches. The PHYs built-into those switches are just like any other GPY 2.5G PHYs with the exception of the temperature sensor data being encoded in a different way. Signed-off-by: Daniel Golle <daniel@makrotopia.org> --- v2: * drop change in gpy_update_interface(), it has been merged as a separate patch via net tree * add dedicated PHY-ID for each product drivers/net/phy/mxl-gpy.c | 91 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c index bea9072ac4a8d..58d8dd718445c 100644 --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c @@ -31,6 +31,8 @@ #define PHY_ID_GPY241BM 0x67C9DE80 #define PHY_ID_GPY245B 0x67C9DEC0 #define PHY_ID_MXL86211C 0xC1335400 +#define PHY_ID_MXL86252 0xC1335520 +#define PHY_ID_MXL86282 0xC1335500 #define PHY_CTL1 0x13 #define PHY_CTL1_MDICD BIT(3) @@ -200,6 +202,29 @@ static int gpy_hwmon_read(struct device *dev, return 0; } +static int mxl862x2_hwmon_read(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long *value) +{ + struct phy_device *phydev = dev_get_drvdata(dev); + long tmp; + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_TEMP_STA); + if (ret < 0) + return ret; + if (!ret) + return -ENODATA; + + tmp = (s16)ret; + tmp *= 78125; + tmp /= 10000; + + *value = tmp; + + return 0; +} + static umode_t gpy_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel) @@ -217,19 +242,35 @@ static const struct hwmon_ops gpy_hwmon_hwmon_ops = { .read = gpy_hwmon_read, }; +static const struct hwmon_ops mxl862x2_hwmon_hwmon_ops = { + .is_visible = gpy_hwmon_is_visible, + .read = mxl862x2_hwmon_read, +}; + static const struct hwmon_chip_info gpy_hwmon_chip_info = { .ops = &gpy_hwmon_hwmon_ops, .info = gpy_hwmon_info, }; +static const struct hwmon_chip_info mxl862x2_hwmon_chip_info = { + .ops = &mxl862x2_hwmon_hwmon_ops, + .info = gpy_hwmon_info, +}; + static int gpy_hwmon_register(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; + const struct hwmon_chip_info *info; struct device *hwmon_dev; + if (phy_id_compare_model(phydev->phy_id, PHY_ID_MXL86252) || + phy_id_compare_model(phydev->phy_id, PHY_ID_MXL86282)) + info = &mxl862x2_hwmon_chip_info; + else + info = &gpy_hwmon_chip_info; + hwmon_dev = devm_hwmon_device_register_with_info(dev, NULL, phydev, - &gpy_hwmon_chip_info, - NULL); + info, NULL); return PTR_ERR_OR_ZERO(hwmon_dev); } @@ -1291,6 +1332,50 @@ static struct phy_driver gpy_drivers[] = { .led_hw_control_set = gpy_led_hw_control_set, .led_polarity_set = gpy_led_polarity_set, }, + { + PHY_ID_MATCH_MODEL(PHY_ID_MXL86252), + .name = "MaxLinear Ethernet MxL86252", + .get_features = genphy_c45_pma_read_abilities, + .config_init = gpy_config_init, + .probe = gpy_probe, + .suspend = genphy_suspend, + .resume = genphy_resume, + .config_aneg = gpy_config_aneg, + .aneg_done = genphy_c45_aneg_done, + .read_status = gpy_read_status, + .config_intr = gpy_config_intr, + .handle_interrupt = gpy_handle_interrupt, + .set_wol = gpy_set_wol, + .get_wol = gpy_get_wol, + .set_loopback = gpy_loopback, + .led_brightness_set = gpy_led_brightness_set, + .led_hw_is_supported = gpy_led_hw_is_supported, + .led_hw_control_get = gpy_led_hw_control_get, + .led_hw_control_set = gpy_led_hw_control_set, + .led_polarity_set = gpy_led_polarity_set, + }, + { + PHY_ID_MATCH_MODEL(PHY_ID_MXL86282), + .name = "MaxLinear Ethernet MxL86282", + .get_features = genphy_c45_pma_read_abilities, + .config_init = gpy_config_init, + .probe = gpy_probe, + .suspend = genphy_suspend, + .resume = genphy_resume, + .config_aneg = gpy_config_aneg, + .aneg_done = genphy_c45_aneg_done, + .read_status = gpy_read_status, + .config_intr = gpy_config_intr, + .handle_interrupt = gpy_handle_interrupt, + .set_wol = gpy_set_wol, + .get_wol = gpy_get_wol, + .set_loopback = gpy_loopback, + .led_brightness_set = gpy_led_brightness_set, + .led_hw_is_supported = gpy_led_hw_is_supported, + .led_hw_control_get = gpy_led_hw_control_get, + .led_hw_control_set = gpy_led_hw_control_set, + .led_polarity_set = gpy_led_polarity_set, + }, }; module_phy_driver(gpy_drivers); @@ -1308,6 +1393,8 @@ static const struct mdio_device_id __maybe_unused gpy_tbl[] = { {PHY_ID_MATCH_MODEL(PHY_ID_GPY241BM)}, {PHY_ID_MATCH_MODEL(PHY_ID_GPY245B)}, {PHY_ID_MATCH_MODEL(PHY_ID_MXL86211C)}, + {PHY_ID_MATCH_MODEL(PHY_ID_MXL86252)}, + {PHY_ID_MATCH_MODEL(PHY_ID_MXL86282)}, { } }; MODULE_DEVICE_TABLE(mdio, gpy_tbl); -- 2.52.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 2025-11-22 13:33 ` [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 Daniel Golle @ 2025-11-23 23:57 ` Andrew Lunn 0 siblings, 0 replies; 5+ messages in thread From: Andrew Lunn @ 2025-11-23 23:57 UTC (permalink / raw) To: Daniel Golle Cc: Xu Liang, Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel On Sat, Nov 22, 2025 at 01:33:47PM +0000, Daniel Golle wrote: > Add PHY driver support for Maxlinear MxL86252 and MxL86282 switches. > The PHYs built-into those switches are just like any other GPY 2.5G PHYs > with the exception of the temperature sensor data being encoded in a > different way. > > Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C 2025-11-22 13:32 [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Daniel Golle 2025-11-22 13:33 ` [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 Daniel Golle @ 2025-11-23 23:56 ` Andrew Lunn 2025-11-26 3:20 ` patchwork-bot+netdevbpf 2 siblings, 0 replies; 5+ messages in thread From: Andrew Lunn @ 2025-11-23 23:56 UTC (permalink / raw) To: Daniel Golle Cc: Xu Liang, Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel On Sat, Nov 22, 2025 at 01:32:15PM +0000, Daniel Golle wrote: > From: Chad Monroe <chad@monroe.io> > > MxL86211C is a smaller and more efficient version of the GPY211C. > Add the PHY ID and phy_driver instance to the mxl-gpy driver. > > Signed-off-by: Chad Monroe <chad@monroe.io> > Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C 2025-11-22 13:32 [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Daniel Golle 2025-11-22 13:33 ` [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 Daniel Golle 2025-11-23 23:56 ` [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Andrew Lunn @ 2025-11-26 3:20 ` patchwork-bot+netdevbpf 2 siblings, 0 replies; 5+ messages in thread From: patchwork-bot+netdevbpf @ 2025-11-26 3:20 UTC (permalink / raw) To: Daniel Golle Cc: lxu, andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev, linux-kernel Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Sat, 22 Nov 2025 13:32:15 +0000 you wrote: > From: Chad Monroe <chad@monroe.io> > > MxL86211C is a smaller and more efficient version of the GPY211C. > Add the PHY ID and phy_driver instance to the mxl-gpy driver. > > Signed-off-by: Chad Monroe <chad@monroe.io> > Signed-off-by: Daniel Golle <daniel@makrotopia.org> > > [...] Here is the summary with links: - [net-next,v2,1/2] net: phy: mxl-gpy: add support for MxL86211C https://git.kernel.org/netdev/net-next/c/9d844da693d6 - [net-next,v2,2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 https://git.kernel.org/netdev/net-next/c/de1e5c9333f4 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-11-26 3:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-22 13:32 [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Daniel Golle 2025-11-22 13:33 ` [PATCH net-next v2 2/2] net: phy: mxl-gpy: add support for MxL86252 and MxL86282 Daniel Golle 2025-11-23 23:57 ` Andrew Lunn 2025-11-23 23:56 ` [PATCH net-next v2 1/2] net: phy: mxl-gpy: add support for MxL86211C Andrew Lunn 2025-11-26 3:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox