接前一篇文章Linux网络驱动之Fixed-Link2本文内容参考linux phy fixed-link-CSDN博客fixed-link 网口驱动设备树-CSDN博客GMAC网卡Fixed-Link模式 - StepForwards - 博客园RTL8367RB的国产P2P替代方案用JL6107-PC的可行性及实现方法-CSDN博客fixed-link 网口驱动设备树-CSDN博客设备树 fixed-link 使用说明-CSDN博客特此致谢三、深入了解3. 设备树中Fixed-Link项的详细解析上一回给出了Fixed-link核心定义以及设备树中Fixed-Link的写法。再来回顾一下甭管是新写法还是老写法规则都是一个规则。下边就来看一下Linux内核对于设备树中Fixed-Link相关的说明Fixed link Device Tree binding ------------------------------ Some Ethernet MACs have a fixed link, and are not connected to a normal MDIO-managed PHY device. For those situations, a Device Tree binding allows to describe a fixed link. Such a fixed link situation is described by creating a fixed-link sub-node of the Ethernet MAC device node, with the following properties: * speed (integer, mandatory), to indicate the link speed. Accepted values are 10, 100 and 1000 * full-duplex (boolean, optional), to indicate that full duplex is used. When absent, half duplex is assumed. * pause (boolean, optional), to indicate that pause should be enabled. * asym-pause (boolean, optional), to indicate that asym_pause should be enabled. * link-gpios (gpio-list, optional), to indicate if a gpio can be read to determine if the link is up. Old, deprecated fixed-link binding: * A fixed-link property in the Ethernet MAC node, with 5 cells, of the form a b c d e with the following accepted values: - a: emulated PHY ID, choose any but but unique to the all specified fixed-links, from 0 to 31 - b: duplex configuration: 0 for half duplex, 1 for full duplex - c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000 - d: pause configuration: 0 for no pause, 1 for pause - e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for asymmetric pause Examples: ethernet0 { ... fixed-link { speed 1000; full-duplex; }; ... }; ethernet1 { ... fixed-link { speed 1000; pause; link-gpios gpio0 12 GPIO_ACTIVE_HIGH; }; ... };中文翻译如下逐段1第1段固定链接Fixed link设备树绑定------------------------------某些以太网MAC具有“固定链接”并且未连接到普通的MDIO管理的PHY设备。对于此类情况设备树绑定允许描述“固定链接”。2第2段通过创建“fixed-link”以太网MAC设备结点的子结点来描述这种固定链接情况该子结点具有以下属性speed整数必填表示链接速度。可接受值为10、100和1000。全双工布尔值可选表示全双工被使用。如果未指定则假定为半双工。pause布尔值可选表示是否启用pause暂停流控。asym-pause布尔值可选表示是否启用asym_pause非对称暂停流控。link-gpiosgpio-list可选指示是否可以通过读取gpio以确定链接是否正常。3第3段旧的已弃用的“fixed-link”绑定以太网MAC节点中具有5个单元的“固定链接”属性格式为a b c d e具有以下可接受的值a模拟PHY ID可以从0到31中选择任何一个但对所有指定的固定链路都是唯一的b双工配置半双工为0、全双工为1c链接速度以Mbits /秒为单位可接受的值为10、100和1000d暂停配置0表示不暂停、1表示暂停e非对称暂停配置0表示没有非对称暂停、1表示非对称暂停4第4段示例代码就无需翻译了。至此设备树中的“fixed-link”就基本讲清楚了。更多内容请看下回。