diff options
author | Tom Rini <trini@konsulko.com> | 2017-10-11 00:14:38 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-10-11 00:14:38 (GMT) |
commit | 2ee87b0c1a5439e4ad6467cb8d5e8fb58922ca4b (patch) | |
tree | 96138b4bbe7b06ae10aae41ab1aac2a58dc5148d /drivers/net | |
parent | 45c9d96ae40b0c4292eb67d687f0bf698a0ce72b (diff) | |
parent | 17cf99a5bb904a6e7c8797db2632bbe65ae1cfb5 (diff) | |
download | u-boot-2ee87b0c1a5439e4ad6467cb8d5e8fb58922ca4b.tar.xz |
Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ravb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index 8db127b..dc7a525 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -18,6 +18,7 @@ #include <linux/mii.h> #include <wait_bit.h> #include <asm/io.h> +#include <asm/gpio.h> /* Registers */ #define RAVB_REG_CCC 0x000 @@ -122,6 +123,7 @@ struct ravb_priv { struct mii_dev *bus; void __iomem *iobase; struct clk clk; + struct gpio_desc reset_gpio; }; static inline void ravb_flush_dcache(u32 addr, u32 len) @@ -302,6 +304,13 @@ static int ravb_phy_config(struct udevice *dev) struct phy_device *phydev; int mask = 0xffffffff, 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_find_by_mask(eth->bus, mask, pdata->phy_interface); if (!phydev) return -ENODEV; @@ -483,6 +492,9 @@ static int ravb_probe(struct udevice *dev) if (ret < 0) goto err_mdio_alloc; + gpio_request_by_name_nodev(dev_ofnode(dev), "reset-gpios", 0, + ð->reset_gpio, GPIOD_IS_OUT); + mdiodev = mdio_alloc(); if (!mdiodev) { ret = -ENOMEM; @@ -516,6 +528,7 @@ static int ravb_remove(struct udevice *dev) free(eth->phydev); mdio_unregister(eth->bus); mdio_free(eth->bus); + dm_gpio_free(dev, ð->reset_gpio); unmap_physmem(eth->iobase, MAP_NOCACHE); return 0; |