netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: George McCollister <george.mccollister@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: netdev@vger.kernel.org, Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Tristram Ha <Tristram.Ha@microchip.com>,
	"David S. Miller" <davem@davemloft.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/3] net: dsa: microchip: add ksz9567 to ksz9477 driver
Date: Mon, 9 Sep 2019 08:33:05 -0500	[thread overview]
Message-ID: <CAFSKS=PMBQyAs_e_AVeOR2MaYgSM7OOUstg9V9e8D4zZngdjKw@mail.gmail.com> (raw)
In-Reply-To: <6d8a915f-5f05-c91c-c139-26497376147d@denx.de>

On Fri, Sep 6, 2019 at 4:42 PM Marek Vasut <marex@denx.de> wrote:
>
> On 9/6/19 11:30 PM, George McCollister wrote:
> > Add support for the KSZ9567 7-Port Gigabit Ethernet Switch to the
> > ksz9477 driver. The KSZ9567 supports both SPI and I2C. Oddly the
> > ksz9567 is already in the device tree binding documentation.
> >
> > Signed-off-by: George McCollister <george.mccollister@gmail.com>
> > ---
> >  drivers/net/dsa/microchip/ksz9477.c     | 9 +++++++++
> >  drivers/net/dsa/microchip/ksz9477_i2c.c | 1 +
> >  drivers/net/dsa/microchip/ksz9477_spi.c | 1 +
> >  3 files changed, 11 insertions(+)
> >
> > diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
> > index 187be42de5f1..50ffc63d6231 100644
> > --- a/drivers/net/dsa/microchip/ksz9477.c
> > +++ b/drivers/net/dsa/microchip/ksz9477.c
> > @@ -1529,6 +1529,15 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = {
> >               .cpu_ports = 0x07,      /* can be configured as cpu port */
> >               .port_cnt = 3,          /* total port count */
> >       },
> > +     {
> > +             .chip_id = 0x00956700,
> > +             .dev_name = "KSZ9567",
> > +             .num_vlans = 4096,
> > +             .num_alus = 4096,
> > +             .num_statics = 16,
> > +             .cpu_ports = 0x7F,      /* can be configured as cpu port */
> > +             .port_cnt = 7,          /* total physical port count */
>
> I might be wrong, and this is just an idea for future improvement, but
> is .cpu_ports = GEN_MASK(.port_cnt, 0) always ?

GENMASK, not GEN_MASK. And I think it would be .cpu_ports =
GENMASK(.port_cnt - 1, 0).
I'm not sure if it would always be that. TBH I'm not sure if 0x7F is
even correct. For instance if a port has a PHY should it be excluded
from this mask or only if it doesn't support tail tagging? Maybe
someone would hook the CPU port up with a PHY instead of
RGMII/MII/RMII but it seems quite an odd thing to do.

On the KSZ9567R datasheet it shows 1-7 for this so if actually correct
I believe all ports support tail tagging but maybe some other variants
don't:
Port Operation Control 0 Register
Port N: 1-7
Bit 2 - Tail Tag Enable
When tail tagging is enabled for a port, it designates that port to be
the “host” or “CPU” port. Do not enable tail tagging for more than one
port.

My inclination is to leave it as is until a more compelling reason for
changing it arises.

>
> > +     },
> >  };
> >
> >  static int ksz9477_switch_init(struct ksz_device *dev)
> > diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c
> > index 85fd0fb43941..c1548a43b60d 100644
> > --- a/drivers/net/dsa/microchip/ksz9477_i2c.c
> > +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c
> > @@ -77,6 +77,7 @@ MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id);
> >  static const struct of_device_id ksz9477_dt_ids[] = {
> >       { .compatible = "microchip,ksz9477" },
> >       { .compatible = "microchip,ksz9897" },
> > +     { .compatible = "microchip,ksz9567" },
> >       {},
> >  };
> >  MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);
> > diff --git a/drivers/net/dsa/microchip/ksz9477_spi.c b/drivers/net/dsa/microchip/ksz9477_spi.c
> > index 2e402e4d866f..f4198d6f72be 100644
> > --- a/drivers/net/dsa/microchip/ksz9477_spi.c
> > +++ b/drivers/net/dsa/microchip/ksz9477_spi.c
> > @@ -81,6 +81,7 @@ static const struct of_device_id ksz9477_dt_ids[] = {
> >       { .compatible = "microchip,ksz9893" },
> >       { .compatible = "microchip,ksz9563" },
> >       { .compatible = "microchip,ksz8563" },
> > +     { .compatible = "microchip,ksz9567" },
> >       {},
> >  };
> >  MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);
> >
>
> Reviewed-by: Marek Vasut <marex@denx.de>

Thanks.

>
> --
> Best regards,
> Marek Vasut

  reply	other threads:[~2019-09-09 13:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 21:30 [PATCH net-next 0/3] add ksz9567 with I2C support to ksz9477 driver George McCollister
2019-09-06 21:30 ` [PATCH net-next 1/3] net: dsa: microchip: add KSZ9477 I2C driver George McCollister
2019-09-06 21:39   ` Marek Vasut
2019-09-09 12:54     ` George McCollister
2019-09-06 21:30 ` [PATCH net-next 2/3] net: dsa: microchip: add ksz9567 to ksz9477 driver George McCollister
2019-09-06 21:41   ` Marek Vasut
2019-09-09 13:33     ` George McCollister [this message]
2019-09-06 21:30 ` [PATCH net-next 3/3] net: dsa: microchip: remove NET_DSA_TAG_KSZ_COMMON George McCollister
2019-09-06 21:42   ` Marek Vasut

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='CAFSKS=PMBQyAs_e_AVeOR2MaYgSM7OOUstg9V9e8D4zZngdjKw@mail.gmail.com' \
    --to=george.mccollister@gmail.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=woojung.huh@microchip.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).