From 7bb4872241075fb846ef83fa6fdd39193c136b46 Mon Sep 17 00:00:00 2001 From: karlt Date: Thu, 16 Dec 2021 16:23:33 +0800 Subject: [PATCH] net: dsa: microchip: Add supported ksz9897 port6 To: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com Cc: kuba@kernel.org, netdev@vger.kernel.org This fix driver ksz9897 port6 with PHY ksz8081 by hardware setup Signed-off-by: karlt --- drivers/net/dsa/microchip/ksz9477.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index abfd3802bb51..f343bfe307bc 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1196,7 +1196,7 @@ static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port) /* enable 802.1p priority */ ksz_port_cfg(dev, port, P_PRIO_CTRL, PORT_802_1P_PRIO_ENABLE, true); - if (port < dev->phy_port_cnt) { + if (port < dev->phy_port_cnt || !cpu_port) { /* do not force flow control */ ksz_port_cfg(dev, port, REG_PORT_CTRL_0, PORT_FORCE_TX_FLOW_CTRL | PORT_FORCE_RX_FLOW_CTRL, @@ -1339,6 +1339,8 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) /* SGMII PHY detection code is not implemented yet. */ p->phy = 0; } + if (dev->chip_id == 0x00989700 && i == 6) + p->phy = 1; } } -- 2.25.1