struct mii_dev *bus;
void __iomem *iobase;
struct clk_bulk clks;
- struct gpio_desc reset_gpio;
};
static inline void ravb_flush_dcache(u32 addr, u32 len)
struct phy_device *phydev;
int reg;
- if (dm_gpio_is_valid(ð->reset_gpio)) {
- dm_gpio_set_value(ð->reset_gpio, 1);
- mdelay(20);
- dm_gpio_set_value(ð->reset_gpio, 0);
- mdelay(1);
- }
-
phydev = phy_connect(eth->bus, -1, dev, pdata->phy_interface);
if (!phydev)
return -ENODEV;
{
struct eth_pdata *pdata = dev_get_plat(dev);
struct ravb_priv *eth = dev_get_priv(dev);
- struct ofnode_phandle_args phandle_args;
struct mii_dev *mdiodev;
void __iomem *iobase;
int ret;
if (ret < 0)
goto err_mdio_alloc;
- ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, &phandle_args);
- if (!ret) {
- gpio_request_by_name_nodev(phandle_args.node, "reset-gpios", 0,
- ð->reset_gpio, GPIOD_IS_OUT);
- }
-
- if (!dm_gpio_is_valid(ð->reset_gpio)) {
- gpio_request_by_name(dev, "reset-gpios", 0, ð->reset_gpio,
- GPIOD_IS_OUT);
- }
-
mdiodev = mdio_alloc();
if (!mdiodev) {
ret = -ENOMEM;
free(eth->phydev);
mdio_unregister(eth->bus);
mdio_free(eth->bus);
- if (dm_gpio_is_valid(ð->reset_gpio))
- dm_gpio_free(dev, ð->reset_gpio);
unmap_physmem(eth->iobase, MAP_NOCACHE);
return 0;