forked from Imagelibrary/rtems
Allow network to be locked at 100/Full.
This commit is contained in:
@@ -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>
|
2005-09-16 Eric Norum <norume@aps.anl.gov>
|
||||||
|
|
||||||
* startup/bspstart.c: Add bsp_reset bootrom call.
|
* startup/bspstart.c: Add bsp_reset bootrom call.
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ port into RAM then executed or programmed into flash memory.
|
|||||||
setenv HOSTNAME somename (Your board's name)
|
setenv HOSTNAME somename (Your board's name)
|
||||||
|
|
||||||
3) Type 'tftp<CR>'
|
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:
|
4) Run 'tftp' on your host machine:
|
||||||
tftp> binary
|
tftp> binary
|
||||||
|
|||||||
@@ -105,6 +105,11 @@ struct mcf5282_enet_struct {
|
|||||||
unsigned long txRawWait;
|
unsigned long txRawWait;
|
||||||
unsigned long txRealign;
|
unsigned long txRealign;
|
||||||
unsigned long txRealignDrop;
|
unsigned long txRealignDrop;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Link parameters
|
||||||
|
*/
|
||||||
|
int force100Full;
|
||||||
uint16_t mii_sr2;
|
uint16_t mii_sr2;
|
||||||
};
|
};
|
||||||
static struct mcf5282_enet_struct enet_driver[NIFACES];
|
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
|
* Advertise 100 Mb/s, full-duplex, IEEE-802.3
|
||||||
* Turn off auto-negotiate
|
* Turn off auto-negotiate
|
||||||
* Enable speed-change, duplex-change and link-status-change interrupts
|
* 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, 20, 0x42F2);
|
||||||
setMII(1, 4, 0x0181);
|
setMII(1, 4, 0x0181);
|
||||||
setMII(1, 0, 0x0000);
|
setMII(1, 0, 0x2100);
|
||||||
rtems_task_wake_after(2);
|
rtems_task_wake_after(2);
|
||||||
sc->mii_sr2 = getMII(1, 17);
|
sc->mii_sr2 = getMII(1, 17);
|
||||||
setMII(1, 18, 0x0072);
|
setMII(1, 18, 0x0072);
|
||||||
setMII(1, 0, 0x1000);
|
if (!sc->force100Full)
|
||||||
|
setMII(1, 0, 0x3100);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up receive buffer descriptors
|
* Set up receive buffer descriptors
|
||||||
@@ -875,6 +881,7 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
|
|||||||
int unitNumber;
|
int unitNumber;
|
||||||
char *unitName;
|
char *unitName;
|
||||||
unsigned char *hwaddr;
|
unsigned char *hwaddr;
|
||||||
|
const char *env;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse driver name
|
* 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)
|
if (ifp->if_snd.ifq_maxlen == 0)
|
||||||
ifp->if_snd.ifq_maxlen = ifqmaxlen;
|
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
|
* Attach the interface
|
||||||
*/
|
*/
|
||||||
@@ -952,4 +966,3 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
|
|||||||
ether_ifattach(ifp);
|
ether_ifattach(ifp);
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user