[PATCH 2/3] ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree

Sascha Hauer s.hauer at pengutronix.de
Fri Nov 22 02:09:07 EST 2013


On Wed, Nov 20, 2013 at 10:22:25PM +0100, Rostislav Lisovy wrote:
> Signed-off-by: Rostislav Lisovy <lisovy at gmail.com>
> 
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index 2f31352..31fb2aa 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -27,6 +27,8 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <of_net.h>
> +#include <of_gpio.h>
> +#include <gpio.h>
>  
>  #include <asm/mmu.h>
>  
> @@ -643,6 +645,7 @@ static int fec_probe(struct device_d *dev)
>  	void *base;
>  	int ret;
>  	enum fec_type type;
> +	int phy_reset;
>  
>  	ret = dev_get_drvdata(dev, (unsigned long *)&type);
>  	if (ret)
> @@ -671,6 +674,22 @@ static int fec_probe(struct device_d *dev)
>  
>  	fec->regs = dev_request_mem_region(dev, 0);
>  
> +	phy_reset = of_get_named_gpio(dev->device_node, "phy-reset-gpios", 0);
> +	if (!gpio_is_valid(phy_reset)) {
> +		dev_info(dev, "'phy-reset' gpio is not valid\n");

Applied this series, but dropped this message. The problem with these
kind of messages is that now nearly all i.MX users start seeing it and
wonder if this is something they have to care about.

Sascha

> +	} else {
> +		ret = gpio_request(phy_reset, "phy-reset");
> +		if (ret)
> +			goto err_free;
> +
> +		ret = gpio_direction_output(phy_reset, 0);
> +		if (ret)
> +			goto err_free;
> +
> +		udelay(10);
> +		gpio_set_value(phy_reset, 1);
> +	}
> +
>  	/* Reset chip. */
>  	writel(FEC_ECNTRL_RESET, fec->regs + FEC_ECNTRL);
>  	while(readl(fec->regs + FEC_ECNTRL) & 1) {
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list