Skip to contentSkip to conversation

net: fec: set phy reset time to 1ms

PATCH Applied Stefan Christ 2 participants 5 messages Nov 18, 2015 – Nov 19, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 net: fec: set phy reset time to 1ms

According to the device tree bindings in dts/Bindings/net/fsl-fec.txt the default phy-reset time is 1ms.

---
 drivers/net/fec_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fec_imx.c +1 -1
index 78ccb85..f19d046 100644
@@ -692,7 +692,7 @@ static int fec_probe(struct device_d *dev)
 		if (ret)
 			goto err_free;
 
-		udelay(10);
+		mdelay(1);
 		gpio_set_value(phy_reset, 1);
 	}
 
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v2 2/3 net: fec: implement dtb property phy-reset-duration

Implement device tree property phy-reset-duration to adjust length of phy reset.

---
 drivers/net/fec_imx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/fec_imx.c +4 -1
index f19d046..70087ad 100644
@@ -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);
 	}
 
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH v2 2/3] net: fec: implement dtb property phy-reset-duration

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

Quoted 46 lines · Stefan Christ

Implement device tree property phy-reset-duration to adjust length of phy reset.

---
 drivers/net/fec_imx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/fec_imx.c +4 -1
index f19d046..70087ad 100644
@@ -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);
 	}
 
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw

PATCH v2 3/3 net: fec: fix indentation and whitspaces

In reply to Stefan Christ
---
 drivers/net/fec_imx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/fec_imx.c +4 -4
index 70087ad..5418034 100644
@@ -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,
 	}, {
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer Applied
#4 lore raw
In reply to Stefan Christ
Quoted 4 lines · Stefan Christ

According to the device tree bindings in dts/Bindings/net/fsl-fec.txt the default phy-reset time is 1ms.

Applied, thanks

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox