Patchwork [U-Boot] am335x: cpsw: make phy address configurable

login
register
mail settings
Submitter Yegor Yefremov
Date Nov. 26, 2012, 2:03 p.m.
Message ID <1353938596-3240-1-git-send-email-yegorslists@googlemail.com>
Download mbox | patch
Permalink /patch/201707/
State Awaiting Upstream
Delegated to: Tom Rini
Headers show

Comments

Yegor Yefremov - Nov. 26, 2012, 2:03 p.m.
From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 drivers/net/cpsw.c           |    5 ++++-
 include/configs/am335x_evm.h |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)
Tom Rini - Dec. 10, 2012, 8:17 p.m.
On Mon, Nov 26, 2012 at 04:03:16AM -0000, Yegor Yefremov wrote:

> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied to u-boot-ti/master, thanks!

Patch

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index af3d859..db04795 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -920,7 +920,10 @@  static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
 			SUPPORTED_100baseT_Full |
 			SUPPORTED_1000baseT_Full);
 
-	phydev = phy_connect(priv->bus, 0, dev, slave->data->phy_if);
+	phydev = phy_connect(priv->bus,
+			CONFIG_PHY_ADDR,
+			dev,
+			slave->data->phy_if);
 
 	phydev->supported &= supported;
 	phydev->advertising = phydev->supported;
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index b6e48f8..c49752e 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -272,6 +272,7 @@ 
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
+#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
 #endif	/* ! __CONFIG_AM335X_EVM_H */