| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From: Felix Fietkau <nbd@nbd.name> |
| 2 | Subject: net: phy: at803x: add support for AT8032 |
| 3 | |
| 4 | Like AT8030, this PHY needs the GPIO reset workaround |
| 5 | |
| 6 | Signed-off-by: Felix Fietkau <nbd@nbd.name> |
| 7 | --- |
| 8 | |
| 9 | --- a/drivers/net/phy/at803x.c |
| 10 | +++ b/drivers/net/phy/at803x.c |
| 11 | @@ -64,8 +64,10 @@ |
| 12 | |
| 13 | #define ATH8030_PHY_ID 0x004dd076 |
| 14 | #define ATH8031_PHY_ID 0x004dd074 |
| 15 | +#define ATH8032_PHY_ID 0x004dd023 |
| 16 | #define ATH8035_PHY_ID 0x004dd072 |
| 17 | #define AT803X_PHY_ID_MASK 0xffffffef |
| 18 | +#define AT8032_PHY_ID_MASK 0xffffffff |
| 19 | |
| 20 | MODULE_DESCRIPTION("Atheros 803x PHY driver"); |
| 21 | MODULE_AUTHOR("Matus Ujhelyi"); |
| 22 | @@ -314,7 +316,7 @@ static int at803x_config_intr(struct phy |
| 23 | static void at803x_link_change_notify(struct phy_device *phydev) |
| 24 | { |
| 25 | /* |
| 26 | - * Conduct a hardware reset for AT8030 every time a link loss is |
| 27 | + * Conduct a hardware reset for AT8030/2 every time a link loss is |
| 28 | * signalled. This is necessary to circumvent a hardware bug that |
| 29 | * occurs when the cable is unplugged while TX packets are pending |
| 30 | * in the FIFO. In such cases, the FIFO enters an error mode it |
| 31 | @@ -471,6 +473,24 @@ static struct phy_driver at803x_driver[] |
| 32 | .aneg_done = at803x_aneg_done, |
| 33 | .ack_interrupt = &at803x_ack_interrupt, |
| 34 | .config_intr = &at803x_config_intr, |
| 35 | +}, { |
| 36 | + /* ATHEROS 8032 */ |
| 37 | + .phy_id = ATH8032_PHY_ID, |
| 38 | + .name = "Atheros 8032 ethernet", |
| 39 | + .phy_id_mask = AT8032_PHY_ID_MASK, |
| 40 | + .probe = at803x_probe, |
| 41 | + .config_init = at803x_config_init, |
| 42 | + .link_change_notify = at803x_link_change_notify, |
| 43 | + .set_wol = at803x_set_wol, |
| 44 | + .get_wol = at803x_get_wol, |
| 45 | + .suspend = at803x_suspend, |
| 46 | + .resume = at803x_resume, |
| 47 | + /* PHY_BASIC_FEATURES */ |
| 48 | + .read_status = at803x_read_status, |
| 49 | + .config_aneg = genphy_config_aneg, |
| 50 | + .read_status = genphy_read_status, |
| 51 | + .ack_interrupt = at803x_ack_interrupt, |
| 52 | + .config_intr = at803x_config_intr, |
| 53 | } }; |
| 54 | |
| 55 | module_phy_driver(at803x_driver); |
| 56 | @@ -478,6 +498,7 @@ module_phy_driver(at803x_driver); |
| 57 | static struct mdio_device_id __maybe_unused atheros_tbl[] = { |
| 58 | { ATH8030_PHY_ID, AT803X_PHY_ID_MASK }, |
| 59 | { ATH8031_PHY_ID, AT803X_PHY_ID_MASK }, |
| 60 | + { ATH8032_PHY_ID, AT8032_PHY_ID_MASK }, |
| 61 | { ATH8035_PHY_ID, AT803X_PHY_ID_MASK }, |
| 62 | { } |
| 63 | }; |