From: Willy Liu <willy.liu@realtek.com>
To: Heiner Kallweit <hkallweit1@gmail.com>, Andrew Lunn <andrew@lunn.ch>
Cc: "linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH net-next 1/2] net: phy: realtek: Add phy ids for RTL8226-CG/RTL8226B-CG
Date: Fri, 30 Oct 2020 02:45:36 +0000 [thread overview]
Message-ID: <e00771ccacb648b6a00b914e0421b080@realtek.com> (raw)
In-Reply-To: <2cca91c7-99eb-3109-9958-c3db43a43a9b@gmail.com>
On Thu, Oct 29, 2020 21:49, Heiner Hallweit wrote:
> On 29.10.2020 14:37, Andrew Lunn wrote:
> > On Thu, Oct 29, 2020 at 08:07:57PM +0800, Willy Liu wrote:
> >> Realtek single-port 2.5Gbps Ethernet PHY ids as below:
> >> RTL8226-CG: 0x001cc800(ES)/0x001cc838(MP)
> >> RTL8226B-CG/RTL8221B-CG: 0x001cc840(ES)/0x001cc848(MP)
> >> ES: engineer sample
> >> MP: mass production
> >>
> >> Since above PHYs are already in mass production stage, mass
> >> production id should be added.
> >>
> >> Signed-off-by: Willy Liu <willy.liu@realtek.com>
> >> ---
> >> drivers/net/phy/realtek.c | 18 ++++++++++++++----
> >> 1 file changed, 14 insertions(+), 4 deletions(-) mode change 100644
> >> => 100755 drivers/net/phy/realtek.c
> >>
> >> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> >> old mode 100644 new mode 100755 index fb1db71..988f075
> >> --- a/drivers/net/phy/realtek.c
> >> +++ b/drivers/net/phy/realtek.c
> >> @@ -57,6 +57,9 @@
> >> #define RTLGEN_SPEED_MASK 0x0630
> >>
> >> #define RTL_GENERIC_PHYID 0x001cc800
> >> +#define RTL_8226_MP_PHYID 0x001cc838
> >> +#define RTL_8221B_ES_PHYID 0x001cc840
> >> +#define RTL_8221B_MP_PHYID 0x001cc848
> >>
> >> MODULE_DESCRIPTION("Realtek PHY driver");
> MODULE_AUTHOR("Johnson
> >> Leung"); @@ -533,10 +536,17 @@ static int
> >> rtlgen_match_phy_device(struct phy_device *phydev)
> >>
> >> static int rtl8226_match_phy_device(struct phy_device *phydev) {
> >> - return phydev->phy_id == RTL_GENERIC_PHYID &&
> >> + return (phydev->phy_id == RTL_GENERIC_PHYID) ||
> >> + (phydev->phy_id == RTL_8226_MP_PHYID) &&
> >> rtlgen_supports_2_5gbps(phydev);
> >
> > Hi Willy
> >
> > If i understand the code correctly, this match function is used
> > because the engineering sample did not use a proper ID? The mass
> > production part does, so there is no need to make use of this hack.
> > Please just list it as a normal PHY using PHY_ID_MATCH_EXACT().
> >
> Right. My understanding:
> These PHY's exist as standalone chips and integrated with RTL8125 MAC.
> IIRC for RTL8125A the integrated PHY reports RTL_GENERIC_PHYID, since
> RTL8125B it reports the same PHYID as the standalone model.
Hi Andrew && Heiner,
Thanks for your information, I will create drivers for RTL8226-CG & RTL8221B-CG
as standalone models.
> ------Please consider the environment before printing this e-mail.
next prev parent reply other threads:[~2020-10-30 2:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 12:07 [PATCH net-next 1/2] net: phy: realtek: Add phy ids for RTL8226-CG/RTL8226B-CG Willy Liu
2020-10-29 13:37 ` Andrew Lunn
2020-10-29 13:48 ` Heiner Kallweit
2020-10-30 2:45 ` Willy Liu [this message]
2020-10-29 21:32 ` Jakub Kicinski
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=e00771ccacb648b6a00b914e0421b080@realtek.com \
--to=willy.liu@realtek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@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).