• Before transmitting, the controller waits for carrier sense to become inactive, then
determines if carrier sense stays inactive for 60 bit times. If the transmission begins
after waiting an additional 36 bit times (96 bit times after carrier sense originally
became inactive), both buffer (TXB) and frame (TXF) interrupts may be generated as
determined by the settings in the EIMR.
• Reception-The FEC receiver is designed to work with almost no intervention from
the host and can perform address recognition, CRC checking, short frame checking,
and maximum frame length checking. When the driver enables the FEC receiver by
asserting ECR[ETHER_EN], it immediately starts processing receive frames. When
FEC_RX_DV asserts, the receiver checks for a valid PA/SFD header. If the PA/SFD
is valid, it is stripped and the frame is processed by the receiver. If a valid PA/SFD is
not found, the frame is ignored. In MII mode, the receiver checks for at least one
byte matching the SFD. Zero or more PA bytes may occur, but if a 00 bit sequence is
detected prior to the SFD byte, the frame is ignored.
• After the first six bytes of the frame have been received, the FEC performs address
recognition on the frame. During reception, the Ethernet controller checks for various
error conditions and once the entire frame is written into the FIFO, a 32-bit frame
status word is written into the FIFO. This status word contains the M, BC, MC, LG,
NO, CR, OV, and TR status bits, and the frame length. Receive Buffer (RXB) and
Frame Interrupts (RXF) may be generated if enabled by the EIMR register. When the
receive frame is complete, the FEC sets the L bit in the RxBD, writes the other frame
status bits into the RxBD, and clears the E bit. The Ethernet controller next generates
a maskable interrupt (RXF bit in EIR, maskable by RXF bit in EIMR), indicating that
a frame has been received and is in memory. The Ethernet controller then waits for a
new frame.
• Interrupt management-When an event occurs that sets a bit in the EIR, an interrupt is
generated if the corresponding bit in the interrupt mask register (EIMR) is also set.
The bit in the EIR is cleared if a one is written to that bit position; writing zero has
no effect. This register is cleared upon hardware reset. These interrupts can be
divided into operational interrupts, transceiver/network error interrupts, and internal
error interrupts. Interrupts which may occur in normal operation are GRA, TXF,
TXB, RXF, RXB. Interrupts resulting from errors/problems detected in the network
or transceiver are HBERR, BABR, BABT, LC, and RL. Interrupts resulting from
internal errors are HBERR and UN. Some of the error interrupts are independently
counted in the MIB block counters. Software may choose to mask off these interrupts
as these errors are visible to network management through the MIB counters.
• PHY management-phylib was used to manage all the FEC phy related operation such
as phy discovery, link status, and state machine.MDIO bus will be created in FEC
driver and registered into the system.You can refer to Documentation/networking/
phy.txt under linux source directory for more information.
Chapter 27 Fast Ethernet Controller (FEC) Driver
i.MX 6SoloLite Linux Reference Manual, Rev. L3.0.35_4.1.0, 09/2013
Freescale Semiconductor, Inc.
175