From: Dimitri Fedrau <dima.fedrau@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Stefan Eichenberger <eichest@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY
Date: Sat, 16 Dec 2023 23:11:51 +0100 [thread overview]
Message-ID: <20231216221151.GA143483@debian> (raw)
In-Reply-To: <74d4b8f9-700e-45bc-af59-95a40a777b00@lunn.ch>
Am Sat, Dec 16, 2023 at 05:46:32PM +0100 schrieb Andrew Lunn:
> > +static int mv88q222x_config_aneg_gbit(struct phy_device *phydev)
> > +{
> > + int ret;
> > +
> > + /* send_s detection threshold, slave and master */
> > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8032, 0x2020);
> > + if (ret < 0)
> > + return ret;
> > +
> > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8031, 0xa28);
> > + if (ret < 0)
> > + return ret;
> > +
> > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8031, 0xc28);
> > + if (ret < 0)
> > + return ret;
>
> Same register with two different values?
>
Just copied the init sequence from sample code provided by Marvell.
I don't know if its a mistake. There is no documentation on this.
> There are a lot of magic values here. Does the datasheet names these
> registers? Does it define the bits? Adding #defines would be good.
>
Datasheet is not naming them. I once asked Marvell Support for
documentation on the init sequence and what purpose each register has.
Just got the answer to use the sample code as it is.
> > +static int mv88q222x_config_aneg_preinit(struct phy_device *phydev)
> > +{
> > + int ret, val, i;
> > +
> > + /* Enable txdac */
> > + ret = phy_write_mmd(phydev, MDIO_MMD_PCS, 0x8033, 0x6801);
> > + if (ret < 0)
> > + return ret;
> > +
> > + /* Disable ANEG */
> > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_T1_CTRL, 0x0);
> > + if (ret < 0)
> > + return ret;
> > +
> > + /* Set IEEE power down */
> > + ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, 0x840);
>
> 0x800 is MDIO_CTRL1_LPOWER. What is the other? It seems like a speed
> selection bit?
>
The other is MDIO_PMA_CTRL1_SPEED1000. Will fix this in V2.
> Andrew
next prev parent reply other threads:[~2023-12-16 22:11 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 21:31 [PATCH] net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY Dimitri Fedrau
2023-12-16 16:46 ` Andrew Lunn
2023-12-16 22:11 ` Dimitri Fedrau [this message]
2023-12-17 9:22 ` Andrew Lunn
2023-12-17 11:15 ` Dimitri Fedrau
2023-12-17 13:50 ` Stefan Eichenberger
2023-12-18 9:09 ` Dimitri Fedrau
2023-12-18 11:19 ` Stefan Eichenberger
2023-12-19 8:11 ` Dimitri Fedrau
2023-12-19 9:19 ` Stefan Eichenberger
2023-12-19 9:35 ` Dimitri Fedrau
2023-12-21 7:28 ` [PATCH v3 0/4] " Dimitri Fedrau
2023-12-21 7:28 ` [PATCH v3 1/4] net: phy: Add BaseT1 auto-negotiation constants Dimitri Fedrau
2023-12-21 9:45 ` Andrew Lunn
2023-12-21 7:28 ` [PATCH v3 2/4] net: phy: Support 100/1000BT1 linkmode advertisements Dimitri Fedrau
2023-12-21 9:45 ` Andrew Lunn
2023-12-21 7:28 ` [PATCH v3 3/4] net: phy: c45: detect 100/1000BASE-T1 " Dimitri Fedrau
2023-12-21 9:46 ` Andrew Lunn
2023-12-21 7:28 ` [PATCH v3 4/4] net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY Dimitri Fedrau
2023-12-21 9:53 ` Andrew Lunn
2023-12-21 11:40 ` Dimitri Fedrau
2023-12-21 13:47 ` Stefan Eichenberger
2023-12-21 14:16 ` Dimitri Fedrau
2023-12-21 14:25 ` Andrew Lunn
2023-12-21 14:45 ` Dimitri Fedrau
2024-01-02 11:36 ` Russell King (Oracle)
2023-12-21 9:44 ` [PATCH v3 0/4] " Andrew Lunn
2023-12-21 11:45 ` Dimitri Fedrau
2023-12-19 15:57 ` [PATCH] " Andrew Lunn
2024-01-05 12:42 ` Dimitri Fedrau
2024-01-05 14:00 ` Andrew Lunn
2024-01-05 15:43 ` Dimitri Fedrau
2024-01-05 16:06 ` Andrew Lunn
2024-01-05 22:20 ` Dimitri Fedrau
2023-12-16 22:41 ` [PATCH v2] " Dimitri Fedrau
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=20231216221151.GA143483@debian \
--to=dima.fedrau@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eichest@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).