From: Andrew Lunn <andrew@lunn.ch>
To: "Valek, Andrej" <andrej.valek@siemens.com>
Cc: "vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: DSA mv88e6xxx_probe
Date: Fri, 3 Feb 2023 14:54:11 +0100 [thread overview]
Message-ID: <Y90SA/8RzaRCvna8@lunn.ch> (raw)
In-Reply-To: <05f695cd76ffcc885e6ea70c58d0a07dbc48a341.camel@siemens.com>
> > > This looks promising. So I have to just move the "reset-gpios" DTB
> > > entry from switch to mdio section. But which driver handles it,
> > > drivers/net/phy/mdio_bus.c,
> >
> > Yes.
> >
> > > > mdio {
> > > > #address-cells = <1>;
> > > > #size-cells = 0>;
> > > while here is no compatible part... .
> >
> > It does not need a compatible, because it is part of the FEC, and the
> > FEC has a compatible. Remember this is device tree, sometimes you need
> > to go up the tree towards the root to find the actual device with a
> > compatible.
> >
> > Andrew
> I tried put the "reset-gpios" and "reset-delay-us" into multiple mdio locations, but nothing has been working. DTB looks like that:
>
> > &fec1 {
> > pinctrl-names = "default";
> > pinctrl-0 = <&pinctrl_fec1>;
> > phy-mode = "rgmii-id";
> > tx-internal-delay-ps = <2000>;
> > rx-internal-delay-ps = <2000>;
> > slaves = <1>; // use only one emac if
> > status = "okay";
> > mac-address = [ 00 00 00 00 00 00 ]; // Filled in by U-Boot
> >
> > // #### 3. try ####
> > //phy-reset-gpios = <&lsio_gpio0 13 GPIO_ACTIVE_LOW>;
> > //reset-delay-us = <10000>;
> >
> > fixed-link {
> > speed = <1000>;
> > full-duplex;
> > };
> >
> > mdio {
> > #address-cells = <1>;
> > #size-cells = <0>;
> >
> > // 1. try
> > reset-gpios = <&lsio_gpio0 13 GPIO_ACTIVE_LOW>;
> > reset-delay-us = <10000>;
This looks like the correct location. Have you put a printk() after
https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/mdio_bus.c#L569
to make sure it has found it?
You might also need a post reset delay. I'm not sure the device will
answer if it is still busy reading the EEPROM. Which is why the
mv88e6xxx hardware reset does some polling before continuing.
Andrew
next prev parent reply other threads:[~2023-02-03 14:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 15:18 DSA mv88e6xxx_probe Valek, Andrej
2023-02-02 16:05 ` Andrew Lunn
2023-02-02 17:57 ` Valek, Andrej
2023-02-02 18:10 ` Andrew Lunn
2023-02-03 8:07 ` Valek, Andrej
2023-02-03 13:54 ` Andrew Lunn [this message]
2023-02-03 14:47 ` Valek, Andrej
2023-02-06 14:50 ` Valek, Andrej
2023-02-08 8:20 ` Valek, Andrej
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=Y90SA/8RzaRCvna8@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrej.valek@siemens.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.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).