[PATCH 11/14] net: ravb: Drop reset GPIO handling in favor of common code

Ramon Fried rfried.dev at gmail.com
Sat Jun 10 13:01:22 CEST 2023


On Wed, May 31, 2023 at 1:51 AM Marek Vasut
<marek.vasut+renesas at mailbox.org> wrote:
>
> The common code is now capable of handling reset GPIO associated
> with PHY. Drop the local ad-hoc code in favor of common code.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> ---
> Cc: Geert Uytterhoeven <geert+renesas at glider.be>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Michal Simek <michal.simek at amd.com>
> Cc: Nishanth Menon <nm at ti.com>
> Cc: Ramon Fried <rfried.dev at gmail.com>
> ---
>  drivers/net/Kconfig |  1 +
>  drivers/net/ravb.c  | 22 ----------------------
>  2 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 09039a283eb..48f9efcc94f 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -764,6 +764,7 @@ config RENESAS_RAVB
>         bool "Renesas Ethernet AVB MAC"
>         depends on RCAR_64
>         select PHYLIB
> +       select PHY_ETHERNET_ID
>         help
>           This driver implements support for the Ethernet AVB block in
>           Renesas M3 and H3 SoCs.
> diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
> index c74c8a81f94..0bcd6cfd3f3 100644
> --- a/drivers/net/ravb.c
> +++ b/drivers/net/ravb.c
> @@ -131,7 +131,6 @@ struct ravb_priv {
>         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)
> @@ -312,13 +311,6 @@ static int ravb_phy_config(struct udevice *dev)
>         struct phy_device *phydev;
>         int reg;
>
> -       if (dm_gpio_is_valid(&eth->reset_gpio)) {
> -               dm_gpio_set_value(&eth->reset_gpio, 1);
> -               mdelay(20);
> -               dm_gpio_set_value(&eth->reset_gpio, 0);
> -               mdelay(1);
> -       }
> -
>         phydev = phy_connect(eth->bus, -1, dev, pdata->phy_interface);
>         if (!phydev)
>                 return -ENODEV;
> @@ -503,7 +495,6 @@ static int ravb_probe(struct udevice *dev)
>  {
>         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;
> @@ -515,17 +506,6 @@ static int ravb_probe(struct udevice *dev)
>         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,
> -                                          &eth->reset_gpio, GPIOD_IS_OUT);
> -       }
> -
> -       if (!dm_gpio_is_valid(&eth->reset_gpio)) {
> -               gpio_request_by_name(dev, "reset-gpios", 0, &eth->reset_gpio,
> -                                    GPIOD_IS_OUT);
> -       }
> -
>         mdiodev = mdio_alloc();
>         if (!mdiodev) {
>                 ret = -ENOMEM;
> @@ -576,8 +556,6 @@ static int ravb_remove(struct udevice *dev)
>         free(eth->phydev);
>         mdio_unregister(eth->bus);
>         mdio_free(eth->bus);
> -       if (dm_gpio_is_valid(&eth->reset_gpio))
> -               dm_gpio_free(dev, &eth->reset_gpio);
>         unmap_physmem(eth->iobase, MAP_NOCACHE);
>
>         return 0;
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>


More information about the U-Boot mailing list