我正在尝试理解DTS文件中的以下代码片段。
/dts-v1/;
/ {
model = "MPC8313ERDB";
compatible = "MPC8313ERDB", "MPC831xRDB", "MPC83xxRDB";
#address-cells = <1>;
#size-cells = <1>;
aliases {
ethernet0 = &enet0;
serial0 = &serial0;
serial1 = &serial1;
pci0 = &pci0;
};别名部分是做什么的?
我的理解如下。
对于ethernet0,我们可以使用enet0。
但是为什么是serial0=&serial0呢?
和serial1 =&序列1
有谁能简要介绍一下吗?
谢谢。
发布于 2013-07-19 18:23:48
在DTS的aliases部分,我们可以看到以下格式的条目
property = &label;
每个条目由以下内容组成:
a. property --这里定义的新的属性。
b. &label -- 指向label引用的node的完整DTS路径。
它基本上将b的值赋给a。此后,可以使用简写property访问由label标识的节点的长名称。
请注意,此赋值的RHS使用的是labels和,而不是各个节点的短名称。就像C代码中的label引用定义它的行上的指令一样,DTS中的label引用该行上定义的单个节点(使用其完整的长路径)。
例如,考虑以下DTS,
lxr.free-electrons.com/source/arch/powerpc/boot/dts/mpc8313erdb.dts
其aliases部分由以下内容组成:
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 };新定义的属性(LHS)
ethernet0 ethernet1 serial0 serial1 pci0请参阅相应的标签(RHS)
enet0 enet1 serial0 serial1 pci0例如,属性ethernet0现在设置为"/soc8313@e0000000/ethernet@24000",即在the line where the label enet0 is defined上定义的节点。
更新:
ethernet0、serial0 ... ?定义别名
Linux源:
- Further down the line, the developer intends to access these nodes in the kernel source code. Once an **alias** is defined in the DTS, a **handle to the node it is referring to** is obtained by simply searching for it in the `aliases` section rather than searching for it in the entire DTS.内核源中的函数。
pci0节点不是soc8313节点下的?- On MPC8313, the **PCI** and **DMA** blocks are interfaced via the IO-Sequencer(IOS). Hence the special treatment as compared to the other blocks (ethernet, I2C, UART) that are connected directly to the system bus.
https://stackoverflow.com/questions/17738709
复制相似问题