[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200905153101.GD3164319@lunn.ch>
Date: Sat, 5 Sep 2020 17:31:01 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Paul Barker <pbarker@...sulko.com>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH 2/4] net: dsa: microchip: Add debug print for XMII port
mode
On Sat, Sep 05, 2020 at 03:03:23PM +0100, Paul Barker wrote:
> When debug is enabled for this driver, this allows users to confirm that
> the correct port mode is in use.
>
> Signed-off-by: Paul Barker <pbarker@...sulko.com>
> ---
> drivers/net/dsa/microchip/ksz9477.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
> index a48f5edab561..3e36aa628c9f 100644
> --- a/drivers/net/dsa/microchip/ksz9477.c
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -1211,21 +1211,25 @@ static void ksz9477_port_setup(struct ksz_device *dev, int port, bool cpu_port)
> ksz_pread8(dev, port, REG_PORT_XMII_CTRL_1, &data8);
> switch (dev->interface) {
> case PHY_INTERFACE_MODE_MII:
> + dev_dbg(dev->dev, "Port%d: MII mode\n", port);
> ksz9477_set_xmii(dev, 0, &data8);
> ksz9477_set_gbit(dev, false, &data8);
> p->phydev.speed = SPEED_100;
> break;
> case PHY_INTERFACE_MODE_RMII:
> + dev_dbg(dev->dev, "Port%d: RMII mode\n", port);
> ksz9477_set_xmii(dev, 1, &data8);
> ksz9477_set_gbit(dev, false, &data8);
> p->phydev.speed = SPEED_100;
> break;
> case PHY_INTERFACE_MODE_GMII:
> + dev_dbg(dev->dev, "Port%d: GMII mode\n", port);
> ksz9477_set_xmii(dev, 2, &data8);
> ksz9477_set_gbit(dev, true, &data8);
> p->phydev.speed = SPEED_1000;
> break;
> default:
> + dev_dbg(dev->dev, "Port%d: RGMII mode\n", port);
> ksz9477_set_xmii(dev, 3, &data8);
> ksz9477_set_gbit(dev, true, &data8);
> data8 &= ~PORT_RGMII_ID_IG_ENABLE;
You could do
dev_dbg(dev->dev, "Port%d: %s\n", port, phy_mode(dev->interface));
just before the switch statement.
Andrew
Powered by blists - more mailing lists