Commit 18bfc8fa authored by Aditya Prayoga's avatar Aditya Prayoga Committed by Joe Hershberger

net: mvneta: Add GPIO configuration support

This patch add GPIO configuration support in mvneta driver.
Driver will handle PHY reset. GPIO pins should be set in device tree.

Ported from mvpp2x

Initial discussion to port the changes into mvneta
Signed-off-by: default avatarAditya Prayoga <>
Tested-by: default avatarDennis Gilmore <>
Reviewed-by: Stefan Roese's avatarStefan Roese <>
Acked-by: Joe Hershberger's avatarJoe Hershberger <>
parent 92f129f4
......@@ -27,6 +27,7 @@
#include <asm/arch/soc.h>
#include <linux/compat.h>
#include <linux/mbus.h>
#include <asm-generic/gpio.h>
......@@ -274,6 +275,9 @@ struct mvneta_port {
int init;
int phyaddr;
struct phy_device *phydev;
struct gpio_desc phy_reset_gpio;
struct mii_dev *bus;
......@@ -1749,6 +1753,17 @@ static int mvneta_probe(struct udevice *dev)
if (ret)
return ret;
gpio_request_by_name(dev, "phy-reset-gpios", 0,
&pp->phy_reset_gpio, GPIOD_IS_OUT);
if (dm_gpio_is_valid(&pp->phy_reset_gpio)) {
dm_gpio_set_value(&pp->phy_reset_gpio, 1);
dm_gpio_set_value(&pp->phy_reset_gpio, 0);
return board_network_enable(bus);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment