]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: ocelot: accept 1000base-X for VSC9959 and VSC9953
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 10 May 2022 16:43:20 +0000 (19:43 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 May 2022 22:24:37 +0000 (15:24 -0700)
Switches using the Lynx PCS driver support 1000base-X optical SFP
modules. Accept this interface type on a port.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220510164320.10313-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/ocelot/felix.h
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/dsa/ocelot/seville_vsc9953.c

index a4882e493cf42906049db96e3c4154df08c1937c..f5c9d695408a3d1077a3cc8d30bb79b1121403c6 100644 (file)
@@ -1008,6 +1008,7 @@ static const u32 felix_phy_match_table[PHY_INTERFACE_MODE_MAX] = {
        [PHY_INTERFACE_MODE_SGMII] = OCELOT_PORT_MODE_SGMII,
        [PHY_INTERFACE_MODE_QSGMII] = OCELOT_PORT_MODE_QSGMII,
        [PHY_INTERFACE_MODE_USXGMII] = OCELOT_PORT_MODE_USXGMII,
+       [PHY_INTERFACE_MODE_1000BASEX] = OCELOT_PORT_MODE_1000BASEX,
        [PHY_INTERFACE_MODE_2500BASEX] = OCELOT_PORT_MODE_2500BASEX,
 };
 
index 39faf1027965202ddc1dc85c5ef080284ab97e4a..a5e570826773ef6fd4a82c9aa68a64cc37712cc8 100644 (file)
@@ -12,6 +12,7 @@
 #define OCELOT_PORT_MODE_QSGMII                BIT(2)
 #define OCELOT_PORT_MODE_2500BASEX     BIT(3)
 #define OCELOT_PORT_MODE_USXGMII       BIT(4)
+#define OCELOT_PORT_MODE_1000BASEX     BIT(5)
 
 /* Platform-specific information */
 struct felix_info {
index 081871824eaf98d110cecfe7086585fbb2c886bc..98caca4317d7656911c051a72e2a0bfe573da04e 100644 (file)
@@ -28,6 +28,7 @@
 
 #define VSC9959_PORT_MODE_SERDES       (OCELOT_PORT_MODE_SGMII | \
                                         OCELOT_PORT_MODE_QSGMII | \
+                                        OCELOT_PORT_MODE_1000BASEX | \
                                         OCELOT_PORT_MODE_2500BASEX | \
                                         OCELOT_PORT_MODE_USXGMII)
 
@@ -973,6 +974,7 @@ static void vsc9959_phylink_validate(struct ocelot *ocelot, int port,
        phylink_set(mask, 100baseT_Full);
        phylink_set(mask, 1000baseT_Half);
        phylink_set(mask, 1000baseT_Full);
+       phylink_set(mask, 1000baseX_Full);
 
        if (state->interface == PHY_INTERFACE_MODE_INTERNAL ||
            state->interface == PHY_INTERFACE_MODE_2500BASEX ||
index 48fd43a9336457a73223f56b8047f69d73a94f95..ea0649211356882c8aced655710cce6a190b6c5f 100644 (file)
@@ -21,7 +21,8 @@
 #define VSC9953_VCAP_POLICER_BASE2             120
 #define VSC9953_VCAP_POLICER_MAX2              161
 
-#define VSC9953_PORT_MODE_SERDES               (OCELOT_PORT_MODE_SGMII | \
+#define VSC9953_PORT_MODE_SERDES               (OCELOT_PORT_MODE_1000BASEX | \
+                                                OCELOT_PORT_MODE_SGMII | \
                                                 OCELOT_PORT_MODE_QSGMII)
 
 static const u32 vsc9953_port_modes[VSC9953_NUM_PORTS] = {
@@ -947,6 +948,7 @@ static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
        phylink_set(mask, 100baseT_Full);
        phylink_set(mask, 100baseT_Half);
        phylink_set(mask, 1000baseT_Full);
+       phylink_set(mask, 1000baseX_Full);
 
        if (state->interface == PHY_INTERFACE_MODE_INTERNAL) {
                phylink_set(mask, 2500baseT_Full);