[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201020001759.GT456889@lunn.ch>
Date: Tue, 20 Oct 2020 02:17:59 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc: vivien.didelot@...il.com, f.fainelli@...il.com, olteanv@...il.com,
davem@...emloft.net, kuba@...nel.org, linux@...linux.org.uk,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] net: dsa: mv88e6xxx: Support serdes ports on
MV88E6097/6095/6185
On Mon, Oct 19, 2020 at 03:43:54PM +1300, Chris Packham wrote:
> Implement serdes_power, serdes_get_lane and serdes_pcs_get_state ops for
> the MV88E6097/6095/6185 so that ports 8 & 9 can be supported as serdes
> ports and directly connected to other network interfaces or to SFPs
> without a PHY.
>
> Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Just a nit pick below.
> +int mv88e6185_serdes_power(struct mv88e6xxx_chip *chip, int port, u8 lane,
> + bool up)
> +{
> + /* The serdes power can't be controlled on this switch chip but we need
> + * to supply this function to avoid returning -EOPNOTSUPP in
> + * mv88e6xxx_serdes_power_up/mv88e6xxx_serdes_power_down
> + */
> + return 0;
> +}
> +
> +u8 mv88e6185_serdes_get_lane(struct mv88e6xxx_chip *chip, int port)
> +{
> + switch (chip->ports[port].cmode) {
> + case MV88E6185_PORT_STS_CMODE_SERDES:
> + case MV88E6185_PORT_STS_CMODE_1000BASE_X:
> + return 0xff; /* Unused */
> + default:
> + return 0;
> + }
> +}
mv88e6185_serdes_power() has a nice comment about why it exists and
just returns 0. It would be nice to have something similar here, that
there are no SERDES lane registers, but something other than 0 has to
be returned to indicate there is in fact a SERDES for the given port.
Andrew
Powered by blists - more mailing lists