[U-Boot] [PATCH] net:kirkwood_egiga.c: MAC addresses programming using write_hwaddr

Prafulla Wadaskar prafulla at marvell.com
Tue Apr 6 18:03:30 CEST 2010


This patch depends upon a patch
http://lists.denx.de/pipermail/u-boot/2010-April/069478.html

Added a new function kwgbe_write_hwaddr for programming egiga
controller's hardware address.
This function will be called for each egiga port being used

This is a significant improvement and better solution for Kirkwood based
boards for MAC address issues that we were facing

Signed-off-by: Prafulla Wadaskar <prafulla at marvell.com>
---
 drivers/net/kirkwood_egiga.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index dd711e4..70dedb1 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -418,7 +418,6 @@ static int kwgbe_init(struct eth_device *dev)
 
 	set_dram_access(regs);
 	port_init_mac_tables(regs);
-	port_uc_addr_set(regs, dkwgbe->dev.enetaddr);
 
 	/* Assign port configuration and command. */
 	KWGBEREG_WR(regs->pxc, PRT_CFG_VAL);
@@ -498,6 +497,16 @@ static int kwgbe_halt(struct eth_device *dev)
 	return 0;
 }
 
+static int kwgbe_write_hwaddr(struct eth_device *dev)
+{
+	struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
+	struct kwgbe_registers *regs = dkwgbe->regs;
+
+	/* Programms net device MAC address after initialization */
+	port_uc_addr_set(regs, dkwgbe->dev.enetaddr);
+	return 0;
+}
+
 static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
 		      int datasize)
 {
@@ -694,6 +703,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
 		dev->halt = (void *)kwgbe_halt;
 		dev->send = (void *)kwgbe_send;
 		dev->recv = (void *)kwgbe_recv;
+		dev->write_hwaddr = (void *)kwgbe_write_hwaddr;
 
 		eth_register(dev);
 
-- 
1.5.3.3



More information about the U-Boot mailing list