From: Heiner Kallweit <hkallweit1@gmail.com>
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>,
"Russell King" <rmk+kernel@armlinux.org.uk>,
"Alexander Couzens" <lynxis@fe80.eu>,
"Daniel Golle" <daniel@makrotopia.org>,
"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 00/15] Realtek RTL822x PHY rework to c45 and SerDes interface switching
Date: Tue, 26 Dec 2023 13:46:17 +0100 [thread overview]
Message-ID: <86c4c55b-511d-4b46-86b2-7d58df3b0c15@gmail.com> (raw)
In-Reply-To: <20231225112831.65e3a942@thinkpad>
On 25.12.2023 11:28, Marek Behún wrote:
> On Sat, 23 Dec 2023 20:09:33 +0100
> Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
>> On 20.12.2023 17:25, Marek Behún wrote:
>>> On Wed, 20 Dec 2023 17:20:07 +0100
>>> Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>>
>>>> On 20.12.2023 16:55, Marek Behún wrote:
>>>>> Hi,
>>>>>
>>>>> this series reworks the realtek PHY driver's support for rtl822x
>>>>> 2.5G transceivers:
>>>>>
>>>>> - First I change the driver so that the high level driver methods
>>>>> only use clause 45 register accesses (the only clause 22 accesses
>>>>> are left when accessing c45 registers indirectly, if the MDIO bus
>>>>> does not support clause 45 accesses).
>>>>> The driver starts using the genphy_c45_* methods.
>>>>>
>>>>> At this point the driver is ready to be used on a MDIO bus capable
>>>>> of only clause 45 accesses, but will still work on clause 22 only
>>>>> MDIO bus.
>>>>>
>>>>> - I then add support for SerDes mode switching between 2500base-x
>>>>> and sgmii, based on autonegotiated copper speed.
>>>>>
>>>>> All this is done so that we can support another 2.5G copper SFP
>>>>> module, which is enabled by the last patch.
>>>>>
>>>>
>>>> Has been verified that the RTL8125-integrated PHY's still work
>>>> properly with this patch set?
>>>>
>>>
>>> Hi Heiner,
>>>
>>> no, I wanted to send you an email to test this. I do not have the
>>> controllers with integrates PHYs.
>>>
>>> Can you test this?
>>>
>>> Also do you have a controller where the rtlgen driver is used but it
>>> only supports 1gbps ? I.e. where the PHY ID is RTL_GENERIC_PHYID
>>> (0x001cc800).
>>>
>>> I am asking because I am told that it also is clause 45, so the drivers
>>> can potentially be merged completely (the rtl822x_ functions can be
>>> merged with rtlgen_ functions and everything rewritten to clause 45,
>>> and gentphy_c45_ functions can be used).
>>>
>> At least on RTL8168h indirect MMD reads return 0 always.
>> IIRC this was the reason why the rtlgen functions use the vendor-specific
>> registers.
>
> Looking at the code in r8169_phy_config.c, I see function
> rtl8168h_config_eee_phy()
> with three paged writes to vendor registers, but the writes do not access
> the same registers as the .read_mmd() methods for the PCS_EEE / AN_EEE registers
> in realtek.c PHY driver.
>
That's some other undocumented EEE-related magic copied from the vendor driver.
> It seems for now it would be best to keep the methods for paged
> accesses.
>
> Could you test the patchset without the patch that removes the paged
> access methods?
>
> The rewrite of the read_mmd / write_mmd methods should not cause
> problems. I am told by the realtek contact you gave me that:
>
I tested on RTL8125A and RTL8125B, and on both indirect MMD reads return 0.
I tested with reading MDIO_MMD_PCS / MDIO_PCS_EEE_ABLE. Reading this register
should return 6. So it seems indirect MMD access was somehow and for whatever
reason disabled by Realtek for the RTL8125-internal PHY's (provided that
indirect C22 MMD access is supported by the standalone versions).
Note:
Internal PHY of RTL8125A has PHY ID 0x001cc800 (RTL8226 2.5Gbps PHY)
Internal PHY of RTL8125B has PHY ID 0x001cc840 (RTL8226B_RTL8221B 2.5Gbps PHY)
Consequence is that we can't replace reading the vendor-specific registers
with standard MMD reads.
> If FE PHY supports EEE, then it will support MMD register and it will
> also support use internal registers to access theses MMD registers.
>
> Marek
Heiner
prev parent reply other threads:[~2023-12-26 12:46 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)
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 [this message]
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=86c4c55b-511d-4b46-86b2-7d58df3b0c15@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--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=rmk+kernel@armlinux.org.uk \
--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).