Allow network to be locked at 100/Full.

This commit is contained in:
Eric Norum
2005-10-26 14:56:58 +00:00
parent a6c027ccfa
commit 21dd4cf8de
3 changed files with 25 additions and 4 deletions

View File

@@ -1,3 +1,7 @@
2005-10-26 Eric Norum <norume@aps.anl.gov>
* README, network/network.c: Add support for forcing link parameters.
2005-09-16 Eric Norum <norume@aps.anl.gov>
* startup/bspstart.c: Add bsp_reset bootrom call.

View File

@@ -81,6 +81,10 @@ port into RAM then executed or programmed into flash memory.
setenv HOSTNAME somename (Your board's name)
3) Type 'tftp<CR>'
This forces the network link to half-duplex. If your network link is
locked at full duplex you'll have to find another port!
The RTEMS network driver can be forced to 100 Mbs/full-duplex by setting
the bootstrap environment variable IPADDR0_100FULL to Y.
4) Run 'tftp' on your host machine:
tftp> binary

View File

@@ -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
@@ -945,6 +952,13 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
if (ifp->if_snd.ifq_maxlen == 0)
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
*/
@@ -952,4 +966,3 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
ether_ifattach(ifp);
return 1;
};