RE: [PATCH v2 2/2] net: ethernet: Add driver for Sunplus SP7021
flat view
From: Wells Lu 呂芳騰 <hidden>
Date: 2021-11-26 03:58:49
Also in:
linux-devicetree, lkml
Hi Andrew, I set phy-id registers to 30 and 31 and found the read-back values of mdio read commands from CPU are all 0x0000. I consulted with an ASIC engineer. She confirmed that if phy-id of a mdio command from CPU does not match any phy-id registers, the mdio command will not be sent out. She explained if phy-id of a mdio command does not match any phy-id registers (represent addresses of external PHYs), why MAC needs to send a command to non-existing PHY? Best regards, Wells Lu 呂芳騰 智能運算專案/Smart Computing Program 家庭平台事業群/Home Entertainment Business Unit 凌陽科技/Sunplus Technology Co., Ltd. 地址:300新竹科學園區創新一路19號 19, Innovation 1st Road, Science-based Industrial Park Hsin-Chu, Taiwan 300 TEL:886-3-5786005 ext. 2580
-----Original Message----- From: Andrew Lunn <andrew@lunn.ch> Sent: Thursday, November 25, 2021 11:21 PM To: Wells Lu 呂芳騰 <redacted> Cc: Wells Lu <wellslutw@gmail.com>; davem@davemloft.net; kuba@kernel.org; robh+dt@kernel.org; netdev@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; p.zabel@pengutronix.de; Vincent Shih 施錕鴻 [off-list ref] Subject: Re: [PATCH v2 2/2] net: ethernet: Add driver for Sunplus SP7021quoted
Due to hardware design, we still need to set PHY address, because MDIO controller of SP7021 only sends out MDIO commands with the same address listed in PHY address registers. The function below needs to be kept.I suggest you actually set it to some other address. One of the good/bad things about MDIO is you have no idea if the device is there. A read to a device which does not exist just returns 0xffff, not an error. So i would set the address of 0x1f. I've never seen a PHY actually use that address. Andrew