summaryrefslogtreecommitdiff
path: root/drivers/net/tsec.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-04-15 13:11:19 -0400
committerTom Rini <trini@konsulko.com>2021-04-15 13:11:19 -0400
commit45b3cf88da24206a6cb847efe837fddc120af3e8 (patch)
tree0c2054e1af2af9dc752205ec8ee003e4399045b5 /drivers/net/tsec.c
parentb86772eda6033ea795e42f5463d436057919b6be (diff)
parent20830d0c01b5d82c916010b5dfdbe099ca1f0444 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
update ls1028aqds networking protocol, config in ls1021atwr, env in ls1012a Add seli3 board support, booke watchdog, update eTSEC support in ppc-qemu Add DM_SERIAL and lpuart in sl28, add DM_ETH support for some of powerpc platforms Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/net/tsec.c')
-rw-r--r--drivers/net/tsec.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index ec486893725..c68e4b7fb5e 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -707,11 +707,7 @@ static int init_phy(struct tsec_private *priv)
tsec_configure_serdes(priv);
#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_MDIO)
- if (ofnode_valid(ofnode_find_subnode(dev_ofnode(priv->dev),
- "fixed-link")))
- phydev = phy_connect(NULL, 0, priv->dev, priv->interface);
- else
- phydev = dm_eth_phy_connect(priv->dev);
+ phydev = dm_eth_phy_connect(priv->dev);
#else
phydev = phy_connect(priv->bus, priv->phyaddr, priv->dev,
priv->interface);
@@ -830,14 +826,40 @@ int tsec_probe(struct udevice *dev)
u32 tbiaddr = CONFIG_SYS_TBIPA_VALUE;
struct tsec_data *data;
const char *phy_mode;
+ ofnode parent, child;
fdt_addr_t reg;
- ofnode parent;
int ret;
data = (struct tsec_data *)dev_get_driver_data(dev);
pdata->iobase = (phys_addr_t)dev_read_addr(dev);
- priv->regs = dev_remap_addr(dev);
+ if (pdata->iobase == FDT_ADDR_T_NONE) {
+ ofnode_for_each_subnode(child, dev_ofnode(dev)) {
+ if (strncmp(ofnode_get_name(child), "queue-group",
+ strlen("queue-group")))
+ continue;
+
+ reg = ofnode_get_addr(child);
+ if (reg == FDT_ADDR_T_NONE) {
+ printf("No 'reg' property of <queue-group>\n");
+ return -ENOENT;
+ }
+ pdata->iobase = reg;
+
+ /*
+ * if there are multiple queue groups,
+ * only the first one is used.
+ */
+ break;
+ }
+
+ if (!ofnode_valid(child)) {
+ printf("No child node for <queue-group>?\n");
+ return -ENOENT;
+ }
+ }
+
+ priv->regs = map_physmem(pdata->iobase, 0, MAP_NOCACHE);
ret = dev_read_phandle_with_args(dev, "tbi-handle", NULL, 0, 0,
&phandle_args);