summaryrefslogtreecommitdiffstats
path: root/cpu
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-10-21 22:41:25 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-10-21 22:41:25 +0200
commit7b5cac0e1958173a390ae6d620a610028cad25f8 (patch)
treed045cc641164a0eca524a862831921790abb43eb /cpu
parent6902df56a0b493f369153b09d11afcd74a580561 (diff)
parente9f1110051c2c2f8c005cf7fae54194f07197bac (diff)
downloadblackbird-obmc-uboot-7b5cac0e1958173a390ae6d620a610028cad25f8.tar.gz
blackbird-obmc-uboot-7b5cac0e1958173a390ae6d620a610028cad25f8.zip
Merge with /home/wd/git/u-boot/master
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ppc4xx/4xx_enet.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c
index d3f1de4359..753b2be0c5 100644
--- a/cpu/ppc4xx/4xx_enet.c
+++ b/cpu/ppc4xx/4xx_enet.c
@@ -100,6 +100,10 @@
#error "CONFIG_MII has to be defined!"
#endif
+#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_NET_MULTI)
+#error "CONFIG_NET_MULTI has to be defined for NetConsole"
+#endif
+
#define EMAC_RESET_TIMEOUT 1000 /* 1000 ms reset timeout */
#define PHY_AUTONEGOTIATE_TIMEOUT 4000 /* 4000 ms autonegotiate timeout */
@@ -111,10 +115,6 @@
#define ENET_MAX_MTU PKTSIZE
#define ENET_MAX_MTU_ALIGNED PKTSIZE_ALIGN
-/* define the number of channels implemented */
-#define EMAC_RXCHL EMAC_NUM_DEV
-#define EMAC_TXCHL EMAC_NUM_DEV
-
/*-----------------------------------------------------------------------------+
* Defines for MAL/EMAC interrupt conditions as reported in the UIC (Universal
* Interrupt Controller).
@@ -142,6 +142,19 @@ static uint32_t mal_ier;
struct eth_device *emac0_dev = NULL;
#endif
+/*
+ * Get count of EMAC devices (doesn't have to be the max. possible number
+ * supported by the cpu)
+ */
+#if defined(CONFIG_HAS_ETH3)
+#define LAST_EMAC_NUM 4
+#elif defined(CONFIG_HAS_ETH2)
+#define LAST_EMAC_NUM 3
+#elif defined(CONFIG_HAS_ETH1)
+#define LAST_EMAC_NUM 2
+#else
+#define LAST_EMAC_NUM 1
+#endif
/*-----------------------------------------------------------------------------+
* Prototypes and externals.
@@ -186,7 +199,9 @@ static void ppc_4xx_eth_halt (struct eth_device *dev)
/* EMAC RESET */
out32 (EMAC_M0 + hw_p->hw_addr, EMAC_M0_SRST);
+#ifndef CONFIG_NETCONSOLE
hw_p->print_speed = 1; /* print speed message again next time */
+#endif
return;
}
@@ -1343,7 +1358,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
#endif
#endif
- for (eth_num = 0; eth_num < EMAC_NUM_DEV; eth_num++) {
+ for (eth_num = 0; eth_num < LAST_EMAC_NUM; eth_num++) {
/* See if we can actually bring up the interface, otherwise, skip it */
switch (eth_num) {
OpenPOWER on IntegriCloud