From: Simon Horman <horms@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Andrei Botila <andrei.botila@oss.nxp.com>,
Paolo Abeni <pabeni@redhat.com>,
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>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
s32@nxp.com, Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] net: phy: nxp-c45-tja11xx: add TJA112X PHY configuration errata
Date: Fri, 7 Mar 2025 13:24:22 +0000 [thread overview]
Message-ID: <20250307132422.GH3666230@kernel.org> (raw)
In-Reply-To: <d09c8547-550d-4ea1-8739-2bcf9e7c3fb0@lunn.ch>
On Thu, Mar 06, 2025 at 04:35:12PM +0100, Andrew Lunn wrote:
> > >> +/* Errata: ES_TJA1120 and ES_TJA1121 Rev. 1.0 — 28 November 2024 Section 3.1 */
> > >> +static void nxp_c45_tja1120_errata(struct phy_device *phydev)
> > >> +{
> > >> + int silicon_version, sample_type;
> > >> + bool macsec_ability;
> > >> + int phy_abilities;
> > >> + int ret = 0;
> > >> +
> > >> + ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_DEVICE_ID3);
> > >> + if (ret < 0)
> > >> + return;
> > >> +
> > >> + sample_type = FIELD_GET(TJA1120_DEV_ID3_SAMPLE_TYPE, ret);
> > >> + if (sample_type != DEVICE_ID3_SAMPLE_TYPE_R)
> > >> + return;
> > >> +
> > >> + silicon_version = FIELD_GET(TJA1120_DEV_ID3_SILICON_VERSION, ret);
> > >> +
> > >> + phy_abilities = phy_read_mmd(phydev, MDIO_MMD_VEND1,
> > >> + VEND1_PORT_ABILITIES);
> > >> + macsec_ability = !!(phy_abilities & MACSEC_ABILITY);
> > >> + if ((!macsec_ability && silicon_version == 2) ||
> > >> + (macsec_ability && silicon_version == 1)) {
> > >> + /* TJA1120/TJA1121 PHY configuration errata workaround.
> > >> + * Apply PHY writes sequence before link up.
> > >> + */
> > >> + if (!macsec_ability) {
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F8, 0x4b95);
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F9, 0xf3cd);
> > >> + } else {
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F8, 0x89c7);
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F9, 0x0893);
> > >> + }
> > >> +
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x0476, 0x58a0);
> > >> +
> > >> + phy_write_mmd(phydev, MDIO_MMD_PMAPMD, 0x8921, 0xa3a);
> > >> + phy_write_mmd(phydev, MDIO_MMD_PMAPMD, 0x89F1, 0x16c1);
> > >> +
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F8, 0x0);
> > >> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F9, 0x0);
> > >
> > > Please add macro with meaningful names for all the magic numbers used
> > > above, thanks!
> > >
> > > Paolo
> > >
> >
> > Hello, these registers are not documented in the datasheet or errata sheet.
> > The access sequence comes 1-to-1 from the errata so I couldn't use macros.
>
> Yes, we sometimes just have to accept the drivers are doing magic we
> have no idea about because the vendor does not want to tell is. All
> the registers in MDIO_MMD_VEND1 are clearly vendor specific. The
> MDIO_MMD_PMAPMD registers are also in the range reserved for
> vendors. So i think we just have to accept it.
+1
It can happen that vendors regard such information as IP that they do
not wish to disclose. Not saying that is the case here. Just saying
it is one reason that we sometimes have to accept such things.
So I think what you say above is completely reasonable.
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
>
next prev parent reply other threads:[~2025-03-07 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 16:06 [PATCH net v2 0/2] net: phy: nxp-c45-tja11xx: add errata for TJA112XA/B Andrei Botila
2025-03-04 16:06 ` [PATCH net v2 1/2] net: phy: nxp-c45-tja11xx: add TJA112X PHY configuration errata Andrei Botila
2025-03-06 9:43 ` Paolo Abeni
2025-03-06 12:03 ` Andrei Botila
2025-03-06 15:35 ` Andrew Lunn
2025-03-07 13:24 ` Simon Horman [this message]
2025-03-04 16:06 ` [PATCH net v2 2/2] net: phy: nxp-c45-tja11xx: add TJA112XB SGMII PCS restart errata Andrei Botila
2025-03-08 4:00 ` [PATCH net v2 0/2] net: phy: nxp-c45-tja11xx: add errata for TJA112XA/B 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=20250307132422.GH3666230@kernel.org \
--to=horms@kernel.org \
--cc=andrei.botila@oss.nxp.com \
--cc=andrew@lunn.ch \
--cc=aruizrui@redhat.com \
--cc=clizzi@redhat.com \
--cc=davem@davemloft.net \
--cc=eballetb@redhat.com \
--cc=edumazet@google.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 \
--cc=s32@nxp.com \
--cc=stable@vger.kernel.org \
/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).