__fixups__ {
ocp = "/fragment@0:target:0";
intc = "/fragment@0/__overlay__/tscadc:interrupt-parent:0";
};
};
BB-ADC-00A0.dts原文是这样的
[cpp]view plaincopyprint?
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
test_helper: helper {
compatible = "bone-iio-helper";
vsense-name = "AIN0", "AIN1", "AIN2", "AIN3", "AIN4", "AIN5", "AIN6", "AIN7";
vsense-scale = <100 100 100 100 100 100 100 100>;
status = "okay";
};
};
};
};
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
二者区别请自行比对。
当我想把dts文件转换成dtbo文件时,出现了错误。
[plain]view plaincopyprint?
root@beaglebone:~/tmp# dtc -I dts -O dtb BB-ADC-00A0.dts
ERROR (phandle_references): Reference to non-existent node or label "ocp"
ERROR (phandle_references): Reference to non-existent node or label "intc"
ERROR: Input tree has errors, aborting (use -f to force output)
root@beaglebone:~/tmp# dtc -I dts -O dtb BB-ADC-00A0.dts
ERROR (phandle_references): Reference to non-existent node or label "ocp"
ERROR (phandle_references): Reference to non-existent node or label "intc"
ERROR: Input tree has errors, aborting (use -f to force output)
(加上 -f 也是没有用的)但如果加上 -@ ,就可以顺利输出了。这就是device tree overlay和原生device tree的不同吧——device tree(比如/boot目录里那些dtb文件反编译出来的dts文件)都是包含从根节点到每个子节点的全部信息的。而device tree overlay(比如/lib/firmware目录中的那些)只需要包含要修改的内容即可。至于后缀名dtbo和dtb,似乎单纯是为了区分二者,内容格式其实都是一样的,都可以用dtc命令反编译成dts文件