Commit 3ae071e44256144d6c1e3febb65f6c56bd433769
1 parent
89973f8a82
Exists in
master
and in
57 other branches
Moved initialization of Ethernet controllers on Atmel AT91 to board_eth_init()
Removed at91sam9_eth_initialize() from net/eth.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Showing 6 changed files with 33 additions and 41 deletions Side-by-side Diff
board/atmel/at91cap9adk/at91cap9adk.c
| ... | ... | @@ -30,11 +30,13 @@ |
| 30 | 30 | #include <asm/arch/at91_rstc.h> |
| 31 | 31 | #include <asm/arch/gpio.h> |
| 32 | 32 | #include <asm/arch/io.h> |
| 33 | +#include <asm/arch/hardware.h> | |
| 33 | 34 | #include <lcd.h> |
| 34 | 35 | #include <atmel_lcdc.h> |
| 35 | 36 | #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) |
| 36 | 37 | #include <net.h> |
| 37 | 38 | #endif |
| 39 | +#include <netdev.h> | |
| 38 | 40 | |
| 39 | 41 | #define MP_BLOCK_3_BASE 0xFDF00000 |
| 40 | 42 | |
| ... | ... | @@ -376,4 +378,13 @@ |
| 376 | 378 | #endif |
| 377 | 379 | } |
| 378 | 380 | #endif |
| 381 | + | |
| 382 | +int board_eth_init(bd_t *bis) | |
| 383 | +{ | |
| 384 | + int rc = 0; | |
| 385 | +#ifdef CONFIG_MACB | |
| 386 | + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); | |
| 387 | +#endif | |
| 388 | + return rc; | |
| 389 | +} |
board/atmel/at91sam9260ek/at91sam9260ek.c
| ... | ... | @@ -30,9 +30,11 @@ |
| 30 | 30 | #include <asm/arch/at91_rstc.h> |
| 31 | 31 | #include <asm/arch/gpio.h> |
| 32 | 32 | #include <asm/arch/io.h> |
| 33 | +#include <asm/arch/hardware.h> | |
| 33 | 34 | #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) |
| 34 | 35 | #include <net.h> |
| 35 | 36 | #endif |
| 37 | +#include <netdev.h> | |
| 36 | 38 | |
| 37 | 39 | DECLARE_GLOBAL_DATA_PTR; |
| 38 | 40 | |
| ... | ... | @@ -248,4 +250,13 @@ |
| 248 | 250 | #endif |
| 249 | 251 | } |
| 250 | 252 | #endif |
| 253 | + | |
| 254 | +int board_eth_init(bd_t *bis) | |
| 255 | +{ | |
| 256 | + int rc = 0; | |
| 257 | +#ifdef CONFIG_MACB | |
| 258 | + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); | |
| 259 | +#endif | |
| 260 | + return rc; | |
| 261 | +} |
board/atmel/at91sam9263ek/at91sam9263ek.c
| ... | ... | @@ -31,11 +31,13 @@ |
| 31 | 31 | #include <asm/arch/at91_rstc.h> |
| 32 | 32 | #include <asm/arch/gpio.h> |
| 33 | 33 | #include <asm/arch/io.h> |
| 34 | +#include <asm/arch/hardware.h> | |
| 34 | 35 | #include <lcd.h> |
| 35 | 36 | #include <atmel_lcdc.h> |
| 36 | 37 | #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) |
| 37 | 38 | #include <net.h> |
| 38 | 39 | #endif |
| 40 | +#include <netdev.h> | |
| 39 | 41 | |
| 40 | 42 | DECLARE_GLOBAL_DATA_PTR; |
| 41 | 43 | |
| ... | ... | @@ -308,4 +310,13 @@ |
| 308 | 310 | #endif |
| 309 | 311 | } |
| 310 | 312 | #endif |
| 313 | + | |
| 314 | +int board_eth_init(bd_t *bis) | |
| 315 | +{ | |
| 316 | + int rc = 0; | |
| 317 | +#ifdef CONFIG_MACB | |
| 318 | + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); | |
| 319 | +#endif | |
| 320 | + return rc; | |
| 321 | +} |
cpu/arm926ejs/at91/Makefile
cpu/arm926ejs/at91/ether.c
| 1 | -/* | |
| 2 | - * (C) Copyright 2007-2008 | |
| 3 | - * Stelian Pop <stelian.pop@leadtechdesign.com> | |
| 4 | - * Lead Tech Design <www.leadtechdesign.com> | |
| 5 | - * | |
| 6 | - * See file CREDITS for list of people who contributed to this | |
| 7 | - * project. | |
| 8 | - * | |
| 9 | - * This program is free software; you can redistribute it and/or | |
| 10 | - * modify it under the terms of the GNU General Public License as | |
| 11 | - * published by the Free Software Foundation; either version 2 of | |
| 12 | - * the License, or (at your option) any later version. | |
| 13 | - * | |
| 14 | - * This program is distributed in the hope that it will be useful, | |
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | - * GNU General Public License for more details. | |
| 18 | - * | |
| 19 | - * You should have received a copy of the GNU General Public License | |
| 20 | - * along with this program; if not, write to the Free Software | |
| 21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
| 22 | - * MA 02111-1307 USA | |
| 23 | - */ | |
| 24 | - | |
| 25 | -#include <common.h> | |
| 26 | -#include <asm/arch/hardware.h> | |
| 27 | - | |
| 28 | -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); | |
| 29 | - | |
| 30 | -#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET) | |
| 31 | -void at91sam9_eth_initialize(bd_t *bi) | |
| 32 | -{ | |
| 33 | - macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); | |
| 34 | -} | |
| 35 | -#endif |
net/eth.c
| ... | ... | @@ -66,7 +66,6 @@ |
| 66 | 66 | extern int tsi108_eth_initialize(bd_t*); |
| 67 | 67 | extern int npe_initialize(bd_t *); |
| 68 | 68 | extern int uec_initialize(int); |
| 69 | -extern int at91sam9_eth_initialize(bd_t *); | |
| 70 | 69 | |
| 71 | 70 | #ifdef CONFIG_API |
| 72 | 71 | extern void (*push_packet)(volatile void *, int); |
| ... | ... | @@ -253,10 +252,6 @@ |
| 253 | 252 | #endif |
| 254 | 253 | #if defined(CONFIG_RTL8169) |
| 255 | 254 | rtl8169_initialize(bis); |
| 256 | -#endif | |
| 257 | -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ | |
| 258 | - defined(CONFIG_AT91SAM9263) | |
| 259 | - at91sam9_eth_initialize(bis); | |
| 260 | 255 | #endif |
| 261 | 256 | |
| 262 | 257 | if (!eth_devices) { |