Re: [RFC net-next v2] net:dsa:yt922x: Add support for Motorcomm YT922x
From: Kyle Switch
Date: Fri Sep 04 2026 - 05:57:44 EST
On 8/28/26 21:19, Andrew Lunn wrote:
Sorry, missed this email until today.Ans: Complete some init configuration according to serdes interface mode.+static int yt922x_port_sds_init(struct yt921x_priv *priv, int port,What is this function doing?
+ 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)
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.
Ans: Okay, this is the switch SerDes. We will refer to the existing
implementation and modify the code logic accordingly
Andrew