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