developer | 33759cf | 2024-10-11 15:19:50 +0800 | [diff] [blame^] | 1 | From 2b6996b2827db88d87ad28e0c28cbe7382eb375c Mon Sep 17 00:00:00 2001 |
| 2 | From: "neal.yen" <neal.yen@mediatek.com> |
| 3 | Date: Mon, 12 Aug 2024 16:32:48 +0800 |
| 4 | Subject: [PATCH] 999-2745-drivers-net-phy-mxl862xx-mxl-gpy |
| 5 | |
| 6 | --- |
| 7 | drivers/net/phy/mxl-gpy.c | 28 ++++++++++++++++++++++++++++ |
| 8 | 1 file changed, 28 insertions(+) |
| 9 | |
| 10 | diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c |
| 11 | index 7304278..988eb77 100644 |
| 12 | --- a/drivers/net/phy/mxl-gpy.c |
| 13 | +++ b/drivers/net/phy/mxl-gpy.c |
| 14 | @@ -14,6 +14,7 @@ |
| 15 | /* PHY ID */ |
| 16 | #define PHY_ID_GPYx15B_MASK 0xFFFFFFFC |
| 17 | #define PHY_ID_GPY21xB_MASK 0xFFFFFFF9 |
| 18 | +#define PHY_ID_MXL862XX_MASK 0xFFFFFF00 |
| 19 | #define PHY_ID_GPY2xx 0x67C9DC00 |
| 20 | #define PHY_ID_GPY115B 0x67C9DF00 |
| 21 | #define PHY_ID_GPY115C 0x67C9DF10 |
| 22 | @@ -26,6 +27,7 @@ |
| 23 | #define PHY_ID_GPY241B 0x67C9DE40 |
| 24 | #define PHY_ID_GPY241BM 0x67C9DE80 |
| 25 | #define PHY_ID_GPY245B 0x67C9DEC0 |
| 26 | +#define PHY_ID_MXL862XX 0xC1335500 |
| 27 | |
| 28 | #define PHY_MIISTAT 0x18 /* MII state */ |
| 29 | #define PHY_IMASK 0x19 /* interrupt mask */ |
| 30 | @@ -504,6 +506,15 @@ static int gpy115_loopback(struct phy_device *phydev, bool enable) |
| 31 | return genphy_soft_reset(phydev); |
| 32 | } |
| 33 | |
| 34 | +static int gpy_c45_pma_read_abilities(struct phy_device *phydev) |
| 35 | +{ |
| 36 | + phydev->c45_ids.devices_in_package |= MDIO_DEVS_AN; |
| 37 | + |
| 38 | + genphy_c45_pma_read_abilities(phydev); |
| 39 | + |
| 40 | + return 0; |
| 41 | +} |
| 42 | + |
| 43 | static struct phy_driver gpy_drivers[] = { |
| 44 | { |
| 45 | PHY_ID_MATCH_MODEL(PHY_ID_GPY2xx), |
| 46 | @@ -713,6 +724,22 @@ static struct phy_driver gpy_drivers[] = { |
| 47 | .get_wol = gpy_get_wol, |
| 48 | .set_loopback = gpy_loopback, |
| 49 | }, |
| 50 | + { |
| 51 | + .phy_id = PHY_ID_MXL862XX, |
| 52 | + .phy_id_mask = PHY_ID_MXL862XX_MASK, |
| 53 | + .name = "MaxLinear Ethernet MxL862XX", |
| 54 | + .get_features = gpy_c45_pma_read_abilities, |
| 55 | + .config_init = gpy_config_init, |
| 56 | + .probe = gpy_probe, |
| 57 | + .suspend = genphy_suspend, |
| 58 | + .resume = genphy_resume, |
| 59 | + .config_aneg = gpy_config_aneg, |
| 60 | + .aneg_done = genphy_c45_aneg_done, |
| 61 | + .read_status = gpy_read_status, |
| 62 | + .config_intr = gpy_config_intr, |
| 63 | + .handle_interrupt = gpy_handle_interrupt, |
| 64 | + .set_loopback = gpy_loopback, |
| 65 | + }, |
| 66 | }; |
| 67 | module_phy_driver(gpy_drivers); |
| 68 | |
| 69 | @@ -729,6 +756,7 @@ static struct mdio_device_id __maybe_unused gpy_tbl[] = { |
| 70 | {PHY_ID_MATCH_MODEL(PHY_ID_GPY241B)}, |
| 71 | {PHY_ID_MATCH_MODEL(PHY_ID_GPY241BM)}, |
| 72 | {PHY_ID_MATCH_MODEL(PHY_ID_GPY245B)}, |
| 73 | + {PHY_ID_MXL862XX, PHY_ID_MXL862XX_MASK}, |
| 74 | { } |
| 75 | }; |
| 76 | MODULE_DEVICE_TABLE(mdio, gpy_tbl); |
| 77 | -- |
| 78 | 2.45.2 |
| 79 | |