From: Siddharth Vadapalli Date: Mon, 6 Apr 2026 12:45:57 +0000 (+0530) Subject: net: phy: dp83867: default to 2ns delay if unspecified in device-tree X-Git-Tag: v2026.07-rc2~15^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e86d1c0b883e1be99f416089012af36219158c08;p=thirdparty%2Fu-boot.git net: phy: dp83867: default to 2ns delay if unspecified in device-tree Since Linux commit c360eb0c3ccb ("dt-bindings: net: ethernet-controller: Add informative text about RGMII delays"), the interpretation of RGMII delays has changed. Prior to the commit, the RGMII Variant among "rgmii", "rgmii-id", "rgmii-rxid" and "rgmii-txid" clearly specified whether it is the MAC or the PHY that "should" add the delay. However, post that commit, the RGMII Variant only specifies whether or not there is a delay on the PCB traces between the MAC and the PHY, leaving it open as to who adds the delay. Hence, instead of enforcing the existence of the device-tree properties "ti,rx-internal-delay" and "ti,tx-internal-delay", default to a delay of 2ns, while continuing to override this delay with the aforementioned properties, if they exist in the device-tree. This is in line with the Linux driver implementation updated by commit 6bf78849371d ("net: phy: dp83867: use 2ns delay if not specified in DTB"). Signed-off-by: Siddharth Vadapalli Reviewed-by: Anshul Dalal --- diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 7ce03b59b6a..ebed61de133 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -203,32 +203,24 @@ static int dp83867_of_init(struct phy_device *phydev) "Should be 'rgmii-id' to use internal delays\n"); } - /* RX delay *must* be specified if internal delay of RX is used. */ + dp83867->rx_id_delay = DP83867_RGMIIDCTL_2_00_NS; if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { ret = ofnode_read_u32(node, "ti,rx-internal-delay", &dp83867->rx_id_delay); - if (ret) { - pr_debug("ti,rx-internal-delay must be specified\n"); - return ret; - } - if (dp83867->rx_id_delay > DP83867_RGMII_RX_CLK_DELAY_MAX) { + if (!ret && dp83867->rx_id_delay > DP83867_RGMII_RX_CLK_DELAY_MAX) { pr_debug("ti,rx-internal-delay value of %u out of range\n", dp83867->rx_id_delay); return -EINVAL; } } - /* TX delay *must* be specified if internal delay of RX is used. */ + dp83867->tx_id_delay = DP83867_RGMIIDCTL_2_00_NS; if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { ret = ofnode_read_u32(node, "ti,tx-internal-delay", &dp83867->tx_id_delay); - if (ret) { - debug("ti,tx-internal-delay must be specified\n"); - return ret; - } - if (dp83867->tx_id_delay > DP83867_RGMII_TX_CLK_DELAY_MAX) { + if (!ret && dp83867->tx_id_delay > DP83867_RGMII_TX_CLK_DELAY_MAX) { pr_debug("ti,tx-internal-delay value of %u out of range\n", dp83867->tx_id_delay); return -EINVAL;