5.2.3 MAC Frame Data Integrity
While the MAC and Frame Check Sequence (FCS) safeguards Ethernet packets against bit errors over the network, it assumes an error free SPI connection between the MAC-PHY and host. However, there always exists a very small probability that the Ethernet frames between the MAC-PHY may incur bit errors over SPI. This is especially true for applications in high electromagnetic environments that could couple noise into the application. Normally these SPI bit errors cannot be detected at the Ethernet frame level and data integrity is therefore guaranteed by higher protocol layers.
For high safety or electromagnetic sensitive applications, the MAC-PHY may be configured to guarantee error-free communication over SPI at cost of increased processing by the host. The MAC-PHY is configured to protect SPI communication by setting the following bits:
- Write a ‘1’ to the Transmit Frame Check Sequence Validation (TXFCSVE) bit of the OPEN Alliance Configuration 0 (OA_CONFIG0) register. Setting this bit causes the MAC-PHY to validate transmit frames with the FCS computed and appended by the host.
- Write a ‘1’ to the MAC Frame Check Sequence Disable (MACFCSDIS) bit of the Queue Transmit Configuration (QTXCFG) register. Setting this bit disables the calculation and appending of FCS for frames from the host.
- Write a ‘0’ to the Remove FCS (RFCS) bit of the MAC Network Configuration Register (MAC_NCFGR). note: This bit is 0 by default, preventing the MAC from stripping the FCS from frames received from the network when relaying them to the host via SPI.
For transmit frames, the host must pad the frame by appending dummy bytes to the frame payload such that the frame will be at least 60 bytes (64 bytes in length once the frame check sequence is appended). The host must then compute the 32‑bit FCS for the frame and append it to the frame. The host may then transmit the frame to the MAC-PHY over SPI. When the MAC-PHY receives the frame from the host, it will validate the FCS of the frame computed and appended by the host. If the FCS fails to validate, the MAC-PHY will drop the packet and set the Transmit Frame Check Sequence Error (TXFCSE) bit in the OPEN Alliance Status 0 (OA_STATUS0) register.
The integrated MAC still validates frames received from the network for a valid FCS and drops the frame when an error is detected. If the frame passes the FCS validation, the MAC-PHY will relay the frame to the host via SPI without stripping the FCS. The host may then perform its own validation of the FCS to guarantee no bit errors were introduced by the SPI.
