From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Moved initialization of FCC Ethernet controller to cpu_eth_init
Date: Wed, 29 Oct 2008 22:53:04 -0700 [thread overview]
Message-ID: <1225345987-28478-3-git-send-email-biggerbadderben@gmail.com> (raw)
In-Reply-To: <1225345987-28478-2-git-send-email-biggerbadderben@gmail.com>
Affected boards:
Several MPC8xx boards
Several MPC8260/MPC8272 boards
Several MPC85xx boards
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
---
cpu/mpc8260/cpu.c | 13 +++++++++++++
cpu/mpc85xx/cpu.c | 5 ++++-
cpu/mpc8xx/cpu.c | 13 +++++++++++++
include/netdev.h | 1 +
net/eth.c | 5 -----
5 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 9f834d3..b9e748a 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -44,6 +44,7 @@
#include <watchdog.h>
#include <command.h>
#include <mpc8260.h>
+#include <netdev.h>
#include <asm/processor.h>
#include <asm/cpm_8260.h>
@@ -315,3 +316,15 @@ void ft_cpu_setup (void *blob, bd_t *bd)
do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
}
#endif /* CONFIG_OF_LIBFDT */
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_ETHER_ON_FCC)
+ fec_initialize(bis);
+#endif
+ return 0;
+}
diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index 0918fc6..d9e099c 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -30,6 +30,7 @@
#include <watchdog.h>
#include <command.h>
#include <tsec.h>
+#include <netdev.h>
#include <asm/cache.h>
#include <asm/io.h>
@@ -379,9 +380,11 @@ void upmconfig (uint upm, uint * table, uint size)
*/
int cpu_eth_init(bd_t *bis)
{
+#if defined(CONFIG_ETHER_ON_FCC)
+ fec_initialize(bis);
+#endif
#if defined(CONFIG_TSEC_ENET)
tsec_standard_init(bis);
#endif
-
return 0;
}
diff --git a/cpu/mpc8xx/cpu.c b/cpu/mpc8xx/cpu.c
index 420eaed..de3d679 100644
--- a/cpu/mpc8xx/cpu.c
+++ b/cpu/mpc8xx/cpu.c
@@ -37,6 +37,7 @@
#include <watchdog.h>
#include <command.h>
#include <mpc8xx.h>
+#include <netdev.h>
#include <asm/cache.h>
#if defined(CONFIG_OF_LIBFDT)
@@ -635,3 +636,15 @@ void reset_8xx_watchdog (volatile immap_t * immr)
# endif /* CONFIG_LWMON */
}
#endif /* CONFIG_WATCHDOG */
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(FEC_ENET)
+ fec_initialize(bis);
+#endif
+ return 0;
+}
diff --git a/include/netdev.h b/include/netdev.h
index 31115e2..0d1b0d5 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -47,6 +47,7 @@ int dc21x4x_initialize(bd_t *bis);
int e1000_initialize(bd_t *bis);
int eepro100_initialize(bd_t *bis);
int eth_3com_initialize (bd_t * bis);
+int fec_initialize (bd_t *bis);
int greth_initialize(bd_t *bis);
void gt6426x_eth_initialize(bd_t *bis);
int inca_switch_initialize(bd_t *bis);
diff --git a/net/eth.c b/net/eth.c
index 72fed69..6cf53f4 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -39,7 +39,6 @@ static int __def_eth_init(bd_t *bis)
int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
-extern int fec_initialize(bd_t*);
extern int mpc8220_fec_initialize(bd_t*);
extern int mv6436x_eth_initialize(bd_t *);
extern int mv6446x_eth_initialize(bd_t *);
@@ -184,10 +183,6 @@ int eth_initialize(bd_t *bis)
#if defined(CONFIG_UEC_ETH6)
uec_initialize(5);
#endif
-
-#if defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
- fec_initialize(bis);
-#endif
if (!eth_devices) {
puts ("No ethernet found.\n");
show_boot_progress (-64);
--
1.5.4.3
next prev parent reply other threads:[~2008-10-30 5:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 5:53 [U-Boot] [PATCH] net: Move initialization of Au1x00 SoC ethernet MAC to cpu_eth_init Ben Warren
2008-10-30 5:53 ` [U-Boot] [PATCH] Remove last reference to CONFIG_MPC85xx_FEC Ben Warren
2008-10-30 5:53 ` Ben Warren [this message]
2008-10-30 5:53 ` [U-Boot] [PATCH] Moved initialization of QE Ethernet controller to cpu_eth_init() Ben Warren
2008-10-30 5:53 ` [U-Boot] [PATCH] Moved initialization of MPC8220 FEC " Ben Warren
2008-10-30 5:53 ` [U-Boot] [PATCH] Moved initialization of MPC8XX SCC " Ben Warren
2008-10-30 20:30 ` [U-Boot] [PATCH] Remove last reference to CONFIG_MPC85xx_FEC Andy Fleming
2008-10-30 20:33 ` Andy Fleming
2008-10-30 20:35 ` Ben Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225345987-28478-3-git-send-email-biggerbadderben@gmail.com \
--to=biggerbadderben@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox