车载以太网PHY

本文详细介绍了以太网PHY技术,包括100Base-T1、1000Base-TX、1000Base-T、10G以太网的不同编码方式和数据传输特性。讨论了PHY接口的不同类型如MII、RGMII、SGMII和SerDes,以及它们的模式和功能。还涉及了车载以太网PHY的特点,如Master/Slave模式和 BroadR-Reach线缆。此外,阐述了自协商过程、回环模式、TDR用于电缆诊断,以及PHY接口转换桥芯片的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 RJ45
1.1 10/100Base-T
1) TX+ Transmit Data+
2) TX-  Transmit Data-
3) RX+ Receive Data+
6) RX-  Receive Data-

1.2 1000Base-T
1) BI_D1+ Bi-directional Data+(双向数据+)
2) BI_D1- Bi-directional Data-(双向数据-)
3) BI_D2+ Bi-directional Data+(双向数据+)
4) BI_D3+ Bi-directional Data+(双向数据+)
5) BI_D3- Bi-directional Data-(双向数据-)
6) BI_D2- Bi-directional Data-(双向数据-)
7) BI_D4+ Bi-directional Data+(双向数据+)
8) BI_D4- Bi-directional Data-(双向数据-)

- 1000Base-T在传输中使用了全部4对双绞线并工作在全双工模式下。这种设计采用 PAM-5(5级脉冲放大调制,属于PCS层;不同于使用千兆Serdes接口的8/10bit编码)编码在每个线对上传输250Mbps
- 千兆以太网四对差分线使用了类似电话的消侧音技术,而百兆没有。就像电话座机,只有一对线,你打电话的时候,可以听到别人的声音,但是从听筒中听不到自己的声音
- 100Base-T1使用PAM-3编码;10G以太网使用PAM-16编码
- 1000Base-TX尽管也是采用了全部的4对双绞芯线,但是它是两对发送,两对接收;X表示要交叉连接
- 1000Base-X规范,一对发送,一对接收,SerDes接口;X表示要交叉连接

2 PHY接口
2.1 PHY接口Pin描述
MII:TXD[3:0]、TX_EN、TX_ER、TX_CLK和RXD[3:0]、RX_ER、RX_CLK、RX_DV、 COL、CRS;速率等于25 MHz x 4 bit(4bit为一个nibble);MII接口车载以太网PHY TJA1100HN
GMII:TXD[7:0]、TX_EN、TX_ER、GTX_CLK和RXD[7:0]、RX_ER、RX_CLK、RX_DV、 COL、CRS;速率等于125 MHz x 8bit,PAM3编码
RGMII:TXD[3:0]、TX_CTL、GTX_CLK和RXD[3:0]、RX_CLK、RX_CTL;QCOM的5G模块一般使用这个接口
SGMII和SerDes:包含7根线,分别是TDP/TDN、RDP/RDN、TCLKP/TCLKN和ALOS(Analog Loss of Signal),SGMII分为4-pin和6-pin模式;QCOM的4G模块一般使用这个接口

2.2 SGMII和SerDes的区别
1)SGMII模式下GMII的控制信号(TX_EN、TX_ER、RX_ER和RX_DV) 被K-code代替
2)SGMII和SerDes的pin脚是一样的,唯一的区别是SGMII支持10/100/1000 Mbps Auto-Negotiation(AN),而SerDes不支持速率自协商,固定为1000 Mbps
3)自协商的2个寄存器
AN_ADV:Auto-Negotiation Advertisement
AN_LPA:Auto-Negotiation Link Partner Ability,SGMII模式时芯片读取该寄存器,设置MAC的速度和双工配置
Advertisement -> Partner Ability
Partner Ability <- Advertisement
4) SGMII PCS: https://opencores.org/projects/sgmii
5)Copper和Fiber的Auto-sensing功能

2.3 SerDes千兆光口自协商
1)千兆光口(SerDes模式)可以工作在强制和自协商两种模式。802.3规范中千兆光口只支持1000M速率,支持全双工(Full)和半双工(Half)两种双工模式。
2)自协商和强制最根本的区别就是两者在建立物理链路时发送的码流不同,自协商模式发送的是C码,也就是配置(Configuration)码流,而强制模式发送的是I码,也就是Idle码流。

2.4 RGMII
RGMII接口的PHY一般支持两种传输模式,正常模式和延时模式,两种模式的区别在于时钟、控制信号和数据对齐方式不同,其传输模式由MDIO接口或者硬件上的特殊引脚配置。In the old days the vendors put RGMII timing calibration data into the eFuse.
rgmii: Rx and Tx delays are added by the MAC when required, SA8155 stmicro
rgmii-id: RGMII with internal Rx and Tx delays provided by the PHY, the MAC should not add the Rx or Tx delays in this case
rgmii-rxid: RGMII with internal Rx delay provided by the PHY, the MAC should not add an Rx delay in this case, MT2712 stmicro
rgmii-txid: RGMII with internal Tx delay provided by the PHY, the MAC should not add an Tx delay in this case

2.5 PHY的回环模式
一般PHY都有三种回环模式:
内部回环,Internal - PHY的offset 0 Control寄存器控制,很多时候PHY设置Loopback后端口可能就Link down了,所以需要设置端口Force Link up,refer to Intel 82576EB 3.5.4.1.4 Forcing Link
外部回环,External - Vendor,RJ45 Loopback Cable
远程回环,Remote - Vendor

Refer to Intel 82576EB loopback.

2.6 车载以太网PHY特征
1Gbit automotive PHY was SOPed in 2020.
1)车载以太网PHY支持Master/Slave模式,对接两端必须一个是Master,一个是Slave,Master发起链路training;
2)Broadcom的车载以太网PHY不能协商DP和DM交换功能;但是NXP车载以太网PHY可以协商并且交换DP和DM;
3)BR Cable:BroadR-Reach,车载以太网线缆;
4) OABR PHY integrates Echo Canceler.

2.7 TDC-based TDR for Cable Diagnostics
[14th-Mar-2022]
TDC means time intervals to digital converter, it's a subset of ADC, TI discrete TDR diagnostics IC TDC7201 (TOF). Refer to bcm89230, Intel 82576EB and TI DP83TD510E datasheet. 
By sending a pulse onto the twisted pair and observing the returned signal, the following can be deduced:
1) Is there a short?
2) Is there an open?
3) Is there an impedance mismatch?
4) What is the length to any of these faults?
5) Estimating the cable length.

2.8 PHY接口转换桥芯片
Microsemi MAX24287

2.9 网线插拔通知函数
netif_carrier_on()
netif_carrier_off()
以太网驱动初始化时,会扫描MII总线,PHYAD从0到31,读取PHY_ID,读取到一个就创建一个struct phy_device,匹配原则是比较struct phy_device与struct phy_driver的phy_id,相等即匹配上。

2.10 Reverse MII
This mode is used for ethernet Media Converter.
The MII signals are cross connected: RX output signals from one PHY are connected to the TX inputs on the other PHY. The 100Base-T1 PHY TXC and RXC clock signals become inputs in Reverse MII mode.
88EA1512
88Q2110

3 PHY寄存器
3.1 MDIO帧格式
1)802.3-c22:最大寻址32个寄存器;PHY驱动会读取2个偏移分别是2和3的寄存器PHYID1和PHYID2(每个寄存器都是16 bit宽度);其中的c表示Clause,条款的意思;
2)802.3-c45:PHY中最多有32个子设备,每个子设备最多有64K个寄存器;
3)/sys/bus/mdio_bus/drivers。对于c22 PHY,sysfs中的phy_id就是4个字节的PHY ID,而c45 PHY,如果ID读取成功,那么sysfs phy_id等于0,否则等于-1。

3.2 c22 PHY寄存器
寄存器都是16 bit宽度。
offset 9 byte:MASTER-SLAVE Control Register
MASTER-SLAVE Manual Config ENABLE:Master/Slave强制配置使能位,为了提高链路建立的速度,需要预先配置Master/Slave模式。

The odd thing is that the QNX network stack is based on the NetBSD network stack which does have the concept of a PHY driver. QNX SDP 7.1 includes a c45 MII library.

3.3 Auto Negotiation c28
IEEE802.3-2015 Clause 28 Next Page for 1000Base-T Auto Negotiation.

4 URLs
BroadR_Reach_Automotive_Spec_V3.2_w_o.pdf
http://grouper.ieee.org/groups/802/3/1TPCESG/public/BroadR_Reach_Automotive_Spec_V3.2_w_o.pdf

5 Abbreviations
AQ:Marvell Aquantia Corporation
FAKRA:发音法卡,德语汽车专家组的缩写
MDI:Medium Dependent Interface,媒介有关接口,通常是指将以太网主机或控制器连接至电缆的物理连接器,譬如FAKRA;需要使用矢量网络分析仪VNA测量MDI回波损耗,即100 Ω差分阻抗是否匹配
Mii nibble stream:MII数据接口是半字节传输;Each 4-bit data nibble representing half of a data byte
NXP's DPAA FMan MAC: Data Path Acceleration Architecture Frame Manager MAC
10Base-T1S:S表示Short Reach
VNA:Vector Network Analyzer,矢量网络分析仪

### 10 Mbps Automotive Ethernet PHY Specifications and Applications For 10 Mbps automotive Ethernet, the physical layer (PHY) specifications are rooted in early Ethernet standards but tailored specifically to meet stringent automotive requirements such as electromagnetic compatibility (EMC), temperature ranges, and reliability. The original Ethernet standard supported speeds up to 10 Mbit/s over thick coaxial cable with a throughput of approximately 1.25 MB/s[^1]. However, modern automotive Ethernet has evolved significantly from these initial setups. The primary specification guiding 10 Mbps automotive Ethernet PHYs is part of the broader IEEE 802.3 series of standards which includes amendments like those specified for operation over single balanced twisted pair cables at higher data rates[^2]. For lower speed operations including 10 Mbps, similar principles apply regarding signal integrity, cabling materials, connectors, and transceiver design while being optimized for cost-effective implementation within vehicles. Applications of 10 Mbps automotive Ethernet include: - **Intra-domain communication**: Connecting various Electronic Control Units (ECUs) inside specific domains or zones within an automobile. - **Sensors interfacing**: Linking simple sensors that do not require high bandwidth connections yet need reliable low-latency links. - **Diagnostic interfaces**: Providing standardized methods for diagnostics tools to interact with vehicle systems through OBD-II ports typically operating at this rate due to backward compatibility concerns. ```c++ // Example C++ code snippet demonstrating initialization of a hypothetical 10Mbps ETH interface void init_10mbps_ethernet() { set_phy_mode(PHY_MODE_10MBPS); configure_cable_type(CABLE_TYPE_TWISTED_PAIR); enable_auto_negotiation(false); // Fixed configuration for simplicity } ```
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值