All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Marek Behún" <marek.behun@nic.cz>
Cc: netdev <netdev@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next] net: dsa: mc88e6xxx: Fix 88E6141/6341 2500mbps SERDES speed
Date: Fri, 5 Oct 2018 23:20:55 +0200	[thread overview]
Message-ID: <20181005212055.GA28680@lunn.ch> (raw)
In-Reply-To: <20181005144227.32220-1-marek.behun@nic.cz>

On Fri, Oct 05, 2018 at 04:42:27PM +0200, Marek Behún wrote:
> The port_set_speed method for the Topaz family must not be the same
> as for Peridot family, since on Topaz port 5 is the SERDES port and it
> can be set to 2500mbps speed mode.
> 
> This patch adds a new method for the Topaz family, allowing the alt_bit
> mode only for port 0 and the 2500 mbps mode for port 5.
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
> index 92945841c8e8..cd7db60a508b 100644
> --- a/drivers/net/dsa/mv88e6xxx/port.c
> +++ b/drivers/net/dsa/mv88e6xxx/port.c
> @@ -228,8 +228,11 @@ static int mv88e6xxx_port_set_speed(struct mv88e6xxx_chip *chip, int port,
>  		ctrl = MV88E6XXX_PORT_MAC_CTL_SPEED_1000;
>  		break;
>  	case 2500:
> -		ctrl = MV88E6390_PORT_MAC_CTL_SPEED_10000 |
> -			MV88E6390_PORT_MAC_CTL_ALTSPEED;
> +		if (alt_bit)
> +			ctrl = MV88E6390_PORT_MAC_CTL_SPEED_10000 |
> +				MV88E6390_PORT_MAC_CTL_ALTSPEED;
> +		else
> +			ctrl = MV88E6390_PORT_MAC_CTL_SPEED_10000;
>  		break;
>  	case 10000:
>  		/* all bits set, fall through... */
> @@ -291,6 +294,24 @@ int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed)
>  	return mv88e6xxx_port_set_speed(chip, port, speed, false, false);
>  }
>  
> +/* Support 10, 100, 200, 1000, 2500 Mbps (e.g. 88E6341) */
> +int mv88e6341_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed)
> +{
> +	if (speed == SPEED_MAX)
> +		speed = port < 5 ? 1000 : 2500;
> +
> +	if (speed > 2500)
> +		return -EOPNOTSUPP;
> +
> +	if (speed == 200 && port != 0)
> +		return -EOPNOTSUPP;
> +
> +	if (speed == 2500 && port < 5)
> +		return -EOPNOTSUPP;
> +
> +	return mv88e6xxx_port_set_speed(chip, port, speed, !port, true);

Hi Marek

I'm confused.

The alt bit is used for configuring 2500. You say 2500 is only
supported on port 5. But !port is only true for port 0?

	  Andrew

  reply	other threads:[~2018-10-06  4:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 14:42 [PATCH net-next] net: dsa: mc88e6xxx: Fix 88E6141/6341 2500mbps SERDES speed Marek Behún
2018-10-05 21:20 ` Andrew Lunn [this message]
2018-10-06  0:38   ` Marek Behun
2018-10-06 18:37     ` Andrew Lunn
2018-10-06 22:00       ` Marek Behun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181005212055.GA28680@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.