From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Moved initialization of MPC8220 FEC to cpu_eth_init()
Date: Wed, 29 Oct 2008 22:53:06 -0700 [thread overview]
Message-ID: <1225345987-28478-5-git-send-email-biggerbadderben@gmail.com> (raw)
In-Reply-To: <1225345987-28478-4-git-send-email-biggerbadderben@gmail.com>
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
---
board/sorcery/sorcery.c | 2 ++
cpu/mpc8220/cpu.c | 13 +++++++++++++
include/netdev.h | 1 +
net/eth.c | 4 ----
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/board/sorcery/sorcery.c b/board/sorcery/sorcery.c
index 3e1bd6f..90d4298 100644
--- a/board/sorcery/sorcery.c
+++ b/board/sorcery/sorcery.c
@@ -62,5 +62,7 @@ void pci_init_board (void)
int board_eth_init(bd_t *bis)
{
+ /* Initialize built-in FEC first */
+ cpu_eth_init(bis);
return pci_eth_init(bis);
}
diff --git a/cpu/mpc8220/cpu.c b/cpu/mpc8220/cpu.c
index 5b3fdd3..563cfe0 100644
--- a/cpu/mpc8220/cpu.c
+++ b/cpu/mpc8220/cpu.c
@@ -29,6 +29,7 @@
#include <watchdog.h>
#include <command.h>
#include <mpc8220.h>
+#include <netdev.h>
#include <asm/processor.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -89,3 +90,15 @@ unsigned long get_tbclk (void)
}
/* ------------------------------------------------------------------------- */
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_MPC8220_FEC)
+ mpc8220_fec_initialize(bis);
+#endif
+ return 0;
+}
diff --git a/include/netdev.h b/include/netdev.h
index 3b11961..55183e8 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -56,6 +56,7 @@ int mcdmafec_initialize(bd_t *bis);
int mcffec_initialize(bd_t *bis);
int mpc512x_fec_initialize(bd_t *bis);
int mpc5xxx_fec_initialize(bd_t *bis);
+int mpc8220_fec_initialize(bd_t *bis);
int natsemi_initialize(bd_t *bis);
int npe_initialize(bd_t *bis);
int ns8382x_initialize(bd_t *bis);
diff --git a/net/eth.c b/net/eth.c
index 3793dd7..d543163 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 mpc8220_fec_initialize(bd_t*);
extern int mv6436x_eth_initialize(bd_t *);
extern int mv6446x_eth_initialize(bd_t *);
extern int ppc_4xx_eth_initialize(bd_t *);
@@ -161,9 +160,6 @@ int eth_initialize(bd_t *bis)
#ifdef SCC_ENET
scc_initialize(bis);
#endif
-#if defined(CONFIG_MPC8220_FEC)
- mpc8220_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 ` [U-Boot] [PATCH] Moved initialization of FCC Ethernet controller to cpu_eth_init Ben Warren
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 ` Ben Warren [this message]
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-5-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