[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <984041835.384768.1737560006836.JavaMail.zimbra@couthit.local>
Date: Wed, 22 Jan 2025 21:03:26 +0530 (IST)
From: Basharath Hussain Khaja <basharath@...thit.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: basharath <basharath@...thit.com>, danishanwar <danishanwar@...com>,
rogerq <rogerq@...nel.org>, andrew+netdev <andrew+netdev@...n.ch>,
davem <davem@...emloft.net>, edumazet <edumazet@...gle.com>,
kuba <kuba@...nel.org>, pabeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>, krzk+dt <krzk+dt@...nel.org>,
conor+dt <conor+dt@...nel.org>, nm <nm@...com>,
ssantosh <ssantosh@...nel.org>, tony <tony@...mide.com>,
richardcochran <richardcochran@...il.com>,
parvathi <parvathi@...thit.com>, schnelle <schnelle@...ux.ibm.com>,
rdunlap <rdunlap@...radead.org>, diogo ivo <diogo.ivo@...mens.com>,
m-karicheri2 <m-karicheri2@...com>, horms <horms@...nel.org>,
jacob e keller <jacob.e.keller@...el.com>,
m-malladi <m-malladi@...com>,
javier carrasco cruz <javier.carrasco.cruz@...il.com>,
afd <afd@...com>, s-anna <s-anna@...com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
netdev <netdev@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-omap <linux-omap@...r.kernel.org>,
pratheesh <pratheesh@...com>, prajith <prajith@...com>,
vigneshr <vigneshr@...com>, praneeth <praneeth@...com>,
srk <srk@...com>, rogerq <rogerq@...com>,
krishna <krishna@...thit.com>, pmohan <pmohan@...thit.com>,
mohan <mohan@...thit.com>
Subject: Re: [RFC PATCH 02/10] net: ti: prueth: Adds ICSSM Ethernet driver
>> + emac->phy_node = of_parse_phandle(eth_node, "phy-handle", 0);
>> + if (!emac->phy_node) {
>> + dev_err(prueth->dev, "couldn't find phy-handle\n");
>> + ret = -ENODEV;
>> + goto free;
>> + }
>> +
>> + ret = of_get_phy_mode(eth_node, &emac->phy_if);
>> + if (ret) {
>> + dev_err(prueth->dev, "could not get phy-mode property err %d\n",
>> + ret);
>> + goto free;
>> + }
>> +
>> + /* connect PHY */
>> + emac->phydev = of_phy_connect(ndev, emac->phy_node,
>> + &icssm_emac_adjust_link, 0, emac->phy_if);
>> + if (!emac->phydev) {
>> + dev_dbg(prueth->dev, "couldn't connect to phy %s\n",
>> + emac->phy_node->full_name);
>> + ret = -EPROBE_DEFER;
>> + goto free;
>> + }
>
> of_phy_get_and_connect() will simplify this.
>
Yes. This API does same functionality, we will replace three APIs with single
API in the next version.
>> + /* remove unsupported modes */
>> + phy_remove_link_mode(emac->phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
>> + phy_remove_link_mode(emac->phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT);
>
> It only does 100Mbps?
>
It is capable of both 100M/10M full/half-duplex modes. In this patch series we are
adding support for 100M full duplex operation. Support for other modes will be added
subsequently.
>> + if (of_property_read_bool(eth_node, "ti,no-half-duplex")) {
>
> Is this becasue 100baseT_Half is broken in some versions of the
> hardware?
>
No.This property will be removed as we have added support only for 100M full duplex.
>> + phy_remove_link_mode(emac->phydev,
>> + ETHTOOL_LINK_MODE_100baseT_Half_BIT);
>> + }
>> +
>> + phy_remove_link_mode(emac->phydev, ETHTOOL_LINK_MODE_Pause_BIT);
>> + phy_remove_link_mode(emac->phydev, ETHTOOL_LINK_MODE_Asym_Pause_BIT);
>
> Is this really needed? I've not checked, but if you don't call
> phy_support_sym_pause() or phy_support_asym_pause(), i would of
> expected phylib to default to no pause?
>
Though TI PHY default state is clear(ASM_DIR - 0 & PAUSE - 0 as Default
state in ANAR register), this bits are cleared again to handle if in case
of change in PHY.
>> +static const struct of_device_id prueth_dt_match[];
>
> Please avoid forward references. If you need the match table, define
> it here.
>
Sure. This got escaped while cleanup. We will address this in the next version.
Thanks & Best Regards,
Basharath
Powered by blists - more mailing lists