summaryrefslogtreecommitdiffstats
path: root/bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/u-boot/u-boot/0007-net-sh_eth-Toggle-PHY-GPIO-reset-pin.patch
blob: 36f1138a0d74cb89c6b092da7c7009a8d5afc92b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 9f57c16aeb86d2312fa826dec0e061c3152d1c69 Mon Sep 17 00:00:00 2001
From: Valentine Barshak <valentine.barshak@cogentembedded.com>
Date: Tue, 13 Aug 2019 01:18:33 +0300
Subject: [PATCH 07/23] net: sh_eth: Toggle PHY GPIO reset pin

Looks like we need to toggle PHY GPIO reset pin.
Otherwise, GEther device fails to start on V3H
platform sometimes.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
---
 drivers/net/sh_eth.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 2e1123c..cd2657c 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -750,6 +750,13 @@ static int sh_eth_phy_config(struct udevice *dev)
 	struct phy_device *phydev;
 	int mask = 0xffffffff;
 
+	if (dm_gpio_is_valid(&priv->reset_gpio)) {
+		dm_gpio_set_value(&priv->reset_gpio, 1);
+		mdelay(20);
+		dm_gpio_set_value(&priv->reset_gpio, 0);
+		mdelay(1);
+	}
+
 	phydev = phy_find_by_mask(priv->bus, mask, pdata->phy_interface);
 	if (!phydev)
 		return -ENODEV;
-- 
2.7.4