mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
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 <s-vadapalli@ti.com>
Reviewed-by: Anshul Dalal <anshuld@ti.com>
This commit is contained in:
committed by
Jerome Forissier
parent
ae8987f4e6
commit
e86d1c0b88
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user