From: Andrew Lunn <andrew@lunn.ch>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: f.fainelli@gmail.com, sergei.shtylyov@cogentembedded.com,
atish.patra@wdc.com, schwab@suse.de, nicolas.ferre@microchip.com,
netdev@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, hkallweit1@gmail.com
Subject: Re: macb: probe of 10090000.ethernet failed with error -110
Date: Thu, 29 Nov 2018 06:55:10 +0100 [thread overview]
Message-ID: <20181129055510.GB17675@lunn.ch> (raw)
In-Reply-To: <mhng-0ddf5852-8900-4131-b3e0-81c5cc7de2eb@palmer-si-x1c4>
> diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
> index 7cae17517744..8e0a71ee6bab 100644
> --- a/drivers/net/phy/mscc.c
> +++ b/drivers/net/phy/mscc.c
> @@ -1822,6 +1822,24 @@ static int vsc85xx_probe(struct phy_device *phydev)
> return vsc85xx_dt_led_modes_get(phydev, default_mode);
> }
> +static int vsc8541_reset(struct phy_device *phydev, int value)
> +{
> + WARN_ON(value != 0 || value != 1);
> + mdio_device_reset(&phydev->mdio, value);
> + if (value == 1) {
> + /* The VSC8541 has an unexpected feature where a single reset
> + * rising edge can only be used to enter managed mode. For
> + * unmanaged mode a pair of reset rising edges is necessary.
> + * */
> + mdio_device_reset(&phydev_mdio, 0);
> + mdio_device_reset(&phydev_mdio, 1);
> +
> + /* After this pair of reset rising edges we must wait at least
> + * 15ms before writing any phy registers. */
> + msleep(15);
> + }
> +}
> +
> /* Microsemi VSC85xx PHYs */
> static struct phy_driver vsc85xx_driver[] = {
> {
> @@ -1927,6 +1945,7 @@ static struct phy_driver vsc85xx_driver[] = {
> .get_sset_count = &vsc85xx_get_sset_count,
> .get_strings = &vsc85xx_get_strings,
> .get_stats = &vsc85xx_get_stats,
> + .reset = &vsc8541_reset,
So if we assume you can identify the PHY using its ID registers, you
can put this reset code into the soft_reset call. That gets called
first before anything else. There is no need to add a new function to
phy_driver.
Andrew
next prev parent reply other threads:[~2018-11-29 5:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 10:10 macb: probe of 10090000.ethernet failed with error -110 Andreas Schwab
2018-11-28 18:15 ` Atish Patra
2018-11-28 21:33 ` Florian Fainelli
2018-11-29 2:08 ` Palmer Dabbelt
2018-11-29 2:28 ` Andrew Lunn
2018-11-29 3:01 ` Palmer Dabbelt
2018-11-29 5:55 ` Andrew Lunn [this message]
2018-11-29 11:55 ` Andreas Schwab
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=20181129055510.GB17675@lunn.ch \
--to=andrew@lunn.ch \
--cc=atish.patra@wdc.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=palmer@sifive.com \
--cc=schwab@suse.de \
--cc=sergei.shtylyov@cogentembedded.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).