[U-Boot] [PATCH 16/23] net: pch_gbe: Support PHY reset GPIOs

Simon Glass sjg at chromium.org
Tue Sep 27 02:35:29 CEST 2016


Hi Paul,

On 26 September 2016 at 12:29, Paul Burton <paul.burton at imgtec.com> wrote:
> Add support to the pch_gbe driver for resetting the PHY using a GPIO
> specified in the device tree. This matches the support already in Linux.
>
> Signed-off-by: Paul Burton <paul.burton at imgtec.com>
>
> ---
>
>  drivers/net/pch_gbe.c | 29 +++++++++++++++++++++++++++--
>  drivers/net/pch_gbe.h |  1 +
>  2 files changed, 28 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

>
> diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
> index 8866f66..cc3ca8b 100644
> --- a/drivers/net/pch_gbe.c
> +++ b/drivers/net/pch_gbe.c
> @@ -12,6 +12,7 @@
>  #include <asm/io.h>
>  #include <pci.h>
>  #include <miiphy.h>
> +#include <asm/gpio.h>
>  #include "pch_gbe.h"
>
>  #if !defined(CONFIG_PHYLIB)
> @@ -72,6 +73,14 @@ static int pch_gbe_reset(struct udevice *dev)
>         priv->rx_idx = 0;
>         priv->tx_idx = 0;
>
> +       if (dm_gpio_is_valid(&priv->gpio_phy_reset)) {
> +               /* Reset the PHY */
> +               dm_gpio_set_value(&priv->gpio_phy_reset, 1);

I'm assuming you don't check the return value because this GPIO might
not be valid / used?

Regards.
Simon


More information about the U-Boot mailing list