diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/designware.c | 10 | ||||
-rw-r--r-- | drivers/net/designware.h | 7 | ||||
-rw-r--r-- | drivers/net/phy/aquantia.c | 28 | ||||
-rw-r--r-- | drivers/net/rtl8169.c | 4 |
4 files changed, 44 insertions, 5 deletions
diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 8858f07..8ba72e3 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -80,7 +80,7 @@ static int dw_mdio_write(struct mii_dev *bus, int addr, int devad, int reg, return ret; } -#if CONFIG_DM_ETH +#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO) static int dw_mdio_reset(struct mii_dev *bus) { struct udevice *dev = bus->priv; @@ -126,7 +126,7 @@ static int dw_mdio_init(const char *name, void *priv) bus->read = dw_mdio_read; bus->write = dw_mdio_write; snprintf(bus->name, sizeof(bus->name), "%s", name); -#ifdef CONFIG_DM_ETH +#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO) bus->reset = dw_mdio_reset; #endif @@ -690,11 +690,15 @@ static const struct eth_ops designware_eth_ops = { static int designware_eth_ofdata_to_platdata(struct udevice *dev) { struct dw_eth_pdata *dw_pdata = dev_get_platdata(dev); +#ifdef CONFIG_DM_GPIO struct dw_eth_dev *priv = dev_get_priv(dev); +#endif struct eth_pdata *pdata = &dw_pdata->eth_pdata; const char *phy_mode; const fdt32_t *cell; +#ifdef CONFIG_DM_GPIO int reset_flags = GPIOD_IS_OUT; +#endif int ret = 0; pdata->iobase = dev_get_addr(dev); @@ -712,6 +716,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev) if (cell) pdata->max_speed = fdt32_to_cpu(*cell); +#ifdef CONFIG_DM_GPIO if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset, "snps,reset-active-low")) reset_flags |= GPIOD_ACTIVE_LOW; @@ -724,6 +729,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev) } else if (ret == -ENOENT) { ret = 0; } +#endif return ret; } diff --git a/drivers/net/designware.h b/drivers/net/designware.h index 51ba769..d345c5b 100644 --- a/drivers/net/designware.h +++ b/drivers/net/designware.h @@ -8,7 +8,9 @@ #ifndef _DW_ETH_H #define _DW_ETH_H -#include <asm/gpio.h> +#ifdef CONFIG_DM_GPIO +#include <asm-generic/gpio.h> +#endif #define CONFIG_TX_DESCR_NUM 16 #define CONFIG_RX_DESCR_NUM 16 @@ -234,7 +236,10 @@ struct dw_eth_dev { #ifndef CONFIG_DM_ETH struct eth_device *dev; #endif +#ifdef CONFIG_DM_GPIO struct gpio_desc reset_gpio; +#endif + struct phy_device *phydev; struct mii_dev *bus; }; diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index f90c2ae..ad12f6d 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -147,6 +147,32 @@ struct phy_driver aqr105_driver = { .shutdown = &gen10g_shutdown, }; +struct phy_driver aqr106_driver = { + .name = "Aquantia AQR106", + .uid = 0x3a1b4d0, + .mask = 0xfffffff0, + .features = PHY_10G_FEATURES, + .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS| + MDIO_MMD_PHYXS | MDIO_MMD_AN | + MDIO_MMD_VEND1), + .config = &aquantia_config, + .startup = &aquantia_startup, + .shutdown = &gen10g_shutdown, +}; + +struct phy_driver aqr107_driver = { + .name = "Aquantia AQR107", + .uid = 0x3a1b4e0, + .mask = 0xfffffff0, + .features = PHY_10G_FEATURES, + .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS| + MDIO_MMD_PHYXS | MDIO_MMD_AN | + MDIO_MMD_VEND1), + .config = &aquantia_config, + .startup = &aquantia_startup, + .shutdown = &gen10g_shutdown, +}; + struct phy_driver aqr405_driver = { .name = "Aquantia AQR405", .uid = 0x3a1b4b2, @@ -165,6 +191,8 @@ int phy_aquantia_init(void) phy_register(&aq1202_driver); phy_register(&aq2104_driver); phy_register(&aqr105_driver); + phy_register(&aqr106_driver); + phy_register(&aqr107_driver); phy_register(&aqr405_driver); return 0; diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 843b083..1cc0b40 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -666,12 +666,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase, puts("tx timeout/error\n"); printf("%s elapsed time : %lu\n", __func__, currticks()-stime); #endif - ret = 0; + ret = -ETIMEDOUT; } else { #ifdef DEBUG_RTL8169_TX puts("tx done\n"); #endif - ret = length; + ret = 0; } /* Delay to make net console (nc) work properly */ udelay(20); |