From: Marek Vasut Date: Tue, 30 May 2023 22:51:27 +0000 (+0200) Subject: net: phy: Handle reset-delay-us/reset-post-delay-us properties X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=3015ae5febb8ae8cdbb45e6af5631590ae7259ce;p=u-boot.git net: phy: Handle reset-delay-us/reset-post-delay-us properties 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 Reviewed-by: Ramon Fried --- diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 231bad6651..9d1e8d38ff 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -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; }