[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e766eb6d-618a-43a0-b1e1-954c2c3fbf0e@kwiboo.se>
Date: Thu, 20 Mar 2025 00:00:26 +0100
From: Jonas Karlman <jonas@...boo.se>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiko Stuebner <heiko@...ech.de>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S . Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Maxime Coquelin
<mcoquelin.stm32@...il.com>, Alexandre Torgue
<alexandre.torgue@...s.st.com>, Philipp Zabel <p.zabel@...gutronix.de>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, David Wu <david.wu@...k-chips.com>,
Yao Zi <ziyao@...root.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-rockchip@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH net-next v3 3/5] net: stmmac: dwmac-rk: Move
integrated_phy_powerup/down functions
Hi Andrew,
On 2025-03-19 23:39, Andrew Lunn wrote:
> On Wed, Mar 19, 2025 at 09:44:07PM +0000, Jonas Karlman wrote:
>> Rockchip RK3528 (and RV1106) has a different integrated PHY compared to
>> the integrated PHY on RK3228/RK3328. Current powerup/down operation is
>> not compatible with the integrated PHY found in these SoCs.
>>
>> Move the rk_gmac_integrated_phy_powerup/down functions to top of the
>> file to prepare for them to be called directly by a GMAC variant
>> specific powerup/down operation.
>>
>> Signed-off-by: Jonas Karlman <jonas@...boo.se>
>
> Reviewed-by: Andrew Lunn <andrew@...n.ch>
>
>> +#define RK_GRF_CON2_MACPHY_ID HIWORD_UPDATE(0x1234, 0xffff, 0)
>> +#define RK_GRF_CON3_MACPHY_ID HIWORD_UPDATE(0x35, 0x3f, 0)
>> +
>> +static void rk_gmac_integrated_phy_powerup(struct rk_priv_data *priv)
>> +{
>> + if (priv->ops->integrated_phy_powerup)
>> + priv->ops->integrated_phy_powerup(priv);
>> +
>> + regmap_write(priv->grf, RK_GRF_MACPHY_CON0, RK_MACPHY_CFG_CLK_50M);
>> + regmap_write(priv->grf, RK_GRF_MACPHY_CON0, RK_GMAC2PHY_RMII_MODE);
>> +
>> + regmap_write(priv->grf, RK_GRF_MACPHY_CON2, RK_GRF_CON2_MACPHY_ID);
>> + regmap_write(priv->grf, RK_GRF_MACPHY_CON3, RK_GRF_CON3_MACPHY_ID);
>
> I know you are just moving code around....
>
> Do you know what these MACPHY_ID are? I hope it is not what you get
> when you read PHY registers 2 and 3?
I think it may be:
GRF_MACPHY_CON2
15:0 macphy_id / PHY ID Number, macphy_cfg_phy_id[15:0]
GRF_MACPHY_CON3
15:12 macphy_cfg_rev_nr / Manufacturer's Revision Number
11:6 macphy_model_nr / Manufacturer's Model Number
5:0 macphy_id / PHY ID Number, macphy_cfg_phy_id[21:16]
and
MACPHY_PHY_IDENTIFIER1 - Address: 02
15:0 PHY ID number / default:cfg_phy_id[15:0]
MACPHY_PHY_IDENTIFIER2 - Address: 03
15:10 PHY ID number / default:cfg_phy_id[21:16]
9:4 Model number / default:cfg_model_nr[5:0]
3:0 Revision number / default:cfg_rev_nr[3:0]
So likely what you get when you read PHY registers 2 and 3.
Regards,
Jonas
>
> Andrew
Powered by blists - more mailing lists