netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Woojung.Huh@microchip.com
Cc: f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com,
	sergei.shtylyov@cogentembedded.com, netdev@vger.kernel.org,
	davem@davemloft.net, UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v2 net-next 3/5] dsa: add DSA switch driver for Microchip KSZ9477
Date: Sat, 13 May 2017 15:13:41 +0200	[thread overview]
Message-ID: <20170513131341.GC14058@lunn.ch> (raw)
In-Reply-To: <9235D6609DB808459E95D78E17F2E43D40A632C2@CHN-SV-EXMX02.mchp-main.com>

On Fri, May 12, 2017 at 08:07:58PM +0000, Woojung.Huh@microchip.com wrote:

> +static void ksz_config_cpu_port(struct dsa_switch *ds)
> +{
> +	struct ksz_device *dev = ds->priv;
> +	int i;
> +
> +	ds->num_ports = dev->port_cnt;
> +
> +	for (i = 0; i < ds->num_ports; i++) {
> +		if (dsa_is_cpu_port(ds, i)) {
> +			dev->cpu_port = i;
> +			/* enable tag tail for host port */
> +			ksz_port_cfg(dev, i, REG_PORT_CTRL_0,
> +				     PORT_TAIL_TAG_ENABLE, true);
> +		}
> +	}
> +}


> +static const struct ksz_chip_data ksz_switch_chips[] = {
> +	{
> +		.chip_id = 0x00947700,
> +		.dev_name = "KSZ9477",
> +		.num_vlans = 4096,
> +		.num_alus = 4096,
> +		.num_statics = 16,
> +		.enabled_ports = 0x1F,	/* port0-4 */
> +		.cpu_port = 5,		/* port5 (RGMII) */
> +		.port_cnt = 7,
> +		.phy_port_cnt = 5,
> +	},
> +};

Hi Woojung

Do we need cpu_port in this table? Can any port be used as a CPU port?
>From the code in ksz_config_cpu_port() it seems like it can.

And do we need enabled_ports? This seems to suggest only ports 0-4 can
be user ports?

Thanks
	Andrew

  reply	other threads:[~2017-05-13 13:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 20:07 [PATCH v2 net-next 3/5] dsa: add DSA switch driver for Microchip KSZ9477 Woojung.Huh
2017-05-13 13:13 ` Andrew Lunn [this message]
2017-05-15 21:01   ` Woojung.Huh
2017-05-15 21:20     ` Florian Fainelli
2017-05-13 14:56 ` Andrew Lunn
2017-05-14  9:13   ` Sergei Shtylyov
2017-05-15 20:52     ` Woojung.Huh

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=20170513131341.GC14058@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).