summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-01-08 15:30:26 +0800
committerTerry Lv <r65388@freescale.com>2010-01-11 19:32:42 +0800
commita5510c49adac4e31c0bc13bad45ee073b3940dc5 (patch)
treeb803d30b72344e2a95fbfed78d939d813e378036 /drivers
parentc3b0a8706e5b3eb84875830e9acaa80cac088c14 (diff)
downloadu-boot-imx-a5510c49adac4e31c0bc13bad45ee073b3940dc5.zip
u-boot-imx-a5510c49adac4e31c0bc13bad45ee073b3940dc5.tar.gz
u-boot-imx-a5510c49adac4e31c0bc13bad45ee073b3940dc5.tar.bz2
ENGR00119890: Set right mac addr to FEC register in init
The mac addr set to FEC is smc911x's. So add a environment "fec_addr" to set fec address. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mxc_fec.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/mxc_fec.c b/drivers/net/mxc_fec.c
index 356cdf4..8aa32c7 100644
--- a/drivers/net/mxc_fec.c
+++ b/drivers/net/mxc_fec.c
@@ -2,7 +2,7 @@
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -722,14 +722,19 @@ void fec_halt(struct eth_device *dev)
memset(info->txbuf, 0, DBUF_LENGTH);
}
-static void mxc_fec_set_mac(struct fec_info_s *fec_info)
+void mxc_fec_set_mac_from_env(char *mac_addr)
{
unsigned char ea[6];
- volatile fec_t *fecp = (fec_t *)(fec_info->iobase);
+ volatile fec_t *fecp = NULL;
+ int i;
- memcpy(ea, eth_get_dev()->enetaddr, 6);
- fecp->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
- fecp->paur = (ea[4] << 24) | (ea[5] << 16);
+ eth_parse_enetaddr(mac_addr, ea);
+
+ for (i = 0; i < sizeof(fec_info) / sizeof(fec_info[0]); i++) {
+ fecp = (fec_t *)(fec_info[i].iobase);
+ fecp->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
+ fecp->paur = (ea[4] << 24) | (ea[5] << 16);
+ }
}
int mxc_fec_initialize(bd_t *bis)
@@ -778,8 +783,6 @@ int mxc_fec_initialize(bd_t *bis)
#endif
}
- mxc_fec_set_mac(&fec_info);
-
return 1;
}