aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ti
diff options
context:
space:
mode:
authorRavi Gunasekaran2022-09-22 15:21:24 +0530
committerTom Rini2022-10-06 21:05:17 -0400
commitd0fc8182596167ff71c73d9c9e4db69cf84c6071 (patch)
tree53218350b4ff280c3ba32e16dfee35875c25fa0e /drivers/net/ti
parent9ea30ea66a57b47f42d68733840adf43714eb882 (diff)
net: ti: am65-cpsw-nuss: Enable MDIO manual mode
For the TI SoCs affected by errata i2329, enable MDIO manual mode by default Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers/net/ti')
-rw-r--r--drivers/net/ti/am65-cpsw-nuss.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
index 3d0a329aa1a..f674b0baa35 100644
--- a/drivers/net/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ti/am65-cpsw-nuss.c
@@ -21,6 +21,7 @@
#include <net.h>
#include <phy.h>
#include <power-domain.h>
+#include <soc.h>
#include <linux/bitops.h>
#include <linux/soc/ti/ti-udma.h>
@@ -127,6 +128,8 @@ struct am65_cpsw_priv {
bool has_phy;
ofnode phy_node;
u32 phy_addr;
+
+ bool mdio_manual_mode;
};
#ifdef PKTSIZE_ALIGN
@@ -541,6 +544,20 @@ static const struct eth_ops am65_cpsw_ops = {
.read_rom_hwaddr = am65_cpsw_read_rom_hwaddr,
};
+static const struct soc_attr k3_mdio_soc_data[] = {
+ { .family = "AM62X", .revision = "SR1.0" },
+ { .family = "AM64X", .revision = "SR1.0" },
+ { .family = "AM64X", .revision = "SR2.0" },
+ { .family = "AM65X", .revision = "SR1.0" },
+ { .family = "AM65X", .revision = "SR2.0" },
+ { .family = "J7200", .revision = "SR1.0" },
+ { .family = "J7200", .revision = "SR2.0" },
+ { .family = "J721E", .revision = "SR1.0" },
+ { .family = "J721E", .revision = "SR1.1" },
+ { .family = "J721S2", .revision = "SR1.0" },
+ { /* sentinel */ },
+};
+
static int am65_cpsw_mdio_init(struct udevice *dev)
{
struct am65_cpsw_priv *priv = dev_get_priv(dev);
@@ -553,7 +570,7 @@ static int am65_cpsw_mdio_init(struct udevice *dev)
cpsw_common->mdio_base,
cpsw_common->bus_freq,
clk_get_rate(&cpsw_common->fclk),
- false);
+ priv->mdio_manual_mode);
if (!cpsw_common->bus)
return -EFAULT;
@@ -658,6 +675,10 @@ static int am65_cpsw_port_probe(struct udevice *dev)
sprintf(portname, "%s%s", dev->parent->name, dev->name);
device_set_name(dev, portname);
+ priv->mdio_manual_mode = false;
+ if (soc_device_match(k3_mdio_soc_data))
+ priv->mdio_manual_mode = true;
+
ret = am65_cpsw_ofdata_parse_phy(dev);
if (ret)
goto out;