diff options
-rw-r--r-- | board/freescale/mx25_3stack/mx25_3stack.c | 5 | ||||
-rw-r--r-- | board/freescale/mx35_3stack/mx35_3stack.c | 5 | ||||
-rw-r--r-- | cpu/arm1136/mx35/generic.c | 9 | ||||
-rw-r--r-- | cpu/arm926ejs/mx25/generic.c | 9 | ||||
-rw-r--r-- | drivers/net/mxc_fec.c | 19 | ||||
-rw-r--r-- | net/eth.c | 7 |
6 files changed, 36 insertions, 18 deletions
diff --git a/board/freescale/mx25_3stack/mx25_3stack.c b/board/freescale/mx25_3stack/mx25_3stack.c index b28cc3d..ced6599 100644 --- a/board/freescale/mx25_3stack/mx25_3stack.c +++ b/board/freescale/mx25_3stack/mx25_3stack.c @@ -1,5 +1,5 @@ /* - * (c) Copyright 2009 Freescale Semiconductor + * (c) Copyright 2009-2010 Freescale Semiconductor * * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> * @@ -305,6 +305,9 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_SMC911X) rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); #endif + + cpu_eth_init(bis); + return rc; } diff --git a/board/freescale/mx35_3stack/mx35_3stack.c b/board/freescale/mx35_3stack/mx35_3stack.c index 11863680..5889a31 100644 --- a/board/freescale/mx35_3stack/mx35_3stack.c +++ b/board/freescale/mx35_3stack/mx35_3stack.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007, Guennadi Liakhovetski <lg@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. @@ -359,6 +359,9 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_SMC911X) rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); #endif + + cpu_eth_init(bis); + return rc; } diff --git a/cpu/arm1136/mx35/generic.c b/cpu/arm1136/mx35/generic.c index e9abe0c..7d1bbca 100644 --- a/cpu/arm1136/mx35/generic.c +++ b/cpu/arm1136/mx35/generic.c @@ -2,7 +2,7 @@ * (C) Copyright 2007 * Sascha Hauer, Pengutronix * - * (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. @@ -364,9 +364,16 @@ int print_cpuinfo(void) int cpu_eth_init(bd_t *bis) { int rc = -ENODEV; + char *env = NULL; + #if defined(CONFIG_MXC_FEC) rc = mxc_fec_initialize(bis); #endif + + env = getenv("fec_addr"); + if (env) + mxc_fec_set_mac_from_env(env); + return rc; } diff --git a/cpu/arm926ejs/mx25/generic.c b/cpu/arm926ejs/mx25/generic.c index bda3fbe..a47d796 100644 --- a/cpu/arm926ejs/mx25/generic.c +++ b/cpu/arm926ejs/mx25/generic.c @@ -2,7 +2,7 @@ * (C) Copyright 2007 * Sascha Hauer, Pengutronix * - * (C) Copyright 2009 Freescale Semiconductor + * (C) Copyright 2009-2010 Freescale Semiconductor * * See file CREDITS for list of people who contributed to this * project. @@ -119,9 +119,16 @@ int print_cpuinfo(void) int cpu_eth_init(bd_t *bis) { int rc = -ENODEV; + char *env = NULL; + #if defined(CONFIG_MXC_FEC) rc = mxc_fec_initialize(bis); #endif + + env = getenv("fec_addr"); + if (env) + mxc_fec_set_mac_from_env(env); + return rc; } #endif 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; } @@ -2,7 +2,7 @@ * (C) Copyright 2001-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. @@ -201,13 +201,8 @@ int eth_initialize(bd_t *bis) #endif /* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */ -#ifdef CONFIG_ETHPRIME - board_eth_init(bis); - cpu_eth_init(bis); -#else if (board_eth_init(bis) < 0) cpu_eth_init(bis); -#endif #if defined(CONFIG_DB64360) || defined(CONFIG_CPCI750) mv6436x_eth_initialize(bis); |