Motorola MPC5200 Manuel D’Utilisation

Page de 28
12
KADAK
KwikNet MPC5200 FEC Device Driver
6.4  Configuring the Physical Device
The Ethernet transceiver device (PHY) is configured by function 
kn_5200_pcon_fec()
in the driver's pin assignment and board setup module 
M5200EBS.C
.  The PHY is
configured each time the device driver is called by the 
KwikNet
 Ethernet network driver to
open the network interface for use by the application.
The PHY wiring mode is determined by an attribute setting in the device driver parameter
list (see Appendix A).  If attribute bit 
W
 is 0, the 18-wire (MII) mode is assumed.  If
attribute bit 
W
 is 1, the 7-wire mode is assumed.
If the PHY operates in 7-wire mode, there is little special initialization required.  The
PHY is configured and is immediately available for use.
If the PHY operates in 18-wire mode using the Media Independent Interface (MII)
protocol, the PHY is programmed to initiate an auto-negotiation process in accordance
with the Ethernet link speed and duplex mode settings in the device driver parameter list.
The auto-negotiation can take awhile, during which time the device is unavailable for
use.  The negotiation can take from a few tens of milliseconds to one or two seconds to
complete.
The device driver cannot suspend execution of the 
KwikNet
 TCP/IP stack while it awaits
the PHY negotiation results.  The driver offers three modes of operation to cope with this
issue.
Mode 0: No Delay
In the simplest case, the driver ignores the negotiation process and returns immediately to
the network driver which declares the interface open for business.  However, your
application must defer from using the interface for at least two seconds to ensure that the
PHY setup has been completed.  This deferral may not be possible if, for example, you
have enabled DHCP or AutoIP IP address negotiation to begin once the interface is open.
Mode 1: Continuous Poll
If your application can withstand the consequences, the driver can continuously poll the
PHY, up to some maximum interval, waiting for the auto-negotiation to complete.  The
driver will then return to the network driver, the network interface will be declared open
and the network will in fact be fully operational.
However, you must be aware that 
KwikNet
 will experience a compute-bound delay which
can exceed 2 seconds, every time the MPC5200 FEC network interface is opened for use.
In a multitasking system, all lower priority activity will be inhibited until the interface is
ready or until the timeout interval expires.
If the PHY auto-negotiation fails to complete within the timeout interval, the driver will
report the failure and the network driver will declare that the network interface cannot be
opened for use.