[RFC,net-next,v3,13/15] net: dsa: mt7530: add support for 10G link modes for CPU port

Message ID 495231a9d84159878116c2cb181537da674edc27.1680105013.git.daniel@makrotopia.org
State New
Headers
Series net: dsa: add support for MT7988 |

Commit Message

Daniel Golle March 29, 2023, 4 p.m. UTC
  The built-in switch of the MT7988 SoC is internally connected using
a stateless 10G link. Add support for 10G interface modes to silence
a warning otherwise occurring when the switch driver is setup.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/dsa/mt7530.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

Andrew Lunn March 29, 2023, 4:48 p.m. UTC | #1
On Wed, Mar 29, 2023 at 05:00:21PM +0100, Daniel Golle wrote:
> The built-in switch of the MT7988 SoC is internally connected using
> a stateless 10G link. Add support for 10G interface modes to silence
> a warning otherwise occurring when the switch driver is setup.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
  

Patch

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index fd55ddc2d1eb3..a4b49e5753bdc 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2616,6 +2616,9 @@  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
 	case PHY_INTERFACE_MODE_1000BASEX:
 	case PHY_INTERFACE_MODE_2500BASEX:
 		/* handled in SGMII PCS driver */
+	case PHY_INTERFACE_MODE_USXGMII:
+	case PHY_INTERFACE_MODE_10GKR:
+		/* internal stateless 10G link */
 		return 0;
 	default:
 		return -EINVAL;
@@ -2739,7 +2742,9 @@  static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
 	 * variants.
 	 */
 	if (interface == PHY_INTERFACE_MODE_TRGMII ||
-	    (phy_interface_mode_is_8023z(interface))) {
+	    interface == PHY_INTERFACE_MODE_USXGMII ||
+	    interface == PHY_INTERFACE_MODE_10GKR ||
+	    phy_interface_mode_is_8023z(interface)) {
 		speed = SPEED_1000;
 		duplex = DUPLEX_FULL;
 	}