From: Ben Warren Date: Wed, 13 Aug 2008 05:11:53 +0000 (-0700) Subject: Moved initialization of Ethernet controllers on Atmel AT91 to board_eth_init() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3ae071e44256144d6c1e3febb65f6c56bd433769;p=project%2Fbcm63xx%2Fu-boot.git 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 --- diff --git a/board/atmel/at91cap9adk/at91cap9adk.c b/board/atmel/at91cap9adk/at91cap9adk.c index c5082a0925..787d64d80b 100644 --- a/board/atmel/at91cap9adk/at91cap9adk.c +++ b/board/atmel/at91cap9adk/at91cap9adk.c @@ -30,11 +30,13 @@ #include #include #include +#include #include #include #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include #endif +#include #define MP_BLOCK_3_BASE 0xFDF00000 @@ -376,3 +378,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 06d8512cc9..913e3fb34c 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -30,9 +30,11 @@ #include #include #include +#include #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include #endif +#include DECLARE_GLOBAL_DATA_PTR; @@ -248,3 +250,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c index 927fc912c9..c705074557 100644 --- a/board/atmel/at91sam9263ek/at91sam9263ek.c +++ b/board/atmel/at91sam9263ek/at91sam9263ek.c @@ -31,11 +31,13 @@ #include #include #include +#include #include #include #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include #endif +#include DECLARE_GLOBAL_DATA_PTR; @@ -308,3 +310,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile index 44cde1a9c3..2d2a888e9c 100644 --- a/cpu/arm926ejs/at91/Makefile +++ b/cpu/arm926ejs/at91/Makefile @@ -25,7 +25,6 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).a -COBJS-y += ether.o COBJS-y += timer.o COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o COBJS-y += usb.o diff --git a/cpu/arm926ejs/at91/ether.c b/cpu/arm926ejs/at91/ether.c deleted file mode 100644 index 7e11fe4d8e..0000000000 --- a/cpu/arm926ejs/at91/ether.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright 2007-2008 - * Stelian Pop - * Lead Tech Design - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include -#include - -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - -#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET) -void at91sam9_eth_initialize(bd_t *bi) -{ - macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); -} -#endif diff --git a/net/eth.c b/net/eth.c index 85fa0da237..71feb07a74 100644 --- a/net/eth.c +++ b/net/eth.c @@ -66,7 +66,6 @@ extern int scc_initialize(bd_t*); extern int tsi108_eth_initialize(bd_t*); extern int npe_initialize(bd_t *); extern int uec_initialize(int); -extern int at91sam9_eth_initialize(bd_t *); #ifdef CONFIG_API extern void (*push_packet)(volatile void *, int); @@ -254,10 +253,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_RTL8169) rtl8169_initialize(bis); #endif -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ - defined(CONFIG_AT91SAM9263) - at91sam9_eth_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n");