| From 2b6996b2827db88d87ad28e0c28cbe7382eb375c Mon Sep 17 00:00:00 2001 |
| From: "neal.yen" <neal.yen@mediatek.com> |
| Date: Mon, 12 Aug 2024 16:32:48 +0800 |
| Subject: [PATCH] 999-2745-drivers-net-phy-mxl862xx-mxl-gpy |
| |
| --- |
| drivers/net/phy/mxl-gpy.c | 28 ++++++++++++++++++++++++++++ |
| 1 file changed, 28 insertions(+) |
| |
| diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c |
| index 7304278..988eb77 100644 |
| --- a/drivers/net/phy/mxl-gpy.c |
| +++ b/drivers/net/phy/mxl-gpy.c |
| @@ -14,6 +14,7 @@ |
| /* PHY ID */ |
| #define PHY_ID_GPYx15B_MASK 0xFFFFFFFC |
| #define PHY_ID_GPY21xB_MASK 0xFFFFFFF9 |
| +#define PHY_ID_MXL862XX_MASK 0xFFFFFF00 |
| #define PHY_ID_GPY2xx 0x67C9DC00 |
| #define PHY_ID_GPY115B 0x67C9DF00 |
| #define PHY_ID_GPY115C 0x67C9DF10 |
| @@ -26,6 +27,7 @@ |
| #define PHY_ID_GPY241B 0x67C9DE40 |
| #define PHY_ID_GPY241BM 0x67C9DE80 |
| #define PHY_ID_GPY245B 0x67C9DEC0 |
| +#define PHY_ID_MXL862XX 0xC1335500 |
| |
| #define PHY_MIISTAT 0x18 /* MII state */ |
| #define PHY_IMASK 0x19 /* interrupt mask */ |
| @@ -504,6 +506,15 @@ static int gpy115_loopback(struct phy_device *phydev, bool enable) |
| return genphy_soft_reset(phydev); |
| } |
| |
| +static int gpy_c45_pma_read_abilities(struct phy_device *phydev) |
| +{ |
| + phydev->c45_ids.devices_in_package |= MDIO_DEVS_AN; |
| + |
| + genphy_c45_pma_read_abilities(phydev); |
| + |
| + return 0; |
| +} |
| + |
| static struct phy_driver gpy_drivers[] = { |
| { |
| PHY_ID_MATCH_MODEL(PHY_ID_GPY2xx), |
| @@ -713,6 +724,22 @@ static struct phy_driver gpy_drivers[] = { |
| .get_wol = gpy_get_wol, |
| .set_loopback = gpy_loopback, |
| }, |
| + { |
| + .phy_id = PHY_ID_MXL862XX, |
| + .phy_id_mask = PHY_ID_MXL862XX_MASK, |
| + .name = "MaxLinear Ethernet MxL862XX", |
| + .get_features = gpy_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_loopback = gpy_loopback, |
| + }, |
| }; |
| module_phy_driver(gpy_drivers); |
| |
| @@ -729,6 +756,7 @@ static 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_MXL862XX, PHY_ID_MXL862XX_MASK}, |
| { } |
| }; |
| MODULE_DEVICE_TABLE(mdio, gpy_tbl); |
| -- |
| 2.45.2 |
| |