From: "Marek Behún" <kabel@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: netdev@vger.kernel.org, Leszek Polak <lpolak@arri.de>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2] net: phy: marvell: Add errata section 5.1 for Alaska PHY
Date: Mon, 16 May 2022 11:25:55 +0200 [thread overview]
Message-ID: <20220516112555.3ed37e74@thinkpad> (raw)
In-Reply-To: <20220516070859.549170-1-sr@denx.de>
On Mon, 16 May 2022 09:08:59 +0200
Stefan Roese <sr@denx.de> wrote:
> From: Leszek Polak <lpolak@arri.de>
>
> As per Errata Section 5.1, if EEE is intended to be used, some register
> writes must be done once after every hardware reset. This patch now adds
> the necessary register writes as listed in the Marvell errata.
>
> Without this fix we experience ethernet problems on some of our boards
> equipped with a new version of this ethernet PHY (different supplier).
>
> The fix applies to Marvell Alaska 88E1510/88E1518/88E1512/88E1514
> Rev. A0.
>
> Signed-off-by: Leszek Polak <lpolak@arri.de>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Marek Behún <kabel@kernel.org>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: David S. Miller <davem@davemloft.net>
> ---
> v2:
> - Implement struct with errata reg values and loop over this
> struct instead of using single phy_write() call for each PHY
> reg value, as suggested by Marek
>
> drivers/net/phy/marvell.c | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 2702faf7b0f6..41353f615a66 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -1177,7 +1177,44 @@ static int m88e1318_config_init(struct phy_device *phydev)
>
> static int m88e1510_config_init(struct phy_device *phydev)
> {
> + static const struct {
> + u16 reg17, reg16;
> + } errata_vals[] = {
> + { 0x214b, 0x2144 },
> + { 0x0c28, 0x2146 },
> + { 0xb233, 0x214d },
> + { 0xcc0c, 0x2159 },
> + };
> int err;
> + int i;
> +
> + /* As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/
> + * 88E1514 Rev A0, Errata Section 5.1:
> + * If EEE is intended to be used, the following register writes
> + * must be done once after every hardware reset.
> + */
> + err = marvell_set_page(phydev, 0x00FF);
> + if (err < 0)
> + return err;
> +
> + for (i = 0; i < ARRAY_SIZE(errata_vals); ++i) {
> + err = phy_write(phydev, 17, errata_vals[i].reg17);
> + if (err)
> + return err;
> + err = phy_write(phydev, 16, errata_vals[i].reg16);
> + if (err)
> + return err;
> + }
> +
> + err = marvell_set_page(phydev, 0x00FB);
> + if (err < 0)
> + return err;
> + err = phy_write(phydev, 07, 0xC00D);
> + if (err < 0)
> + return err;
> + err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
> + if (err < 0)
> + return err;
>
> /* SGMII-to-Copper mode initialization */
> if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
Reviewed-by: Marek Behún <kabel@kernel.org>
next prev parent reply other threads:[~2022-05-16 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 7:08 [PATCH v2] net: phy: marvell: Add errata section 5.1 for Alaska PHY Stefan Roese
2022-05-16 9:25 ` Marek Behún [this message]
2022-05-16 11:57 ` Andrew Lunn
2022-05-17 11:01 ` Paolo Abeni
2022-05-17 11:21 ` Stefan Roese
2022-05-17 11:45 ` Paolo Abeni
2022-05-17 13:20 ` patchwork-bot+netdevbpf
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=20220516112555.3ed37e74@thinkpad \
--to=kabel@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux@armlinux.org.uk \
--cc=lpolak@arri.de \
--cc=netdev@vger.kernel.org \
--cc=sr@denx.de \
/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).