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>
master
Ben Warren 17 years ago
parent 89973f8a82
commit 3ae071e442
  1. 11
      board/atmel/at91cap9adk/at91cap9adk.c
  2. 11
      board/atmel/at91sam9260ek/at91sam9260ek.c
  3. 11
      board/atmel/at91sam9263ek/at91sam9263ek.c
  4. 1
      cpu/arm926ejs/at91/Makefile
  5. 35
      cpu/arm926ejs/at91/ether.c
  6. 5
      net/eth.c

@ -30,11 +30,13 @@
#include <asm/arch/at91_rstc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/io.h>
#include <asm/arch/hardware.h>
#include <lcd.h>
#include <atmel_lcdc.h>
#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
#include <net.h>
#endif
#include <netdev.h>
#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;
}

@ -30,9 +30,11 @@
#include <asm/arch/at91_rstc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/io.h>
#include <asm/arch/hardware.h>
#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
#include <net.h>
#endif
#include <netdev.h>
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;
}

@ -31,11 +31,13 @@
#include <asm/arch/at91_rstc.h>
#include <asm/arch/gpio.h>
#include <asm/arch/io.h>
#include <asm/arch/hardware.h>
#include <lcd.h>
#include <atmel_lcdc.h>
#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
#include <net.h>
#endif
#include <netdev.h>
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;
}

@ -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

@ -1,35 +0,0 @@
/*
* (C) Copyright 2007-2008
* Stelian Pop <stelian.pop@leadtechdesign.com>
* Lead Tech Design <www.leadtechdesign.com>
*
* 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 <common.h>
#include <asm/arch/hardware.h>
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

@ -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");

Loading…
Cancel
Save