projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xx
[platform/kernel/u-boot.git]
/
net
/
eth.c
diff --git
a/net/eth.c
b/net/eth.c
index
425f29e
..
21d1496
100644
(file)
--- a/
net/eth.c
+++ b/
net/eth.c
@@
-60,7
+60,11
@@
extern int npe_initialize(bd_t *);
extern int uec_initialize(int);
extern int bfin_EMAC_initialize(bd_t *);
extern int atstk1000_eth_initialize(bd_t *);
extern int uec_initialize(int);
extern int bfin_EMAC_initialize(bd_t *);
extern int atstk1000_eth_initialize(bd_t *);
+extern int greth_initialize(bd_t *);
+extern int atngw100_eth_initialize(bd_t *);
extern int mcffec_initialize(bd_t*);
extern int mcffec_initialize(bd_t*);
+extern int mcdmafec_initialize(bd_t*);
+extern int at91sam9_eth_initialize(bd_t *);
#ifdef CONFIG_API
extern void (*push_packet)(volatile void *, int);
#ifdef CONFIG_API
extern void (*push_packet)(volatile void *, int);
@@
-214,6
+218,12
@@
int eth_initialize(bd_t *bis)
#if defined(CONFIG_UEC_ETH2)
uec_initialize(1);
#endif
#if defined(CONFIG_UEC_ETH2)
uec_initialize(1);
#endif
+#if defined(CONFIG_UEC_ETH3)
+ uec_initialize(2);
+#endif
+#if defined(CONFIG_UEC_ETH4)
+ uec_initialize(3);
+#endif
#if defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
fec_initialize(bis);
#if defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
fec_initialize(bis);
@@
-266,9
+276,22
@@
int eth_initialize(bd_t *bis)
#if defined(CONFIG_ATSTK1000)
atstk1000_eth_initialize(bis);
#endif
#if defined(CONFIG_ATSTK1000)
atstk1000_eth_initialize(bis);
#endif
+#if defined(CONFIG_GRETH)
+ greth_initialize(bis);
+#endif
+#if defined(CONFIG_ATNGW100)
+ atngw100_eth_initialize(bis);
+#endif
#if defined(CONFIG_MCFFEC)
mcffec_initialize(bis);
#endif
#if defined(CONFIG_MCFFEC)
mcffec_initialize(bis);
#endif
+#if defined(CONFIG_FSLDMAFEC)
+ mcdmafec_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");
if (!eth_devices) {
puts ("No ethernet found.\n");
@@
-423,24
+446,26
@@
int eth_init(bd_t *bis)
{
struct eth_device* old_current;
{
struct eth_device* old_current;
- if (!eth_current)
- return 0;
+ if (!eth_current) {
+ puts ("No ethernet found.\n");
+ return -1;
+ }
old_current = eth_current;
do {
debug ("Trying %s\n", eth_current->name);
old_current = eth_current;
do {
debug ("Trying %s\n", eth_current->name);
- if (eth_current->init(eth_current,
bis)
) {
+ if (eth_current->init(eth_current,
bis) >= 0
) {
eth_current->state = ETH_STATE_ACTIVE;
eth_current->state = ETH_STATE_ACTIVE;
- return
1
;
+ return
0
;
}
debug ("FAIL\n");
eth_try_another(0);
} while (old_current != eth_current);
}
debug ("FAIL\n");
eth_try_another(0);
} while (old_current != eth_current);
- return
0
;
+ return
-1
;
}
void eth_halt(void)
}
void eth_halt(void)
@@
-519,6
+544,15
@@
int eth_receive(volatile void *packet, int length)
void eth_try_another(int first_restart)
{
static struct eth_device *first_failed = NULL;
void eth_try_another(int first_restart)
{
static struct eth_device *first_failed = NULL;
+ char *ethrotate;
+
+ /*
+ * Do not rotate between network interfaces when
+ * 'ethrotate' variable is set to 'no'.
+ */
+ if (((ethrotate = getenv ("ethrotate")) != NULL) &&
+ (strcmp(ethrotate, "no") == 0))
+ return;
if (!eth_current)
return;
if (!eth_current)
return;