[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0948803-b1cb-4a8b-8c4d-55785d5ba39b@lunn.ch>
Date: Fri, 15 Aug 2025 20:23:10 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jacky Chou <jacky_chou@...eedtech.com>
Cc: 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>, Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...econstruct.com.au>,
Simon Horman <horms@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Po-Yu Chuang <ratbert@...aday-tech.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-aspeed@...ts.ozlabs.org,
taoren@...a.com, bmc-sw2@...eedtech.com
Subject: Re: [net-next v2 4/4] net: ftgmac100: Add RGMII delay configuration
for AST2600
On Wed, Aug 13, 2025 at 02:33:01PM +0800, Jacky Chou wrote:
> In AST2600, the RGMII delay is configured in SCU register.
> The MAC0/1 and the MAC2/3 on AST2600 have different delay unit with
> their delay chain.
> These MACs all have the 32 stage to configure delay chain.
> |Delay Unit|Delay Stage|TX Edge Stage|RX Edge Stage|
> ------+----------+-----------+-------------+-------------+
> MAC0/1| 45 ps| 32 | 0 | 0 |
> ------+----------+-----------+-------------+-------------+
> MAC2/3| 250 ps| 32 | 0 | 26 |
> ------+----------+-----------+-------------+-------------+
> The RX edge stage of MAC2 and MAC3 are strating from 26.
strating?
> +static void ftgmac100_set_internal_delay(struct platform_device *pdev)
> +{
> + struct device_node *np = pdev->dev.of_node;
> + struct regmap *scu;
> + u32 rgmii_tx_delay;
> + u32 rgmii_rx_delay;
> + int dly_mask;
> + int dly_reg;
> + int id;
> +
> + if (!(of_device_is_compatible(np, "aspeed,ast2600-mac01") ||
> + of_device_is_compatible(np, "aspeed,ast2600-mac23")))
> + return;
> +
> + /* If lack one of them, do not configure anything */
> + if (of_property_read_u32(np, "tx-internal-delay-ps", &rgmii_tx_delay)) {
> + dev_warn(&pdev->dev, "failed to get tx-internal-delay-ps\n");
> + return;
> + }
> + if (of_property_read_u32(np, "rx-internal-delay-ps", &rgmii_rx_delay)) {
> + dev_warn(&pdev->dev, "failed to get tx-internal-delay-ps\n");
> + return;
> + }
If these properties are required, but are missing, the DT blob is
broken. Please return -EINVAL, and fail the probe.
Please make all errors in this function due to a bad DT blob fatal.
Andrew
Powered by blists - more mailing lists