diff options
author | Tom Rini <trini@konsulko.com> | 2022-04-15 08:09:52 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-15 08:10:32 -0400 |
commit | 7f418ea59852945eeb9e5d2555d306f09643d555 (patch) | |
tree | 069dbaf3a1f62b68251189e9acdbd9affcbd98c5 /drivers/net/dwc_eth_qos.c | |
parent | 239fe55a6ce516f329687c0680428ca2acfc73ca (diff) | |
parent | 0154e6de37e8bbaac837939391f6d4a8f0b3fd18 (diff) |
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-net
- DM9000 DM support
- tftp server bug fix
- mdio ofnode support functions
- Various phy fixes and improvements.
[trini: Fixup merge conflicts in drivers/net/phy/ethernet_id.c
drivers/net/phy/phy.c include/phy.h]
Diffstat (limited to 'drivers/net/dwc_eth_qos.c')
-rw-r--r-- | drivers/net/dwc_eth_qos.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index ea0c2cfa5b..9d255cf95f 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -270,7 +270,7 @@ struct eqos_config { int config_mac; int config_mac_mdio; unsigned int axi_bus_width; - phy_interface_t (*interface)(struct udevice *dev); + phy_interface_t (*interface)(const struct udevice *dev); struct eqos_ops *ops; }; @@ -1682,7 +1682,7 @@ static int eqos_probe_resources_stm32(struct udevice *dev) interface = eqos->config->interface(dev); - if (interface == PHY_INTERFACE_MODE_NONE) { + if (interface == PHY_INTERFACE_MODE_NA) { pr_err("Invalid PHY interface\n"); return -EINVAL; } @@ -1729,21 +1729,7 @@ err_probe: return ret; } -static phy_interface_t eqos_get_interface_stm32(struct udevice *dev) -{ - const char *phy_mode; - phy_interface_t interface = PHY_INTERFACE_MODE_NONE; - - debug("%s(dev=%p):\n", __func__, dev); - - phy_mode = dev_read_prop(dev, "phy-mode", NULL); - if (phy_mode) - interface = phy_get_interface_by_name(phy_mode); - - return interface; -} - -static phy_interface_t eqos_get_interface_tegra186(struct udevice *dev) +static phy_interface_t eqos_get_interface_tegra186(const struct udevice *dev) { return PHY_INTERFACE_MODE_MII; } @@ -1757,7 +1743,7 @@ static int eqos_probe_resources_imx(struct udevice *dev) interface = eqos->config->interface(dev); - if (interface == PHY_INTERFACE_MODE_NONE) { + if (interface == PHY_INTERFACE_MODE_NA) { pr_err("Invalid PHY interface\n"); return -EINVAL; } @@ -1766,20 +1752,6 @@ static int eqos_probe_resources_imx(struct udevice *dev) return 0; } -static phy_interface_t eqos_get_interface_imx(struct udevice *dev) -{ - const char *phy_mode; - phy_interface_t interface = PHY_INTERFACE_MODE_NONE; - - debug("%s(dev=%p):\n", __func__, dev); - - phy_mode = dev_read_prop(dev, "phy-mode", NULL); - if (phy_mode) - interface = phy_get_interface_by_name(phy_mode); - - return interface; -} - static int eqos_remove_resources_tegra186(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -1985,7 +1957,7 @@ static const struct eqos_config __maybe_unused eqos_stm32_config = { .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_AV, .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300, .axi_bus_width = EQOS_AXI_WIDTH_64, - .interface = eqos_get_interface_stm32, + .interface = dev_read_phy_mode, .ops = &eqos_stm32_ops }; @@ -2013,7 +1985,7 @@ struct eqos_config __maybe_unused eqos_imx_config = { .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB, .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300, .axi_bus_width = EQOS_AXI_WIDTH_64, - .interface = eqos_get_interface_imx, + .interface = dev_read_phy_mode, .ops = &eqos_imx_ops }; |