欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

设备树 fixed-link 使用说明

程序员文章站 2024-01-23 14:58:34
...
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:

[email protected] {
	...
	fixed-link {
	      speed = <1000>;
	      full-duplex;
	};
	...
};

[email protected] {
	...
	fixed-link {
	      speed = <1000>;
	      pause;
	      link-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
	};
	...
};

以下内容是
谷歌翻译:

固定链接设备树绑定
------------------------------

某些以太网MAC具有“固定链接”,并且未连接到
普通的MDIO管理的PHY设备。对于那些情况,设备树
绑定允许描述“固定链接”。

通过创建“固定链接”来描述这种固定链接情况
以太网MAC设备节点的子节点,具有以下内容
特性:

*'speed'(整数,必填),表示链接速度。公认
  值是10、100和1000
*'全双工'(布尔值,可选),表示全双工是
  用过的。如果不存在,则假定为半双工。
*'pause'(布尔值,可选),表示应该暂停
  已启用。
*'asym-pause'(布尔值,可选),指示asym_pause应该
  被启用。
*'link-gpios''gpio-list',可选),指示是否可以读取gpio
  确定链接是否正常。

旧的,已弃用的“固定链接”绑定:

*以太网MAC节点中具有5个单元的“固定链接”属性
  格式为<a b c d e>并具有以下可接受的值:
  -a:模拟的PHY ID,为所有指定的唯一但唯一的选择
    固定链接,从0到31
  -b:双工配置:半双工为0,全双工为1
  -c:链接速度(以Mbits /秒为单位),可接受的值为:10、100和1000
  -d:暂停配置:0表示不暂停,1表示暂停
  -e:非对称暂停配置:0表示没有非对称暂停,1表示
    不对称的暂停

例子:

ethernet @ 0 {
...
固定链接{
速度= <1000>;
全双工;
};
...
};

ethernet @ 1 {
...
固定链接{
速度= <1000>;
暂停;
link-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
...
};
相关标签: Linux 设备树