b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From: Roman Kuzmitskii <damex.pp@icloud.com> |
| 2 | Date: Thu, 05 Nov 2020 02:00:00 +0000 |
| 3 | Subject: [PATCH] net: phy: vitesse: add vsc8504 support |
| 4 | |
| 5 | This patch adds support for vsc8504 phy. |
| 6 | That phy is changed owner: |
| 7 | vitesse -> microsemi -> microchip |
| 8 | So is its driver in kernel was changed and rewritten. |
| 9 | |
| 10 | there is no need to upstream this patch. |
| 11 | this vsc8504 is supported by newer kernels out of box. |
| 12 | support could be enabled by CONFIG_MICROSEMI_PHY. |
| 13 | |
| 14 | Tested-by: Johannes Kimmel <fff@bareminimum.eu> |
| 15 | Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com> |
| 16 | --- a/drivers/net/phy/vitesse.c |
| 17 | +++ b/drivers/net/phy/vitesse.c |
| 18 | @@ -61,6 +61,7 @@ |
| 19 | |
| 20 | #define PHY_ID_VSC8234 0x000fc620 |
| 21 | #define PHY_ID_VSC8244 0x000fc6c0 |
| 22 | +#define PHY_ID_VSC8504 0x000704c2 |
| 23 | #define PHY_ID_VSC8572 0x000704d0 |
| 24 | #define PHY_ID_VSC8601 0x00070420 |
| 25 | #define PHY_ID_VSC7385 0x00070450 |
| 26 | @@ -292,6 +293,7 @@ static int vsc82xx_config_intr(struct ph |
| 27 | err = phy_write(phydev, MII_VSC8244_IMASK, |
| 28 | (phydev->drv->phy_id == PHY_ID_VSC8234 || |
| 29 | phydev->drv->phy_id == PHY_ID_VSC8244 || |
| 30 | + phydev->drv->phy_id == PHY_ID_VSC8504 || |
| 31 | phydev->drv->phy_id == PHY_ID_VSC8572 || |
| 32 | phydev->drv->phy_id == PHY_ID_VSC8601) ? |
| 33 | MII_VSC8244_IMASK_MASK : |
| 34 | @@ -402,6 +404,15 @@ static struct phy_driver vsc82xx_driver[ |
| 35 | .ack_interrupt = &vsc824x_ack_interrupt, |
| 36 | .config_intr = &vsc82xx_config_intr, |
| 37 | }, { |
| 38 | + .phy_id = PHY_ID_VSC8504, |
| 39 | + .name = "Vitesse VSC8504", |
| 40 | + .phy_id_mask = 0x000ffff0, |
| 41 | + /* PHY_GBIT_FEATURES */ |
| 42 | + .config_init = &vsc824x_config_init, |
| 43 | + .config_aneg = &vsc82x4_config_aneg, |
| 44 | + .ack_interrupt = &vsc824x_ack_interrupt, |
| 45 | + .config_intr = &vsc82xx_config_intr, |
| 46 | +}, { |
| 47 | .phy_id = PHY_ID_VSC8572, |
| 48 | .name = "Vitesse VSC8572", |
| 49 | .phy_id_mask = 0x000ffff0, |
| 50 | @@ -488,6 +499,7 @@ module_phy_driver(vsc82xx_driver); |
| 51 | static struct mdio_device_id __maybe_unused vitesse_tbl[] = { |
| 52 | { PHY_ID_VSC8234, 0x000ffff0 }, |
| 53 | { PHY_ID_VSC8244, 0x000fffc0 }, |
| 54 | + { PHY_ID_VSC8504, 0x000ffff0 }, |
| 55 | { PHY_ID_VSC8572, 0x000ffff0 }, |
| 56 | { PHY_ID_VSC7385, 0x000ffff0 }, |
| 57 | { PHY_ID_VSC7388, 0x000ffff0 }, |