[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<BY3PR18MB4707F518B01F4DC0DEC99014A0932@BY3PR18MB4707.namprd18.prod.outlook.com>
Date: Tue, 3 Sep 2024 07:15:53 +0000
From: Sai Krishna Gajula <saikrishnag@...vell.com>
To: Frank Sae <Frank.Sae@...or-comm.com>, "andrew@...n.ch" <andrew@...n.ch>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"davem@...emloft.net"
<davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux@...linux.org.uk" <linux@...linux.org.uk>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"yuanlai.cui@...or-comm.com" <yuanlai.cui@...or-comm.com>,
"hua.sun@...or-comm.com" <hua.sun@...or-comm.com>,
"xiaoyong.li@...or-comm.com" <xiaoyong.li@...or-comm.com>,
"suting.hu@...or-comm.com" <suting.hu@...or-comm.com>,
"jie.han@...or-comm.com" <jie.han@...or-comm.com>
Subject: RE: [PATCH net-next v5 2/2] net: phy: Add driver for Motorcomm yt8821
2.5G ethernet phy
> -----Original Message-----
> From: Frank Sae <Frank.Sae@...or-comm.com>
> Sent: Sunday, September 1, 2024 2:05 PM
> To: Frank.Sae@...or-comm.com; andrew@...n.ch; hkallweit1@...il.com;
> davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; linux@...linux.org.uk
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> yuanlai.cui@...or-comm.com; hua.sun@...or-comm.com;
> xiaoyong.li@...or-comm.com; suting.hu@...or-comm.com;
> jie.han@...or-comm.com
> Subject: [PATCH net-next v5 2/2] net: phy: Add driver for
> Motorcomm yt8821 2.5G ethernet phy
>
> Add a driver for the motorcomm yt8821 2. 5G ethernet phy. Verified the
> driver on BPI-R3(with MediaTek MT7986(Filogic 830) SoC) development
> board, which is developed by Guangdong Bipai Technology Co. , Ltd. . yt8821
> 2. 5G ethernet phy works in AUTO_BX2500_SGMII
> Add a driver for the motorcomm yt8821 2.5G ethernet phy. Verified the driver
> on BPI-R3(with MediaTek MT7986(Filogic 830) SoC) development board,
> which is developed by Guangdong Bipai Technology Co., Ltd..
>
> yt8821 2.5G ethernet phy works in AUTO_BX2500_SGMII or FORCE_BX2500
> interface, supports 2.5G/1000M/100M/10M speeds, and wol(magic package).
>
> Signed-off-by: Frank Sae <Frank.Sae@...or-comm.com>
> ---
> v5:
> - added debug log when phy_select_page() returns an error.
> v4:
> - removed all these pointless goto err_restore_page;
> v3:
> - used existing API genphy_c45_pma_read_ext_abilities() to make source
> code more concise in yt8821_get_features().
> - used existing API genphy_c45_read_lpa() to make source code more
> concise in yt8821_read_status().
> - updated to return yt8521_aneg_done_paged() in yt8821_aneg_done();
> - moved __set_bit(PHY_INTERFACE_MODE_2500BASEX,
> phydev->possible_interfaces); out of these if() statements.
> v2:
> - removed motorcomm,chip-mode property in DT.
> - modified the magic numbers of _SETTING macro.
> - added ":" after returns in function's DOC.
> - updated YTPHY_SSR_SPEED_2500M val from 0x4 ((0x0 << 14) | BIT(9)).
> - yt8821gen_init_paged(phydev, YT8521_RSSR_FIBER_SPACE) and
> yt8821gen_init_paged(phydev, YT8521_RSSR_UTP_SPACE) updated to
> yt8821_serdes_init() and yt8821_utp_init().
> - removed phydev->irq = PHY_POLL; in yt8821_config_init().
> - instead of phydev_info(), phydev_dbg() used in yt8821_read_status().
> - instead of __assign_bit(), __set_bit() used.
> v1:
> - https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lore.kernel.org_netdev_20240727091906.1108588-2D1-2DFrank.Sae-
> 40motor-
> 2Dcomm.com_&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=c3MsgrR-U-
> HFhmFd6R4MWRZG-8QeikJn5PkjqMTpBSg&m=k0ZsE1i-
> Xu0ponl3ERRgwaF0OuMB9DiYrqmzVUTlZMwmIpvMewng9-
> VcAsRDdMk4&s=DU3XwIErGcIhDyR97l0HFVtcinHYcTlbCjdjHNzRUeg&e=
> - https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lore.kernel.org_netdev_20240727092009.1108640-2D1-2DFrank.Sae-
> 40motor-
> 2Dcomm.com_&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=c3MsgrR-U-
> HFhmFd6R4MWRZG-8QeikJn5PkjqMTpBSg&m=k0ZsE1i-
> Xu0ponl3ERRgwaF0OuMB9DiYrqmzVUTlZMwmIpvMewng9-
> VcAsRDdMk4&s=vmwqW2iUvHjPEXGxtUfa-NdCQVW3iBmqb8rqEO6X2cI&e=
> - https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lore.kernel.org_netdev_20240727092031.1108690-2D1-2DFrank.Sae-
> 40motor-
> 2Dcomm.com_&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=c3MsgrR-U-
> HFhmFd6R4MWRZG-8QeikJn5PkjqMTpBSg&m=k0ZsE1i-
> Xu0ponl3ERRgwaF0OuMB9DiYrqmzVUTlZMwmIpvMewng9-
> VcAsRDdMk4&s=pJ00YFp5DILsi-Jr4TdQBA4eY1Undb7zQHvN7at2I8k&e=
> ---
> drivers/net/phy/motorcomm.c | 671
> +++++++++++++++++++++++++++++++++++-
> 1 file changed, 667 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
> index fe0aabe12622..0e91f5d1a4fd 100644
> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0+
> /*
> - * Motorcomm 8511/8521/8531/8531S PHY driver.
> + * Motorcomm 8511/8521/8531/8531S/8821 PHY driver.
> *
> * Author: Peter Geis <pgwipeout@...il.com>
> * Author: Frank <Frank.Sae@...or-comm.com> @@ -16,8 +16,8 @@
> #define PHY_ID_YT8521 0x0000011a
> #define PHY_ID_YT8531 0x4f51e91b
> #define PHY_ID_YT8531S 0x4f51e91a
> -
> -/* YT8521/YT8531S Register Overview
> +#define PHY_ID_YT8821 0x4f51ea19
> +/* YT8521/YT8531S/YT8821 Register Overview
> * UTP Register space | FIBER Register space
> * ------------------------------------------------------------
> * | UTP MII | FIBER MII |
...
> +/**
> + * yt8821_utp_init() - utp init
> + * @phydev: a pointer to a &struct phy_device
> + *
> + * Returns: 0 or negative errno code
> + */
> +static int yt8821_utp_init(struct phy_device *phydev) {
> + int old_page;
> + int ret = 0;
> + u16 mask;
> + u16 save;
> + u16 set;
> +
> + old_page = phy_select_page(phydev, YT8521_RSSR_UTP_SPACE);
> + if (old_page < 0) {
> + phydev_err(phydev, "Failed to select page: %d\n",
> + old_page);
> + goto err_restore_page;
> + }
> +
> + mask = YT8821_UTP_EXT_RPDN_BP_FFE_LNG_2500 |
> + YT8821_UTP_EXT_RPDN_BP_FFE_SHT_2500 |
> + YT8821_UTP_EXT_RPDN_IPR_SHT_2500;
> + set = YT8821_UTP_EXT_RPDN_BP_FFE_LNG_2500 |
> + YT8821_UTP_EXT_RPDN_BP_FFE_SHT_2500;
> + ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_RPDN_CTRL_REG,
...
>
> module_phy_driver(motorcomm_phy_drvs);
>
> -MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S PHY driver");
> +MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S/8821 PHY
> driver");
> MODULE_AUTHOR("Peter Geis");
> MODULE_AUTHOR("Frank");
> MODULE_LICENSE("GPL");
> @@ -2318,6 +2980,7 @@ static const struct mdio_device_id
> __maybe_unused motorcomm_tbl[] = {
> { PHY_ID_MATCH_EXACT(PHY_ID_YT8521) },
> { PHY_ID_MATCH_EXACT(PHY_ID_YT8531) },
> { PHY_ID_MATCH_EXACT(PHY_ID_YT8531S) },
> + { PHY_ID_MATCH_EXACT(PHY_ID_YT8821) },
> { /* sentinel */ }
> };
>
> --
> 2.34.1
>
Reviewed-by: Sai Krishna <saikrishnag@...vell.com>
Powered by blists - more mailing lists