1.前言

本文是对K64 datasheet 之ENET部分的功能描述,将对每个部分进行详细说明

2.Ethernet MAC frame formats

  • MAC帧组成格式

(1)7字节前导码:如按最低位先传则为0x55 0x55 0x55 0x55 0x55 0x55;

(2)起始帧定界符(SFD):如按最低位先传则为0XD5;

(3)2个地址域:包括源MAC地址和目的MAC地址;

(4)VLAN-tagged :可选,占4字节

(5)长度或类型域:代表有效负荷的长度或者类型,以太网802.3组帧为例,如果小于0X05DC(1500字节)则为长度信息,如果大于0X0600(1536字节)则为类型信息

常见的类型为:IPV4,ARP等

(6)有效载荷:最小为42 octets(带有VALAN-tagged),46 octets(不带有VALAN-tagged),最大载荷为1500 octets

(7)填充域:有效载荷不足42 octets(带有VALAN-tagged),46 octets(不带有VALAN-tagged),则填充

(8)CRC值:4字节循环冗余校验

注:

[1]帧长度不包括Preamble和SFD,帧最小长度为64字节,最大长度为1518字节

[2]除去 6 octets的 Destination address+6 octsts Source address+2 octets Length/type+4octets FCS = 18 octets,因此有效载荷需要至少46 octets,需填充0~46octets

[3]可选的是VLAN-tagged 可以插入到MACSource address和Length/type之间4字节,构成VLAN-tagged MAC 帧

  • MAC帧定义

  • Pause Frames

接收端产生一个pause frame指示当前传输遇到拥堵,发送端需要停止发送数据

  • Magic packets

用于实现远程唤醒,当侦测到magic packet,主机会被唤醒

3.IP and higher layers frame format

举例来说IP数据报指定了Ethernet帧的有效负荷,TCP数据报又在IP数据报中指定了有效负荷

  • Ethernet types

  • IPv4 datagram format
  • IPv6 datagram format
  • Internet Control Message Protocol (ICMP) datagram format
  • User Datagram Protocol (UDP) datagram format
  • TCP datagram format

4. IEEE 1588 message formats

  • Adjustable timer module

ENET时间戳时钟源既可以来自外部ENET_1588_CLKIN PAD ,也可以来自内部ENET PLL 。最好选择整形值如3ns产生精准计时

通过专用校准逻辑定时器被校准来同步远端master时钟作为本地系统的参考时钟

Adjustable timer implementation

  • Transmit timestamping
  • Receive timestamping
  • Time synchronization

5. MAC receive

  • Collision detection in half-duplex mode
  • Preamble processing

MAC core允许任意长度的preample,也允许是0长度,如果preample后SFD的首个字节不是0x55也不是0xd5则丢弃

  • MAC address check

目的地址bit0区分了不同的地址:

(1)If bit 0 is 0, the MAC address is an individual (unicast) address.
(2)If bit 0 is 1, the MAC address defines a group (multicast) address.
(3)If all 48 bits of the MAC address are set, it indicates a broadcast address.

  • Frame length/type verification: payload length check

If the length/type is less than 0x600 and NLC is set, the MAC checks the payload length and reports any error in the frame status word and interrupt bit PLR

If the length/type is greater than or equal to 0x600, the MAC interprets the field as a type  and no payload length check is performed

The length check is performed on VLAN and stacked VLAN frames. If a padded frame is received, no length check can be performed

  • Frame length/type verification: frame length check
    When the receive frame length exceeds MAX_FL bytes, the BABR interrupt is generated and the RxBD[LG] bit is set.
  • VLAN frames processing

VLAN frames have a length/type field set to 0x8100 immediately followed by a 16-Bit VLAN control information field.

  • Pause frame termination

The receive engine terminates pause frames and does not transfer them to the receive FIFO

  • CRC check

The CRC-32 field is checked and forwarded to the core FIFO interface if ENETn_RCR[CRCFWD] is cleared and ENETn_RCR[PADEN] is set

  • Frame padding removal
  • Recieve flushing

RX flushing prevents frames in the RX FIFO from being blocked

6 MAC transmit

  • Frame payload padding

The IEEE specification defines a minimum frame length of 64 bytes

  • MAC address insertion
  • CRC-32 generation
  • Inter-packet gap (IPG)
  • Collision detection and handling — half-duplex operation only

A collision occurs on a half-duplex network when concurrent transmissions from two or more nodes take place.

7. Full-duplex flow control operation

8 Magic packet detection

Magic packet detection wakes a node that is put in power-down mode by the node management agent

9. IP accelerator functions

  • Checksum calculation

The IP and ICMP, TCP, UDP checksums are calculated with one's complement arithmetic summing up 16-bit values

  • Additional padding processing
  • 32-bit Ethernet payload alignment

The data FIFOs allow inserting two additional arbitrary bytes in front of a frame. This extends the 14-byte Ethernet header to a 16-byte header, which leads to alignment of the
Ethernet payload

  • IPv4 fragments
  • IPv6 support

10. Resets and stop controls

  • Hardware reset
  • Soft reset
  • Hardware freeze
  • Graceful stop

During a graceful stop, any currently ongoing transactions are completed normally and no further frames are accepted

11 IEEE 1588 functions

  • Adjustable timer module
  • Transmit timestamping
  • Receive timestamping
  • Time synchronization

12 FIFO thresholds

  • Receive FIFO

  • Transmit FIFO

13 Loopback options

14 Legacy buffer descriptors

To support the Ethernet controller on previous Freescale devices, legacy FEC buffer  descriptors are available

15 Enhanced buffer descriptors

This section provides a description of the enhanced operation of the driver/DMA via the buffer descriptors

16 Client FIFO application interface

The FIFO interface is completely asynchronous from the Ethernet line, and the transmit and receive interface can operate at a different clock rate

17 FIFO protection

  • Transmit FIFO underflow
  • Transmit FIFO overflow
  • Receive FIFO overflow

18 Reference clock

The input clocks to the ENET module must meet the specifications in the following table

19 PHY management interface

  • MDIO frame format

  • MDIO clock generation

The MDC clock is generated from the internal bus clock divided by the value programmed in ENETn_MSCR[MII_SPEED].

  • MDIO operation

To perform an MDIO access, set the MDIO command register (ENETn_MMFR) according to the description provided in MII Management Frame Register (ENETn_MMFR).

To check when the programmed access completes, read the ENETn_EIR[MII] field.

20 Ethernet interfaces

The following Ethernet interfaces are implemented:

-Fast Ethernet MII (Media Independent Interface)
-RMII 10/100 using interface converters/gaskets

The following table shows how to configure ENET registers to select each interface

  • RMII interface

  • MII Interface — transmit

MII interface — receive

k64 datasheet学习笔记45---10/100-Mbps Ethernet MAC(ENET)之功能描述的更多相关文章

  1. k64 datasheet学习笔记1---概述

    1.前言 k64 datasheet描述了Freescale MCU的特性.架构和编程模型,主要是面向使用MCU的系统架构和软件应用开发人员. 2.模块划分 datasheet主要按功能对模块进行划分 ...

  2. k64 datasheet学习笔记45---10/100-Mbps Ethernet MAC(ENET)之概述

    1.前言 k64 ENET CORE 实现了10M/100Mbps的Ethernet MAC,与IEEE802.3-2002标准兼容. MAC层与全双工/半双工的10M/100Mbps以太网兼容: M ...

  3. k64 datasheet学习笔记35---Analog-to-Digital Converter (ADC)

    0.前言 本文主要介绍K64的ADC部分的特性,内部架构,信号描述及操作接口等 1.简介 1.1.ADC模块特性 线性逐次逼近算法,达16bit分辨率 达到4对差分和24个单端模拟量输入 输出模式 差 ...

  4. k64 datasheet学习笔记3---Chip Configuration之Analog

    1.前言 本文主要讲述K64芯片配置,关于模拟部分的内容,主要包括:ADC, CMP, DAC, VREF 2.16bit SAR ADC 从上图可以看出ADC主要挂在外设总线0上,由于ADC的输入引 ...

  5. k64 datasheet学习笔记25--Multipurpose Clock Generator (MCG)

    0.前言 MCG模块为MCU提供了几种可选时钟源.模块包含一个FLL和一个PLL.FLL使用内部或外部参考时钟是可控的,PLL受外部参考时钟控制 模块可以选择FLL或PLL输出时钟,或内/外部参考时钟 ...

  6. k64 datasheet学习笔记21--Direct Memory Access Multiplexer (DMAMUX)

    0.前言 本章主要介绍DMA MUX的相关内容 1.简介 1.1 概述 用来路由DMA源到16路DMA通道: 1.2 特性 1.52个外设slot和10个常开slot可以路由到16路DMA通道 2.1 ...

  7. k64 datasheet学习笔记52---Universal Asynchronous Receiver/Transmitter (UART)

    1.前言 UART实现与外设或CPU的通信 2. UART概述 2.1基本特性 (1)Full-duplex operation (2)Standard mark/space non-return-t ...

  8. k64 datasheet学习笔记10---Signal Multiplexing and Signal Descriptions

    1.前言 本文主要描述多功能引脚相关的内容,包括5个32位的引脚的端口,每个32pin端口被指定一个中断 2.Signal Multiplexing Integration 3. Port contr ...

  9. k64 datasheet学习笔记4---Clock distribution

    1.前言 本文主要讲述K64时钟配置相关的内容. 2.clock overview 2.1 clock diagram 2.2 对clock diagram的信号说明 (1)MCG决定哪个clock ...

随机推荐

  1. C++ cout格式化输出(转)

    C++ cout格式化输出(转) 这篇文章主要讲解如何在C++中使用cout进行高级的格式化输出操作,包括数字的各种计数法(精度)输出,左或右对齐,大小写等等.通过本文,您可以完全脱离scanf/pr ...

  2. Java Hibernate中的悲观锁和乐观锁的实现

    锁(locking) 业务逻辑的实现过程中,往往需要保证数据访问的排他性.如在金融系统的日终结算 处理中,我们希望针对某个cut-off时间点的数据进行处理,而不希望在结算进行过程中 (可能是几秒种, ...

  3. Linux 检查 外部设备 是否存在

    以 USB 为例,如果移植了udev,那么在usb插入的时候,/dev下面会出现usb有关的设备,同时,自动挂载到文件系统的某个节点 如果以文件系统usb对应的挂载点来检测USB是否插入,是不够严谨的 ...

  4. JavaScript中调皮的undefined

    JavaScript中调皮的undefined 在JavaScript中undefined只是一个标识符,不是关键字,这个很不靠谱的标识符还不能像其他符号一样随意使用,一方面是需要它的原始值保持不变, ...

  5. mysql使用navicat和mysqldump导出数据

    1.navicat 方式一:选中表,右键转储:(含有表结构和数据) 方式二:选择右上角工具,点击数据传输,在这个页面右侧选择数据库,左侧选择文件. 点击下一步,选择导出的表名和各种函数什么的,然后点击 ...

  6. c++后台开发路线

  7. springBoot打包发布项目------jar包

    这两年微服务很流行,这里简单介绍一下如何将自己使用idea写的微服务打包成一个可执行的jar包,并发布到linux服务器的步骤.因为spring boot有内置的tomcat所以一般使用内置的tomc ...

  8. vue 获取时间戳对象转换为日期格式

    //1. 简单页面展示用<template> <!-- time为时间戳 --> <div>{{time | formatDate}}</div> &l ...

  9. FILE SIGNATURES TABLE

    FILE SIGNATURES TABLE 16 December 2017 This table of file signatures (aka "magic numbers") ...

  10. c# 读取excels

    DataTable ExcelTable;            DataSet ds = new DataSet();            //Excel 文件一般都保存为统一的xls的连接  其 ...