[U-Boot] [PATCH 1/6] Allow PHY addresses on kirkwood egiga to be non continuous.

Tor Krill tor at excito.com
Wed Jun 23 18:04:53 CEST 2010


Changing its configuration from PHY_BASE_ADR single value to use
CONFIG_PHY_ADDRS as an array with adresses.

Signed-off-by: Tor Krill <tor at excito.com>
---
 drivers/net/kirkwood_egiga.c |    3 ++-
 drivers/net/kirkwood_egiga.h |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index 932792e..7993e51 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -629,6 +629,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
 	int devnum;
 	char *s;
 	u8 used_ports[MAX_KWGBE_DEVS] = CONFIG_KIRKWOOD_EGIGA_PORTS;
+	u8 port_addr[MAX_KWGBE_DEVS] = PHY_ADDRS;
 
 	for (devnum = 0; devnum < MAX_KWGBE_DEVS; devnum++) {
 		/*skip if port is configured not to use */
@@ -712,7 +713,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
 		miiphy_register(dev->name, smi_reg_read, smi_reg_write);
 		/* Set phy address of the port */
 		miiphy_write(dev->name, KIRKWOOD_PHY_ADR_REQUEST,
-				KIRKWOOD_PHY_ADR_REQUEST, PHY_BASE_ADR + devnum);
+				KIRKWOOD_PHY_ADR_REQUEST, port_addr[devnum]);
 #endif
 	}
 	return 0;
diff --git a/drivers/net/kirkwood_egiga.h b/drivers/net/kirkwood_egiga.h
index 30c773c..6ff3bb7 100644
--- a/drivers/net/kirkwood_egiga.h
+++ b/drivers/net/kirkwood_egiga.h
@@ -30,11 +30,11 @@
 
 #define MAX_KWGBE_DEVS	2	/*controller has two ports */
 
-/* PHY_BASE_ADR is board specific and can be configured */
-#if defined (CONFIG_PHY_BASE_ADR)
-#define PHY_BASE_ADR		CONFIG_PHY_BASE_ADR
+/* PHY addresses is board specific and can be configured */
+#if defined (CONFIG_PHY_ADDRS)
+#define PHY_ADDRS		CONFIG_PHY_ADDRS
 #else
-#define PHY_BASE_ADR		0x08	/* default phy base addr */
+#define PHY_ADDRS		{0x08,0x09}	/* default phy base addr */
 #endif
 
 /* Constants */
-- 
1.7.0.4



More information about the U-Boot mailing list