如何更改linux设备树中标签的名称?
我正在构建自己的内核。内核的设备树被修改,因为有自己设计的主板 我可以通过以下方式启用can设备:如何更改linux设备树中标签的名称?,linux,linux-kernel,linux-device-driver,device-tree,Linux,Linux Kernel,Linux Device Driver,Device Tree,我正在构建自己的内核。内核的设备树被修改,因为有自己设计的主板 我可以通过以下方式启用can设备: // here ATMEL is defining the can0 and can1 memory mapped devices #include "sama5d3_can.dtsi" ... can0: can@f000c000 { status = "okay"; }; can1: can@f8010000 { status = "okay"; }; 但
// here ATMEL is defining the can0 and can1 memory mapped devices
#include "sama5d3_can.dtsi"
...
can0: can@f000c000 {
status = "okay";
};
can1: can@f8010000 {
status = "okay";
};
但是现在我想换一下他们的名字。Can0应该成为can1,can1应该是Can0
怎么做?
PS:切换标签和构建内核时打印错误:
| ERROR (duplicate_label): Duplicate label 'can0' on /ahb/apb/can@f8010000 and /ahb/apb/can@f000c000
| ERROR (duplicate_label): Duplicate label 'can1' on /ahb/apb/can@f8010000 and /ahb/apb/can@f000c000
网络“设备”的名称根本不取自DTS。它们从指定给netdevice.name
的名称中获取
在您的情况下,将接口名称明确设置为can%d
(can0
,can1
,…)的调用。然后,分配给每个设备的编号严格取决于硬件的“枚举”顺序及其在at91_can驱动程序中的注册
更改设备树无助于更改网络接口的名称。如果您确实需要更改can接口的名称,您可以这样写。检查sama5d3_can.dtsi在sama5d3_can.dtsi上更改标签没有任何效果。标签是否已被纳入dtb?您希望实现的具体目标是什么?为什么要更改标签?因为它们没有“接管”到dtb,并且在dts中严格用于引用其他节点。节点的名称将保持
can@f000c000
和can@f8010000
。我想通过socketcan使用can。为此,我通过SystemV脚本将can硬件链接到ip。我想更改套接字的名称。我想ip命令可能会从设备树中获取标签