From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "Marek Behún" <kabel@kernel.org>
Cc: netdev@vger.kernel.org, "Andrew Lunn" <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Alexander Couzens" <lynxis@fe80.eu>,
"Daniel Golle" <daniel@makrotopia.org>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Willy Liu" <willy.liu@realtek.com>,
"Ioana Ciornei" <ioana.ciornei@nxp.com>,
"Marek Mojík" <marek.mojik@nic.cz>,
"Maximilián Maliar" <maximilian.maliar@nic.cz>
Subject: Re: [PATCH net-next 03/15] net: phy: realtek: rework MMD register access methods
Date: Tue, 2 Jan 2024 11:16:04 +0000 [thread overview]
Message-ID: <ZZPwdEgwCVaHdyZB@shell.armlinux.org.uk> (raw)
In-Reply-To: <20231220155518.15692-4-kabel@kernel.org>
On Wed, Dec 20, 2023 at 04:55:06PM +0100, Marek Behún wrote:
> The .read_mmd() and .write_mmd() methods for rtlgen and rtl822x
> currently allow access to only 6 MMD registers, via a vendor specific
> mechanism (a paged read / write).
>
> The PHY specification explains that MMD registers for MMDs 1 to 30 can
> be accessed via the clause 22 indirect mechanism through registers 13
> and 14, but this is not possible for MMD 31.
>
> A Realtek contact explained that MMD 31 registers can be accessed by
> setting clause 22 page register (register 31):
> page = mmd_reg >> 4
> reg = 0x10 | ((mmd_reg & 0xf) >> 1)
>
> This mechanism is currently used in the driver. For example the
> .read_mmd() method accesses the PCS.EEE_ABLE register by setting page
> to 0xa5c and accessing register 0x12. By the formulas above, this
> corresponds to MMD register 31.a5c4. The Realtek contact confirmed that
> the PCS.EEE_ABLE register (3.0014) is also available via MMD alias
> 31.a5c4, and this is also true for the other registers:
>
> register name address page.reg alias
> PCS.EEE_ABLE 3.0x0014 0xa5c.12 31.0xa5c4
> PCS.EEE_ABLE2 3.0x0015 0xa6e.16 31.0xa6ec
> AN.EEE_ADV 7.0x003c 0xa5d.10 31.0xa5d0
> AN.EEE_LPABLE 7.0x003d 0xa5d.11 31.0xa5d2
> AN.EEE_ADV2 7.0x003e 0xa6d.12 31.0xa6d4
> AN.EEE_LPABLE2 7.0x003f 0xa6d.10 31.0xa6d0
>
> Since the registers are also available at the true MMD addresses where
> they can be accessed via the indirect mechanism (via registers 13 and
> 14) we can rework the code to be more generic and allow access to all
> MMD registers.
>
> Rework the .read_mmd() and .write_mmd() methods for rtlgen and rtl822x
> PHYs:
> - use direct clause 45 access if the MDIO bus supports it
> - use the indirect access via clause 22 registers 13 and 14 for MMDs
> 1 to 30
> - use the vendor specific method to access MMD 31 registers
>
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-01-02 11:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 15:55 [PATCH net-next 00/15] Realtek RTL822x PHY rework to c45 and SerDes interface switching Marek Behún
2023-12-20 15:55 ` [PATCH net-next 01/15] net: phy: fail early with error code if indirect MMD access fails Marek Behún
2024-01-02 11:09 ` Russell King (Oracle)
2023-12-20 15:55 ` [PATCH net-next 02/15] net: phy: export indirect MMD register accessors Marek Behún
2024-01-02 11:15 ` Russell King (Oracle)
2023-12-20 15:55 ` [PATCH net-next 03/15] net: phy: realtek: rework MMD register access methods Marek Behún
2024-01-02 11:16 ` Russell King (Oracle) [this message]
2024-01-02 13:18 ` Heiner Kallweit
2023-12-20 15:55 ` [PATCH net-next 04/15] net: phy: realtek: fill .read_mmd and .write_mmd methods for all rtl822x PHYs Marek Behún
2024-01-02 11:16 ` Russell King (Oracle)
2023-12-20 15:55 ` [PATCH net-next 05/15] net: mdio: add 2.5g and 5g related PMA speed constants Marek Behún
2024-01-02 11:05 ` Russell King (Oracle)
2023-12-20 15:55 ` [PATCH net-next 06/15] net: phy: realtek: use generic MDIO constants Marek Behún
2024-01-02 11:06 ` Russell King (Oracle)
2023-12-20 15:55 ` [PATCH net-next 07/15] net: phy: realtek: set is_c45 and fill in c45 IDs in PHY probe for rtl822x PHYs Marek Behún
2023-12-20 15:55 ` [PATCH net-next 08/15] net: phy: realtek: use generic clause 45 feature reading " Marek Behún
2023-12-20 15:55 ` [PATCH net-next 09/15] net: phy: realtek: read standard MMD register for rtlgen speed capability Marek Behún
2023-12-20 15:55 ` [PATCH net-next 10/15] net: phy: realtek: use generic c45 AN config with 1000baseT vendor extension for rtl822x Marek Behún
2023-12-20 15:55 ` [PATCH net-next 11/15] net: phy: realtek: use generic c45 status reading " Marek Behún
2023-12-20 15:55 ` [PATCH net-next 12/15] net: phy: realtek: use generic c45 suspend/resume " Marek Behún
2023-12-20 15:55 ` [PATCH net-next 13/15] net: phy: realtek: drop .read_page and .write_page for rtl822x series Marek Behún
2023-12-20 17:23 ` Heiner Kallweit
2023-12-21 10:21 ` Marek Behún
2023-12-20 15:55 ` [PATCH net-next 14/15] net: phy: realtek: configure SerDes mode for rtl822x PHYs Marek Behún
2023-12-20 15:55 ` [PATCH net-next 15/15] net: sfp: add quirk for another multigig RollBall transceiver Marek Behún
2023-12-20 16:20 ` [PATCH net-next 00/15] Realtek RTL822x PHY rework to c45 and SerDes interface switching Heiner Kallweit
2023-12-20 16:25 ` Marek Behún
2023-12-20 17:07 ` Heiner Kallweit
2023-12-23 19:09 ` Heiner Kallweit
2023-12-25 10:28 ` Marek Behún
2023-12-26 12:46 ` Heiner Kallweit
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=ZZPwdEgwCVaHdyZB@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=ioana.ciornei@nxp.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=lynxis@fe80.eu \
--cc=marek.mojik@nic.cz \
--cc=maximilian.maliar@nic.cz \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willy.liu@realtek.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).