}
 EXPORT_SYMBOL(b53_phylink_validate);
 
+static void b53_phylink_get_caps(struct dsa_switch *ds, int port,
+                                struct phylink_config *config)
+{
+       struct b53_device *dev = ds->priv;
+
+       /* Internal ports need GMII for PHYLIB */
+       __set_bit(PHY_INTERFACE_MODE_GMII, config->supported_interfaces);
+
+       /* These switches appear to support MII and RevMII too, but beyond
+        * this, the code gives very few clues. FIXME: We probably need more
+        * interface modes here.
+        */
+       __set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces);
+       __set_bit(PHY_INTERFACE_MODE_REVMII, config->supported_interfaces);
+
+       config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
+               MAC_10 | MAC_100;
+
+       /* 5325/5365 are not capable of gigabit speeds, everything else is */
+       if (!(is5325(dev) || is5365(dev)))
+               config->mac_capabilities |= MAC_1000;
+
+       /* Get the implementation specific capabilities */
+       if (dev->ops->phylink_get_caps)
+               dev->ops->phylink_get_caps(dev, port, config);
+}
+
 int b53_phylink_mac_link_state(struct dsa_switch *ds, int port,
                               struct phylink_link_state *state)
 {
        .phy_read               = b53_phy_read16,
        .phy_write              = b53_phy_write16,
        .adjust_link            = b53_adjust_link,
+       .phylink_get_caps       = b53_phylink_get_caps,
        .phylink_validate       = b53_phylink_validate,
        .phylink_mac_link_state = b53_phylink_mac_link_state,
        .phylink_mac_config     = b53_phylink_mac_config,
 
        int (*phy_write16)(struct b53_device *dev, int addr, int reg, u16 value);
        int (*irq_enable)(struct b53_device *dev, int port);
        void (*irq_disable)(struct b53_device *dev, int port);
+       void (*phylink_get_caps)(struct b53_device *dev, int port,
+                                struct phylink_config *config);
        u8 (*serdes_map_lane)(struct b53_device *dev, int port);
        int (*serdes_link_state)(struct b53_device *dev, int port,
                                 struct phylink_link_state *state);
 
 }
 EXPORT_SYMBOL(b53_serdes_phylink_validate);
 
+void b53_serdes_phylink_get_caps(struct b53_device *dev, int port,
+                                struct phylink_config *config)
+{
+       u8 lane = b53_serdes_map_lane(dev, port);
+
+       if (lane == B53_INVALID_LANE)
+               return;
+
+       switch (lane) {
+       case 0:
+               /* It appears lane 0 supports 2500base-X and 1000base-X */
+               __set_bit(PHY_INTERFACE_MODE_2500BASEX,
+                         config->supported_interfaces);
+               config->mac_capabilities |= MAC_2500FD;
+               fallthrough;
+       case 1:
+               /* It appears lane 1 only supports 1000base-X and SGMII */
+               __set_bit(PHY_INTERFACE_MODE_1000BASEX,
+                         config->supported_interfaces);
+               __set_bit(PHY_INTERFACE_MODE_SGMII,
+                         config->supported_interfaces);
+               config->mac_capabilities |= MAC_1000FD;
+               break;
+       default:
+               break;
+       }
+}
+EXPORT_SYMBOL(b53_serdes_phylink_get_caps);
+
 int b53_serdes_init(struct b53_device *dev, int port)
 {
        u8 lane = b53_serdes_map_lane(dev, port);
 
 void b53_serdes_an_restart(struct b53_device *dev, int port);
 void b53_serdes_link_set(struct b53_device *dev, int port, unsigned int mode,
                         phy_interface_t interface, bool link_up);
+void b53_serdes_phylink_get_caps(struct b53_device *dev, int port,
+                                struct phylink_config *config);
 void b53_serdes_phylink_validate(struct b53_device *dev, int port,
                                unsigned long *supported,
                                struct phylink_link_state *state);
 
        }
 }
 
+static void b53_srab_phylink_get_caps(struct b53_device *dev, int port,
+                                     struct phylink_config *config)
+{
+       struct b53_srab_priv *priv = dev->priv;
+       struct b53_srab_port_priv *p = &priv->port_intrs[port];
+
+       switch (p->mode) {
+       case PHY_INTERFACE_MODE_SGMII:
+#if IS_ENABLED(CONFIG_B53_SERDES)
+               /* If p->mode indicates SGMII mode, that essentially means we
+                * are using a serdes. As the serdes for the capabilities.
+                */
+               b53_serdes_phylink_get_caps(dev, port, config);
+#endif
+               break;
+
+       case PHY_INTERFACE_MODE_NA:
+               break;
+
+       case PHY_INTERFACE_MODE_RGMII:
+               /* If we support RGMII, support all RGMII modes, since
+                * that dictates the PHY delay settings.
+                */
+               phy_interface_set_rgmii(config->supported_interfaces);
+               break;
+
+       default:
+               /* Some other mode (e.g. MII, GMII etc) */
+               __set_bit(p->mode, config->supported_interfaces);
+               break;
+       }
+}
+
 static const struct b53_io_ops b53_srab_ops = {
        .read8 = b53_srab_read8,
        .read16 = b53_srab_read16,
        .write64 = b53_srab_write64,
        .irq_enable = b53_srab_irq_enable,
        .irq_disable = b53_srab_irq_disable,
+       .phylink_get_caps = b53_srab_phylink_get_caps,
 #if IS_ENABLED(CONFIG_B53_SERDES)
        .serdes_map_lane = b53_srab_serdes_map_lane,
        .serdes_link_state = b53_serdes_link_state,