aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ftgmac100.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-11-06 09:45:33 -0500
committerTom Rini <trini@konsulko.com>2023-11-06 09:45:33 -0500
commitfd0d7d7efecd22d5a9cc77cb7589c4f144a1c506 (patch)
tree931e72fdf65dbfde58b84ee4de4d7cb1f360dbcf /drivers/net/ftgmac100.c
parenta4c83bda17196bf5d1ce640844595aaeced6465e (diff)
parentd44f3d21fe4420709b5a09379b809a3b92b7fa07 (diff)
Merge branch '2023-11-06-networking-updates'
- A few dhcp related improvements, be clearer to the user when we don't have a MAC address, assorted driver/phy improvements and new drivers.
Diffstat (limited to 'drivers/net/ftgmac100.c')
-rw-r--r--drivers/net/ftgmac100.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 587d3658fa..9b536fd5ab 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <clk.h>
+#include <reset.h>
#include <cpu_func.h>
#include <dm.h>
#include <log.h>
@@ -91,6 +92,7 @@ struct ftgmac100_data {
u32 max_speed;
struct clk_bulk clks;
+ struct reset_ctl *reset_ctl;
/* End of RX/TX ring buffer bits. Depend on model */
u32 rxdes0_edorr_mask;
@@ -569,6 +571,8 @@ static int ftgmac100_of_to_plat(struct udevice *dev)
priv->txdes0_edotr_mask = BIT(15);
}
+ priv->reset_ctl = devm_reset_control_get_optional(dev, NULL);
+
return clk_get_bulk(dev, &priv->clks);
}
@@ -594,6 +598,12 @@ static int ftgmac100_probe(struct udevice *dev)
if (ret)
goto out;
+ if (priv->reset_ctl) {
+ ret = reset_deassert(priv->reset_ctl);
+ if (ret)
+ goto out;
+ }
+
/*
* If DM MDIO is enabled, the MDIO bus will be initialized later in
* dm_eth_phy_connect
@@ -629,6 +639,8 @@ static int ftgmac100_remove(struct udevice *dev)
free(priv->phydev);
mdio_unregister(priv->bus);
mdio_free(priv->bus);
+ if (priv->reset_ctl)
+ reset_assert(priv->reset_ctl);
clk_release_bulk(&priv->clks);
return 0;