All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Andrew Lunn <andrew@lunn.ch>, Gabor Juhos <juhosg@openwrt.org>,
	 Helmut Buchsbaum <helmut.buchsbaum@gmail.com>,
	Frederic LAMBERT <frdrc66@gmail.com>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Imre Kaloz <kaloz@openwrt.org>,
	 Krzysztof Halasa <khalasa@piap.pl>,
	phj@phj.hu
Subject: Re: [PATCH] ARM: dts: ixp4xx: Add devicetree for Linksys WRV54G
Date: Fri, 30 Jul 2021 14:15:57 +0200	[thread overview]
Message-ID: <CACRpkdZxaoSrC+ZbSJtokko_vf-y2JT8cP0=52cG2Jy7VX6OxA@mail.gmail.com> (raw)
In-Reply-To: <YQLKRn0RPgBv1sw7@lunn.ch>

On Thu, Jul 29, 2021 at 5:33 PM Andrew Lunn <andrew@lunn.ch> wrote:

> > +     /* This set-up comes from an OpenWrt patch */
> > +     spi {
> > +             compatible = "spi-gpio";
> > +             #address-cells = <1>;
> > +             #size-cells = <0>;
> > +
> > +             sck-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
> > +             miso-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
> > +             mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
> > +             cs-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
> > +             num-chipselects = <1>;
> > +
> > +             switch@0 {
> > +                     compatible = "micrel,ks8995";
>
> Hi Linus
>
> This does not exist in mainline. And when it does, i guess it will be
> called microchip,ksz8995. See microchip,ksz.yaml.

As it happens it does exist, so this was what I was using:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/micrel-ks8995.txt

> It is also missing
> all the ethernet-ports nodes. Maybe leave this out until the driver
> gets ported?

The driver exists too:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/spi_ks8995.c

Added in 2011:

commit a8e510f682fe6d7671c11887e07c55f86caaf3c1
Author: Frederic LAMBERT <frdrc66@gmail.com>
Date:   Sun Dec 18 07:33:41 2011 +0000

    phy: Micrel KS8995MA 5-ports 10/100 managed Ethernet switch support added

    Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
    Signed-off-by: Frederic Lambert <frdrc66@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Notice: managed switch :/ that sounds like DSA.

This was in 2011 so there was only the fringe Marvell DSA driver
from Ben Hutchings. Then you & others started to work on DSA
proper in 2014 IIUC.

Then in 2016:

commit 7e406d124c7935ee0238b957ea7e563dc1710f29
Author: Helmut Buchsbaum <helmut.buchsbaum@gmail.com>
Date:   Tue Feb 9 20:47:18 2016 +0100

    dt-bindings: net: ks8995: add bindings documentation for ks8995

    Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

The bindings sneaked in.

> > +             /*
> > +              * EthB - connected to the KS8995 switch ports 1-4
> > +              * FIXME: the boardfile defines .phy_mask = 0x1e for this port to enable output to
> > +              * all four switch ports, also using an out of tree multiphy patch.
> > +              * Do we need a new binding and property for this?
> > +              */
>
> This sounds like an issue with the KS8995 driver in OpenWRT.

The way I understand it is that the IXP4xx provides 4 "logical" ports
and then one MII out to the ks8995 phy. I guess something predating
the renewed DSA work.

> > +             ethernet@c8009000 {
> > +                     status = "ok";
> > +                     queue-rx = <&qmgr 3>;
> > +                     queue-txready = <&qmgr 20>;
> > +                     phy-mode = "rgmii";
> > +                     phy-handle = <&phy4>;
>
> It looks like phy4 is a switch PHY. It is not actually connected to
> this MAC? So this is wrong for mainline.

I guess yes, but mainline seemingly has a switch-phy driver
for it.

> > +                             /* Should be port 5 on the KS8995 switch */
> > +                             phy5: ethernet-phy@5 {
> > +                                     reg = <5>;
> > +                             };
> > +                     };
> > +             };
> > +
> > +             /* EthC - connected to KS8995 switch port 5 */
> > +             ethernet@c800a000 {
> > +                     status = "ok";
> > +                     queue-rx = <&qmgr 4>;
> > +                     queue-txready = <&qmgr 21>;
> > +                     phy-mode = "rgmii";
> > +                     phy-handle = <&phy5>;
>
> And i doubt this is correct. Unless there are back to back PHYs?

I think the WAN port is connected through its own MII to the
KS8955 phy, it's my impression after looking at some of the product
info and code.

So the WAN port will actually work fine, but I don't know about
the other 4 ports.

> I would suggest you leave out all the switch related properties until
> the switch driver is available.

Sadly it is available.

What shall we do with drivers/net/phy/spi_ks8995.c?

Shall we just delete it (and the bindings) and tell people to go and
write a DSA switch instead?

(I don't know how Frederic and Helmuth would feel about that, so
we need to discuss it.)

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-07-30 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  8:26 [PATCH] ARM: dts: ixp4xx: Add devicetree for Linksys WRV54G Linus Walleij
2021-07-29 15:33 ` Andrew Lunn
2021-07-30 12:15   ` Linus Walleij [this message]
2021-07-30 23:01     ` Andrew Lunn
2021-07-30 12:33   ` Linus Walleij

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='CACRpkdZxaoSrC+ZbSJtokko_vf-y2JT8cP0=52cG2Jy7VX6OxA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=frdrc66@gmail.com \
    --cc=helmut.buchsbaum@gmail.com \
    --cc=juhosg@openwrt.org \
    --cc=kaloz@openwrt.org \
    --cc=khalasa@piap.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=phj@phj.hu \
    /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.