[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de>
Date: Fri, 21 Oct 2022 08:04:51 +0200
From: Frank Wunderlich <frank-w@...lic-files.de>
To: "Russell King (Oracle)" <linux@...linux.org.uk>,
Frank Wunderlich <linux@...web.de>
CC: linux-mediatek@...ts.infradead.org,
Alexander Couzens <lynxis@...0.eu>,
Felix Fietkau <nbd@....name>, John Crispin <john@...ozen.org>,
Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops
Am 20. Oktober 2022 18:17:41 MESZ schrieb "Russell King (Oracle)" <linux@...linux.org.uk>:
>On Thu, Oct 20, 2022 at 04:44:31PM +0200, Frank Wunderlich wrote:
>> diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii.c b/drivers/net/ethernet/mediatek/mtk_sgmii.c
>> index 736839c84130..8b7465057e57 100644
>> --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
>> +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
>> @@ -122,7 +122,21 @@ static void mtk_pcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
>> regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
>> }
>>
>> +static void mtk_pcs_get_state(struct phylink_pcs *pcs, struct phylink_link_state *state)
>> +{
>> + struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs);
>> + unsigned int val;
>> +
>> + regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
>> + state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000;
>> +
>
>Sorry, looking back at my initial comment on the first revision of this
>patch, I see my second point was confused. It should have read:
>
>"2) There should also be a setting for state->duplex."
>
>IOW, "duplex" instead of "pause".
>
>Also, is there no way to read the link partner advertisement?
Hi,
On my board (bpi-r3) we have no autoneg on the gmacs. We have a switch (mt7531) with fixed-link on the first and a sfp-cage on the other. Second mac gets speed-setting (1000base-X or 2500base-X) from sfp eeprom, but no advertisement from the "other end". Imho it is always full duplex.
I have no register documentation to check if there is any way to read out pause/duplex setting. Maybe MTK can answer this or extend function later.
regards Frank
Powered by blists - more mailing lists