]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: phy: Handle reset-delay-us/reset-post-delay-us properties
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Tue, 30 May 2023 22:51:27 +0000 (00:51 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 10 Jun 2023 11:34:05 +0000 (13:34 +0200)
These two properties are used by various DTs in place of
current reset-assert-us/reset-deassert-us , handle both .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/eth-phy-uclass.c

index 231bad6651415c6e746627c6a0ae5dae2f762ae3..9d1e8d38ffa693741ce9ffecc484f2dc36173fc1 100644 (file)
@@ -144,6 +144,14 @@ static int eth_phy_of_to_plat(struct udevice *dev)
        uc_priv->reset_assert_delay = dev_read_u32_default(dev, "reset-assert-us", 0);
        uc_priv->reset_deassert_delay = dev_read_u32_default(dev, "reset-deassert-us", 0);
 
+       /* These are used by some DTs, try these as a fallback. */
+       if (!uc_priv->reset_assert_delay && !uc_priv->reset_deassert_delay) {
+               uc_priv->reset_assert_delay =
+                       dev_read_u32_default(dev, "reset-delay-us", 0);
+               uc_priv->reset_deassert_delay =
+                       dev_read_u32_default(dev, "reset-post-delay-us", 0);
+       }
+
        return 0;
 }