Skip to contentSkip to conversation

net: mvpp2: fix polarity of PHY reset signal

PATCH In review Baruch Siach 3 participants 8 messages Oct 15, 2018 – Oct 24, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: mvpp2: fix polarity of PHY reset signal

The dm_gpio_set_value() call sets the logical level of the GPIO signal. That is, it takes the GPIO_ACTIVE_{LOW,HIGH} property into account. The driver needs to assert the reset, and then deassert it. Not the other way around.

Cc Stefan Chulski <[email protected]>
---
 drivers/net/mvpp2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2.c +2 -2
index 62c0c2be0626..b3b1fe1a0c41 100644
@@ -4805,9 +4805,9 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
 static void mvpp2_gpio_init(struct mvpp2_port *port)
 {
 	if (dm_gpio_is_valid(&port->phy_reset_gpio)) {
-		dm_gpio_set_value(&port->phy_reset_gpio, 0);
-		udelay(1000);
 		dm_gpio_set_value(&port->phy_reset_gpio, 1);
+		udelay(1000);
+		dm_gpio_set_value(&port->phy_reset_gpio, 0);
 	}
 
 	if (dm_gpio_is_valid(&port->phy_tx_disable_gpio))
Signature · 1 line
2.19.1
#1 lore raw

PATCH 2/2 net: mvpp2: increase PHY reset pulse

The default Linux PHY reset delay is 10ms. This is also the requirement for Marvell 88E151x PHYs, which are likely to be used with this Ethernet MAC.

Cc Stefan Chulski <[email protected]>
---
 drivers/net/mvpp2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mvpp2.c +1 -1
index b3b1fe1a0c41..f28b939b17dc 100644
@@ -4806,7 +4806,7 @@ static void mvpp2_gpio_init(struct mvpp2_port *port)
 {
 	if (dm_gpio_is_valid(&port->phy_reset_gpio)) {
 		dm_gpio_set_value(&port->phy_reset_gpio, 1);
-		udelay(1000);
+		udelay(10000);
 		dm_gpio_set_value(&port->phy_reset_gpio, 0);
 	}
 
Signature · 1 line
2.19.1
#3 lore raw

PATCH 2/2 net: mvpp2: increase PHY reset pulse

In reply to Baruch Siach
Quoted 16 lines · Baruch Siach

The default Linux PHY reset delay is 10ms. This is also the requirement for Marvell 88E151x PHYs, which are likely to be used with this Ethernet MAC.

Cc Stefan Chulski <[email protected]>
---
  drivers/net/mvpp2.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mvpp2.c +0 -0
index b3b1fe1a0c41..f28b939b17dc 100644

drivers/net/mvpp2.c static void mvpp2_gpio_init(struct mvpp2_port *port) · line 4812

Quoted 8 lines
drivers/net/mvpp2.c +1 -1
@@ -4806,7 +4806,7 @@ static void mvpp2_gpio_init(struct mvpp2_port *port)
  {
  	if (dm_gpio_is_valid(&port->phy_reset_gpio)) {
  		dm_gpio_set_value(&port->phy_reset_gpio, 1);
-		udelay(1000);
+		udelay(10000);
  		dm_gpio_set_value(&port->phy_reset_gpio, 0);
  	}
 

Thanks,
Stefan

#5 lore raw

PATCH 1/2 net: mvpp2: fix polarity of PHY reset signal

In reply to Baruch Siach
Quoted 8 lines · Baruch Siach

The dm_gpio_set_value() call sets the logical level of the GPIO signal. That is, it takes the GPIO_ACTIVE_{LOW,HIGH} property into account. The driver needs to assert the reset, and then deassert it. Not the other way around.

Cc Stefan Chulski <[email protected]>
#6 lore raw

PATCH 1/2 net: mvpp2: fix polarity of PHY reset signal

In reply to Baruch Siach
Quoted 18 lines · Baruch Siach

The dm_gpio_set_value() call sets the logical level of the GPIO signal. That is, it takes the GPIO_ACTIVE_{LOW,HIGH} property into account. The driver needs to assert the reset, and then deassert it. Not the other way around.

Cc Stefan Chulski <[email protected]>
---
  drivers/net/mvpp2.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mvpp2.c +0 -0
index 62c0c2be0626..b3b1fe1a0c41 100644
@@ -4805,9 +4805,9 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
  static void mvpp2_gpio_init(struct mvpp2_port *port)

drivers/net/mvpp2.c static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port) · line 4813

Quoted 10 lines
drivers/net/mvpp2.c +2 -2
  {
  	if (dm_gpio_is_valid(&port->phy_reset_gpio)) {
-		dm_gpio_set_value(&port->phy_reset_gpio, 0);
-		udelay(1000);
  		dm_gpio_set_value(&port->phy_reset_gpio, 1);
+		udelay(1000);
+		dm_gpio_set_value(&port->phy_reset_gpio, 0);
  	}
 
  	if (dm_gpio_is_valid(&port->phy_tx_disable_gpio))

Thanks,
Stefan