From: Andrew Lunn <andrew@lunn.ch>
To: Kyle Switch <kyle.switch@motor-comm.com>
Cc: olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, mmyangfl@gmail.com,
horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com
Subject: Re: [RFC net-next v2] net:dsa:yt922x: Add support for Motorcomm YT922x
Date: Fri, 28 Aug 2026 15:19:56 +0200 [thread overview]
Message-ID: <d3c8d8b7-7998-42ef-a518-9acb9a4c6038@lunn.ch> (raw)
In-Reply-To: <3e87da63-420b-4582-956c-2ecd853b0619@motor-comm.com>
> > > +static int yt922x_port_sds_init(struct yt921x_priv *priv, int port,
> > > + phy_interface_t interface)
> > > +{
> > > + int addr;
> > > + u16 data;
> > > + int res;
> > > +
> > > + addr = yt922x_sds_phyaddr_get(port,
> > > + YT922X_PHY_REG_TYPE_SDS_COMMON_EXT,
> > > + YT922X_PHY_REG_SPACE_SGMII);
> > > + if (addr < 0)
> > > + return -EINVAL;
> > > + /* write protect */
> > > + res = yt921x_intif_ext_write(priv, addr, 0x4be, 0xd);
> > > + if (res)
> > > + return res;
> > > + /* CDR */
> > > + if (interface == PHY_INTERFACE_MODE_100BASEX) {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x406, 0x0);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x416, 0x3458);
> > > + if (res)
> > > + return res;
> > > + } else {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x406, 0x800);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x416, 0x4558);
> > > + if (res)
> > > + return res;
> > > + }
> > > + /* PLL */
> > > + if (interface == PHY_INTERFACE_MODE_USXGMII) {
> > > + res = yt921x_intif_ext_write(priv, addr, 0x43a, 0x1006);
> > > + if (res)
> > > + return res;
> > > + res = yt921x_intif_ext_write(priv, addr, 0x43f, 0x3029);
> > > + if (res)
> > What is this function doing?
> Ans: Complete some init configuration according to serdes interface mode.
Sorry, missed this email until today.
Which SERDES? The switches SERDES, or the PHY SERDES.
We normally refer to the switch SERDES as a PCS, and have a PCS driver
for it. Sometimes you also need a generic PHY. Please look around at
other devices and understand the architecture.
The PHYs SERDES interface is configured by the PHY driver. The MAC
driver should never touch PHY registers. Same as the PHY driver should
never touch MAC registers.
Andrew
next prev parent reply other threads:[~2026-08-28 13:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 11:06 [RFC net-next v2] net:dsa:yt922x: Add support for Motorcomm YT922x Kyle Switch
2026-08-20 14:47 ` Andrew Lunn
2026-08-25 6:14 ` Kyle Switch
2026-08-28 13:19 ` Andrew Lunn [this message]
2026-09-04 9:37 ` Kyle Switch
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=d3c8d8b7-7998-42ef-a518-9acb9a4c6038@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jianmin.wang@motor-comm.com \
--cc=kuba@kernel.org \
--cc=kyle.switch@motor-comm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ming.xu@motor-comm.com \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=xiaolin.xu@motor-comm.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