[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y90SA/8RzaRCvna8@lunn.ch>
Date: Fri, 3 Feb 2023 14:54:11 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "Valek, Andrej" <andrej.valek@...mens.com>
Cc: "vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: DSA mv88e6xxx_probe
> > > 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
Powered by blists - more mailing lists