1 From 7de26bf144f6a72858ab60afb2bd2b43265ee0ad Mon Sep 17 00:00:00 2001
2 From: Sean Anderson <sean.anderson@seco.com>
3 Date: Tue, 20 Sep 2022 18:12:34 -0400
4 Subject: [PATCH] net: phy: aquantia: Add some additional phy interfaces
6 These are documented in the AQR115 register reference. I haven't tested
7 them, but perhaps they'll be useful to someone.
9 Signed-off-by: Sean Anderson <sean.anderson@seco.com>
10 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 drivers/net/phy/aquantia_main.c | 17 ++++++++++++++++-
14 1 file changed, 16 insertions(+), 1 deletion(-)
16 --- a/drivers/net/phy/aquantia_main.c
17 +++ b/drivers/net/phy/aquantia_main.c
19 #define MDIO_PHYXS_VEND_IF_STATUS 0xe812
20 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3)
21 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0
22 +#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1
23 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2
24 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3
25 +#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4
26 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6
27 +#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7
28 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10
30 #define MDIO_AN_VEND_PROV 0xc400
31 @@ -401,15 +404,24 @@ static int aqr107_read_status(struct phy
32 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR:
33 phydev->interface = PHY_INTERFACE_MODE_10GKR;
35 + case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX:
36 + phydev->interface = PHY_INTERFACE_MODE_1000BASEKX;
38 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI:
39 phydev->interface = PHY_INTERFACE_MODE_10GBASER;
41 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII:
42 phydev->interface = PHY_INTERFACE_MODE_USXGMII;
44 + case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI:
45 + phydev->interface = PHY_INTERFACE_MODE_XAUI;
47 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII:
48 phydev->interface = PHY_INTERFACE_MODE_SGMII;
50 + case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI:
51 + phydev->interface = PHY_INTERFACE_MODE_RXAUI;
53 case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII:
54 phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
56 @@ -522,11 +534,14 @@ static int aqr107_config_init(struct phy
58 /* Check that the PHY interface type is compatible */
59 if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
60 + phydev->interface != PHY_INTERFACE_MODE_1000BASEKX &&
61 phydev->interface != PHY_INTERFACE_MODE_2500BASEX &&
62 phydev->interface != PHY_INTERFACE_MODE_XGMII &&
63 phydev->interface != PHY_INTERFACE_MODE_USXGMII &&
64 phydev->interface != PHY_INTERFACE_MODE_10GKR &&
65 - phydev->interface != PHY_INTERFACE_MODE_10GBASER)
66 + phydev->interface != PHY_INTERFACE_MODE_10GBASER &&
67 + phydev->interface != PHY_INTERFACE_MODE_XAUI &&
68 + phydev->interface != PHY_INTERFACE_MODE_RXAUI)
71 WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII,