diff options
author | Eric Norum <WENorum@lbl.gov> | 2005-10-26 14:56:58 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 2005-10-26 14:56:58 +0000 |
commit | 21dd4cf8de681e00c40d17304dabeefd72b84c95 (patch) | |
tree | f9ce27c971e8815dd64210bba107f1b9de25b63d /c/src/lib/libbsp/m68k/uC5282/network/network.c | |
parent | Regenerate. (diff) | |
download | rtems-21dd4cf8de681e00c40d17304dabeefd72b84c95.tar.bz2 |
Allow network to be locked at 100/Full.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/m68k/uC5282/network/network.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/m68k/uC5282/network/network.c b/c/src/lib/libbsp/m68k/uC5282/network/network.c index c167378bd3..1a93e2ee55 100644 --- a/c/src/lib/libbsp/m68k/uC5282/network/network.c +++ b/c/src/lib/libbsp/m68k/uC5282/network/network.c @@ -105,6 +105,11 @@ struct mcf5282_enet_struct { unsigned long txRawWait; unsigned long txRealign; unsigned long txRealignDrop; + + /* + * Link parameters + */ + int force100Full; uint16_t mii_sr2; }; static struct mcf5282_enet_struct enet_driver[NIFACES]; @@ -293,15 +298,16 @@ mcf5282_fec_initialize_hardware(struct mcf5282_enet_struct *sc) * Advertise 100 Mb/s, full-duplex, IEEE-802.3 * Turn off auto-negotiate * Enable speed-change, duplex-change and link-status-change interrupts - * Start auto-negotiate + * Set 100/full and perhaps auto-negotiate */ setMII(1, 20, 0x42F2); setMII(1, 4, 0x0181); - setMII(1, 0, 0x0000); + setMII(1, 0, 0x2100); rtems_task_wake_after(2); sc->mii_sr2 = getMII(1, 17); setMII(1, 18, 0x0072); - setMII(1, 0, 0x1000); + if (!sc->force100Full) + setMII(1, 0, 0x3100); /* * Set up receive buffer descriptors @@ -875,6 +881,7 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching ) int unitNumber; char *unitName; unsigned char *hwaddr; + const char *env; /* * Parse driver name @@ -946,10 +953,16 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching ) ifp->if_snd.ifq_maxlen = ifqmaxlen; /* + * Check for environment overrides + */ + if (((env = bsp_getbenv("IPADDR0_100FULL")) != NULL) + && ((*env == 'y') || (*env == 'Y'))) + sc->force100Full = 1; + + /* * Attach the interface */ if_attach(ifp); ether_ifattach(ifp); return 1; }; - |