summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/arm926ejs/at91/Makefile1
-rw-r--r--cpu/arm926ejs/at91/ether.c35
-rw-r--r--cpu/leon2/cpu.c3
-rw-r--r--cpu/leon3/cpu.c2
-rw-r--r--cpu/mcf523x/cpu.c3
-rw-r--r--cpu/mcf52x2/cpu.c3
-rw-r--r--cpu/mcf532x/cpu.c3
-rw-r--r--cpu/mcf5445x/cpu.c3
-rw-r--r--cpu/mcf547x_8x/cpu.c4
-rw-r--r--cpu/mpc512x/cpu.c13
-rw-r--r--cpu/mpc5xxx/cpu.c13
-rw-r--r--cpu/mpc83xx/cpu.c20
-rw-r--r--cpu/mpc85xx/cpu.c33
-rw-r--r--cpu/mpc86xx/cpu.c26
14 files changed, 57 insertions, 105 deletions
diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index 44cde1a9c..2d2a888e9 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 7e11fe4d8..000000000
--- a/cpu/arm926ejs/at91/ether.c
+++ /dev/null
@@ -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
diff --git a/cpu/leon2/cpu.c b/cpu/leon2/cpu.c
index 5de1c521a..d6e23b129 100644
--- a/cpu/leon2/cpu.c
+++ b/cpu/leon2/cpu.c
@@ -25,6 +25,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -57,8 +58,6 @@ int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* ------------------------------------------------------------------------- */
-extern int greth_initialize(bd_t *bis);
-
#ifdef CONFIG_GRETH
int cpu_eth_init(bd_t *bis)
{
diff --git a/cpu/leon3/cpu.c b/cpu/leon3/cpu.c
index 1725fdb09..976f31134 100644
--- a/cpu/leon3/cpu.c
+++ b/cpu/leon3/cpu.c
@@ -25,6 +25,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/processor.h>
@@ -65,7 +66,6 @@ u64 flash_read64(void *addr)
}
/* ------------------------------------------------------------------------- */
-extern int greth_initialize(bd_t *bis);
#ifdef CONFIG_GRETH
int cpu_eth_init(bd_t *bis)
diff --git a/cpu/mcf523x/cpu.c b/cpu/mcf523x/cpu.c
index 8d2152d9c..bdc152f07 100644
--- a/cpu/mcf523x/cpu.c
+++ b/cpu/mcf523x/cpu.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
@@ -114,8 +115,6 @@ int watchdog_init(void)
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c
index 2af31cbb9..167097a79 100644
--- a/cpu/mcf52x2/cpu.c
+++ b/cpu/mcf52x2/cpu.c
@@ -32,6 +32,7 @@
#include <watchdog.h>
#include <command.h>
#include <asm/immap.h>
+#include <netdev.h>
#ifdef CONFIG_M5271
/*
@@ -328,8 +329,6 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
diff --git a/cpu/mcf532x/cpu.c b/cpu/mcf532x/cpu.c
index 20d0d5cf2..260d6e675 100644
--- a/cpu/mcf532x/cpu.c
+++ b/cpu/mcf532x/cpu.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
@@ -136,8 +137,6 @@ int watchdog_init(void)
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
diff --git a/cpu/mcf5445x/cpu.c b/cpu/mcf5445x/cpu.c
index ab342ddeb..a30c327dd 100644
--- a/cpu/mcf5445x/cpu.c
+++ b/cpu/mcf5445x/cpu.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
@@ -102,8 +103,6 @@ int checkcpu(void)
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
diff --git a/cpu/mcf547x_8x/cpu.c b/cpu/mcf547x_8x/cpu.c
index 1ba7aa80a..ab4ad2889 100644
--- a/cpu/mcf547x_8x/cpu.c
+++ b/cpu/mcf547x_8x/cpu.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
@@ -148,9 +149,6 @@ int watchdog_init(void)
* int board_eth_init(bd_t *bis)
*/
-extern int mcdmafec_initialize(bd_t *bis);
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
#if defined(CONFIG_FSLDMAFEC)
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 1f39ac4c1..d432d995a 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -30,6 +30,7 @@
#include <common.h>
#include <command.h>
#include <mpc512x.h>
+#include <netdev.h>
#include <asm/processor.h>
#if defined(CONFIG_OF_LIBFDT)
@@ -195,3 +196,15 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#endif
}
#endif
+
+#ifdef CONFIG_MPC512x_FEC
+/* Default initializations for FEC controllers. To override,
+ * create a board-specific function called:
+ * int board_eth_init(bd_t *bis)
+ */
+
+int cpu_eth_init(bd_t *bis)
+{
+ return mpc512x_fec_initialize(bis);
+}
+#endif
diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
index 0ed289963..1326c3cc9 100644
--- a/cpu/mpc5xxx/cpu.c
+++ b/cpu/mpc5xxx/cpu.c
@@ -29,6 +29,7 @@
#include <watchdog.h>
#include <command.h>
#include <mpc5xxx.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/processor.h>
@@ -155,3 +156,15 @@ ulong bootcount_load (void)
return (*save_addr & 0x0000ffff);
}
#endif /* CONFIG_BOOTCOUNT_LIMIT */
+
+#ifdef CONFIG_MPC5xxx_FEC
+/* Default initializations for FEC controllers. To override,
+ * create a board-specific function called:
+ * int board_eth_init(bd_t *bis)
+ */
+
+int cpu_eth_init(bd_t *bis)
+{
+ return mpc5xxx_fec_initialize(bis);
+}
+#endif
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 52e4476d8..5862acdc4 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -32,6 +32,7 @@
#include <mpc83xx.h>
#include <asm/processor.h>
#include <libfdt.h>
+#include <tsec.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -358,22 +359,15 @@ int dma_xfer(void *dest, u32 count, void *src)
}
#endif /*CONFIG_DDR_ECC*/
-#ifdef CONFIG_TSEC_ENET
-/* Default initializations for TSEC controllers. To override,
- * create a board-specific function called:
- * int board_eth_init(bd_t *bis)
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
*/
-
-extern int tsec_initialize(bd_t * bis, int index, char *devname);
-
int cpu_eth_init(bd_t *bis)
{
-#if defined(CONFIG_TSEC1)
- tsec_initialize(bis, 0, CONFIG_TSEC1_NAME);
-#endif
-#if defined(CONFIG_TSEC2)
- tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
+#if defined(CONFIG_TSEC_ENET)
+ tsec_standard_init(bis);
#endif
+
return 0;
}
-#endif
diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index 2fe3cea3f..7976caca6 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -25,9 +25,11 @@
* MA 02111-1307 USA
*/
+#include <config.h>
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <tsec.h>
#include <asm/cache.h>
#include <asm/io.h>
@@ -294,6 +296,7 @@ int dma_xfer(void *dest, uint count, void *src) {
return dma_check();
}
#endif
+
/*
* Configures a UPM. Currently, the loop fields in MxMR (RLF, WLF and TLF)
* are hardcoded as "1"."size" is the number or entries, not a sizeof.
@@ -360,32 +363,16 @@ void upmconfig (uint upm, uint * table, uint size)
out_be32(mxmr, loopval); /* OP_NORMAL */
}
-#if defined(CONFIG_TSEC_ENET) || defined(CONFIGMPC85XX_FEC)
-/* Default initializations for TSEC controllers. To override,
- * create a board-specific function called:
- * int board_eth_init(bd_t *bis)
- */
-
-extern int tsec_initialize(bd_t * bis, int index, char *devname);
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
int cpu_eth_init(bd_t *bis)
{
-#if defined(CONFIG_TSEC1)
- tsec_initialize(bis, 0, CONFIG_TSEC1_NAME);
-#endif
-#if defined(CONFIG_TSEC2)
- tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
-#endif
-#if defined(CONFIG_MPC85XX_FEC)
- tsec_initialize(bis, 2, CONFIG_MPC85XX_FEC_NAME);
-#else
-#if defined(CONFIG_TSEC3)
- tsec_initialize(bis, 2, CONFIG_TSEC3_NAME);
-#endif
-#if defined(CONFIG_TSEC4)
- tsec_initialize(bis, 3, CONFIG_TSEC4_NAME);
-#endif
+#if defined(CONFIG_TSEC_ENET) || defined(CONFIG_MPC85xx_FEC)
+ tsec_standard_init(bis);
#endif
+
return 0;
}
-#endif
diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c
index ecea5b064..3a75af77c 100644
--- a/cpu/mpc86xx/cpu.c
+++ b/cpu/mpc86xx/cpu.c
@@ -28,6 +28,7 @@
#include <asm/cache.h>
#include <asm/mmu.h>
#include <mpc86xx.h>
+#include <tsec.h>
#include <asm/fsl_law.h>
@@ -305,28 +306,15 @@ void mpc86xx_reginfo(void)
}
-#ifdef CONFIG_TSEC_ENET
-/* Default initializations for TSEC controllers. To override,
- * create a board-specific function called:
- * int board_eth_init(bd_t *bis)
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
*/
-
-extern int tsec_initialize(bd_t * bis, int index, char *devname);
-
int cpu_eth_init(bd_t *bis)
{
-#if defined(CONFIG_TSEC1)
- tsec_initialize(bis, 0, CONFIG_TSEC1_NAME);
-#endif
-#if defined(CONFIG_TSEC2)
- tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
-#endif
-#if defined(CONFIG_TSEC3)
- tsec_initialize(bis, 2, CONFIG_TSEC3_NAME);
-#endif
-#if defined(CONFIG_TSEC4)
- tsec_initialize(bis, 3, CONFIG_TSEC4_NAME);
+#if defined(CONFIG_TSEC_ENET)
+ tsec_standard_init(bis);
#endif
+
return 0;
}
-#endif /* CONFIG_TSEC_ENET */