* [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration
2015-11-18 9:08 [PATCH v2 1/3] net: fec: set phy reset time to 1ms Stefan Christ
@ 2015-11-18 9:08 ` Stefan Christ
2015-11-18 9:15 ` Stefan Christ
2015-11-18 9:08 ` [PATCH v2 3/3] net: fec: fix indentation and whitspaces Stefan Christ
2015-11-19 7:33 ` [PATCH v2 1/3] net: fec: set phy reset time to 1ms Sascha Hauer
2 siblings, 1 reply; 5+ messages in thread
From: Stefan Christ @ 2015-11-18 9:08 UTC (permalink / raw)
To: barebox
Implement device tree property phy-reset-duration to adjust length of
phy reset.
Signed-off-by: Stefan Christ <s.christ@phytec.de>
---
drivers/net/fec_imx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index f19d046..70087ad 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -654,6 +654,7 @@ static int fec_probe(struct device_d *dev)
int ret;
enum fec_type type;
int phy_reset;
+ u32 msec = 1;
ret = dev_get_drvdata(dev, (const void **)&type);
if (ret)
@@ -684,6 +685,8 @@ static int fec_probe(struct device_d *dev)
phy_reset = of_get_named_gpio(dev->device_node, "phy-reset-gpios", 0);
if (gpio_is_valid(phy_reset)) {
+ of_property_read_u32(dev->device_node, "phy-reset-duration", &msec);
+
ret = gpio_request(phy_reset, "phy-reset");
if (ret)
goto err_free;
@@ -692,7 +695,7 @@ static int fec_probe(struct device_d *dev)
if (ret)
goto err_free;
- mdelay(1);
+ mdelay(msec);
gpio_set_value(phy_reset, 1);
}
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration
2015-11-18 9:08 ` [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration Stefan Christ
@ 2015-11-18 9:15 ` Stefan Christ
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Christ @ 2015-11-18 9:15 UTC (permalink / raw)
To: barebox
Hi,
ups. Change information is missing:
v2: Remove upper bound check of reset duration and update commit message
Mit freundlichen Grüßen / Kind regards,
Stefan Christ
On Wed, Nov 18, 2015 at 10:08:44AM +0100, Stefan Christ wrote:
> Implement device tree property phy-reset-duration to adjust length of
> phy reset.
>
> Signed-off-by: Stefan Christ <s.christ@phytec.de>
> ---
> drivers/net/fec_imx.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index f19d046..70087ad 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -654,6 +654,7 @@ static int fec_probe(struct device_d *dev)
> int ret;
> enum fec_type type;
> int phy_reset;
> + u32 msec = 1;
>
> ret = dev_get_drvdata(dev, (const void **)&type);
> if (ret)
> @@ -684,6 +685,8 @@ static int fec_probe(struct device_d *dev)
>
> phy_reset = of_get_named_gpio(dev->device_node, "phy-reset-gpios", 0);
> if (gpio_is_valid(phy_reset)) {
> + of_property_read_u32(dev->device_node, "phy-reset-duration", &msec);
> +
> ret = gpio_request(phy_reset, "phy-reset");
> if (ret)
> goto err_free;
> @@ -692,7 +695,7 @@ static int fec_probe(struct device_d *dev)
> if (ret)
> goto err_free;
>
> - mdelay(1);
> + mdelay(msec);
> gpio_set_value(phy_reset, 1);
> }
>
> --
> 1.9.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] net: fec: fix indentation and whitspaces
2015-11-18 9:08 [PATCH v2 1/3] net: fec: set phy reset time to 1ms Stefan Christ
2015-11-18 9:08 ` [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration Stefan Christ
@ 2015-11-18 9:08 ` Stefan Christ
2015-11-19 7:33 ` [PATCH v2 1/3] net: fec: set phy reset time to 1ms Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Stefan Christ @ 2015-11-18 9:08 UTC (permalink / raw)
To: barebox
Signed-off-by: Stefan Christ <s.christ@phytec.de>
---
drivers/net/fec_imx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 70087ad..5418034 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -259,7 +259,7 @@ static int fec_set_hwaddr(struct eth_device *dev, const unsigned char *mac)
writel((mac[0] << 24) + (mac[1] << 16) + (mac[2] << 8) + mac[3], fec->regs + FEC_PADDR1);
writel((mac[4] << 24) + (mac[5] << 16) + 0x8808, fec->regs + FEC_PADDR2);
- return 0;
+ return 0;
}
static int fec_init(struct eth_device *dev)
@@ -647,8 +647,8 @@ static int fec_probe_dt(struct device_d *dev, struct fec_priv *fec)
#endif
static int fec_probe(struct device_d *dev)
{
- struct fec_platform_data *pdata = (struct fec_platform_data *)dev->platform_data;
- struct eth_device *edev;
+ struct fec_platform_data *pdata = (struct fec_platform_data *)dev->platform_data;
+ struct eth_device *edev;
struct fec_priv *fec;
void *base;
int ret;
@@ -778,7 +778,7 @@ static __maybe_unused struct of_device_id imx_fec_dt_ids[] = {
}, {
.compatible = "fsl,imx6q-fec",
.data = (void *)FEC_TYPE_IMX6,
- }, {
+ }, {
.compatible = "fsl,imx6sx-fec",
.data = (void *)FEC_TYPE_IMX6,
}, {
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/3] net: fec: set phy reset time to 1ms
2015-11-18 9:08 [PATCH v2 1/3] net: fec: set phy reset time to 1ms Stefan Christ
2015-11-18 9:08 ` [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration Stefan Christ
2015-11-18 9:08 ` [PATCH v2 3/3] net: fec: fix indentation and whitspaces Stefan Christ
@ 2015-11-19 7:33 ` Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2015-11-19 7:33 UTC (permalink / raw)
To: Stefan Christ; +Cc: barebox
On Wed, Nov 18, 2015 at 10:08:43AM +0100, Stefan Christ wrote:
> According to the device tree bindings in dts/Bindings/net/fsl-fec.txt
> the default phy-reset time is 1ms.
>
> Signed-off-by: Stefan Christ <s.christ@phytec.de>
Applied, thanks
Sascha
--
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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread