All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	David Jander <david@protonic.nl>,
	"David S. Miller" <davem@davemloft.net>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	Philippe Schenker <philippe.schenker@toradex.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH net-next v3] net: phy: micrel: add phy-mode support for the KSZ9031 PHY
Date: Sat, 11 Jul 2020 00:54:53 +0200	[thread overview]
Message-ID: <20200710225453.GK1014141@lunn.ch> (raw)
In-Reply-To: <20200710223610.GC3759@piout.net>

On Sat, Jul 11, 2020 at 12:36:10AM +0200, Alexandre Belloni wrote:
> Hi Oleksij,
> 
> This patch breaks Ethernet on the sama5d3 Xplained and I have not been
> able to unbreak it.

Hi Alexandre

                        macb0: ethernet@f0028000 {
                                phy-mode = "rgmii";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "okay";

                                ethernet-phy@7 {
                                        reg = <0x7>;
                                };
                        };

So DT says it wants rgmii. How are the delays being added? Could the
bootloader be configuring the PHY into rgmii-id mode, which is now
getting cleared? Or by strapping of pins on the PHY?

Also, looking at macb_main.c is seen:

       if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
                val = 0;
                if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
                        val = GEM_BIT(RGMII);
                else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
                         (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII))
                        val = MACB_BIT(RMII);
                else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII))
                        val = MACB_BIT(MII);

                if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN)
                        val |= MACB_BIT(CLKEN);

                macb_or_gem_writel(bp, USRIO, val);
        }

I don't know if this applies for your hardware, but if you tried
fixing the PHY by setting phy-mode to "rgmii-id", it could be macb
then did not set GEM_BIT(RGMII) and so broken even more?

Rather than bp->phy_interface == PHY_INTERFACE_MODE_RGMII,
phy_interface_mode_is_rgmii() might work better.

      Andrew

  reply	other threads:[~2020-07-10 22:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  7:21 [PATCH net-next v3] net: phy: micrel: add phy-mode support for the KSZ9031 PHY Oleksij Rempel
2020-04-22  8:48 ` Philippe Schenker
2020-04-22 13:39 ` Andrew Lunn
2020-04-23  2:39 ` David Miller
2020-04-28 15:28 ` Geert Uytterhoeven
2020-04-28 15:47   ` Andrew Lunn
2020-04-28 16:16     ` Philippe Schenker
2020-04-29  8:45       ` Geert Uytterhoeven
2020-04-29  9:26         ` Oleksij Rempel
2020-05-27 19:11           ` Geert Uytterhoeven
2020-05-27 20:52             ` Andrew Lunn
2020-05-28 13:10               ` Geert Uytterhoeven
2020-05-28 16:08                 ` Andrew Lunn
2020-05-29  4:59                   ` Oleksij Rempel
2020-05-29 10:17                   ` Geert Uytterhoeven
2020-05-28  8:20             ` Philippe Schenker
2020-05-28 12:51               ` Geert Uytterhoeven
2020-05-28 23:31                 ` Florian Fainelli
2020-04-29 10:02         ` Philippe Schenker
2020-05-05 18:26 ` Grygorii Strashko
2020-05-06  4:51   ` Oleksij Rempel
2020-07-10 22:36 ` Alexandre Belloni
2020-07-10 22:54   ` Andrew Lunn [this message]
2020-07-10 23:25     ` Alexandre Belloni
  -- strict thread matches above, loose matches on Subject: below --
2020-04-07  9:36 Oleksij Rempel
2020-04-07 10:57 ` Philippe Schenker
2020-04-07 11:02   ` Marc Kleine-Budde
2020-04-07 12:34     ` Philippe Schenker
2020-04-07 11:05   ` Russell King - ARM Linux admin
2020-04-07 20:13 ` David Miller

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=20200710225453.GK1014141@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.belloni@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=david@protonic.nl \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=philippe.schenker@toradex.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 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.