[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gwtiuotmwj2x3d5rhfrploj7o763yjye4jj7vniomv77s7crqx@5jwrpwrlwn4s>
Date: Mon, 21 Oct 2024 20:38:11 +0800
From: Inochi Amaoto <inochiama@...il.com>
To: Andrew Lunn <andrew@...n.ch>, Inochi Amaoto <inochiama@...il.com>
Cc: Chen Wang <unicorn_wang@...look.com>,
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>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Inochi Amaoto <inochiama@...look.com>, Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Richard Cochran <richardcochran@...il.com>, Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Giuseppe Cavallaro <peppe.cavallaro@...com>, Yixun Lan <dlan@...too.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com, linux-arm-kernel@...ts.infradead.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
On Mon, Oct 21, 2024 at 02:22:47PM +0200, Andrew Lunn wrote:
> > +static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
> > +{
> > + struct sophgo_dwmac *dwmac = priv;
> > + unsigned long rate;
> > + int ret;
> > +
> > + switch (speed) {
> > + case SPEED_1000:
> > + rate = 125000000;
> > + break;
> > + case SPEED_100:
> > + rate = 25000000;
> > + break;
> > + case SPEED_10:
> > + rate = 2500000;
> > + break;
> > + default:
> > + dev_err(dwmac->dev, "invalid speed %u\n", speed);
> > + break;
> > + }
>
> There was a helper added recently for this, since it appears
> repeatedly in drivers.
>
OK, I will change it.
> > + ret = regmap_set_bits(regmap, args[0], DWMAC_SG2044_FLAG_USE_RX_DELAY);
> > + if (ret)
> > + return dev_err_probe(&pdev->dev, ret,
> > + "failed to set the phy rx delay\n");
>
> Please could you explain what this delay is for. Is it the 2ns RGMII
> delay?
>
> Andrew
It is related to the RGMII delay. On sg2044, when the phy
sets rx-delay, the interal mac is not set the same delay,
so this is needed to be set.
Regards,
Inochi
Powered by blists - more mailing lists