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;
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
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);
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;
} else if (ret == -ENOENT) {
ret = 0;
}
+#endif
return ret;
}
#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
#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;
};