我正在使用德州仪器(TI)官方Yocto SDK为Beaglebone X-15(TI AM5728处理器)构建完整的BSP。
整个SDK都非常适合该SDK中的MACHINE = am57xx-evm类型。以后的SDK包括MACHINE = beagle-x15,但是我需要带有Linux内核4.4的旧版本。
此SDK中的Linux内核4.4确实包含beagle-x15设备树片段,但是不存在beagle x15的机器配置,因此我在以后的SDK中包括了新机器的1 conf文件。
问题是设备树无法编译-此回溯中显示了语法问题:
| Error: /home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work-shared/beagle-x15/kernel-source/arch/arm/boot/dts/beagle-x15-cmem.dtsi:1.1-2 syntax error
| FATAL ERROR: Unable to parse input tree
| scripts/Makefile.lib:293: recipe for target 'arch/arm/boot/dts/am57xx-beagle-x15-revc.dtb' failed
| make[3]: *** [arch/arm/boot/dts/am57xx-beagle-x15-revc.dtb] Error 1
| arch/arm/Makefile:333: recipe for target 'am57xx-beagle-x15-revc.dtb' failed
| make[2]: *** [am57xx-beagle-x15-revc.dtb] Error 2
| Makefile:150: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| WARNING: /home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work/beagle_x15-linux-gnueabi/linux-ti-staging/4.4.41+gitAUTOINC+f9f6f0db2d-r7a.arago5.tisdk60/temp/run.do_compile.121513:1 exit 1 from 'exit 1'
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at /home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work/beagle_x15-linux-gnueabi/linux-ti-staging/4.4.41+gitAUTOINC+f9f6f0db2d-r7a.arago5.tisdk60/temp/log.do_compile.121513)
这是无法编译的整个DTSI文件:
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
cmem_block_mem_0: cmem_block_mem@a0000000 {
reg = <0x0 0xa0000000 0x0 0x0c000000>;
no-map;
status = "okay";
};
cmem_block_mem_1_ocmc3: cmem_block_mem@40500000 {
reg = <0x0 0x40500000 0x0 0x100000>;
no-map;
status = "okay";
};
};
cmem {
compatible = "ti,cmem";
#address-cells = <1>;
#size-cells = <0>;
#pool-size-cells = <2>;
status = "okay";
cmem_block_0: cmem_block@0 {
reg = <0>;
memory-region = <&cmem_block_mem_0>;
cmem-buf-pools = <1 0x0 0x0c000000>;
};
cmem_block_1: cmem_block@1 {
reg = <1>;
memory-region = <&cmem_block_mem_1_ocmc3>;
};
};
};
这是beagle-x15.conf文件:
#@TYPE: Machine
#@NAME: BeagleBoard X15
#@DESCRIPTION: Machine configuration for the BeagleBoard X15
require conf/machine/include/dra7xx.inc
KERNEL_DEVICETREE = "am57xx-beagle-x15.dtb am57xx-beagle-x15-revb1.dtb am57xx-beagle-x15-revc.dtb"
MACHINE_GUI_CLASS = "bigscreen"
SERIAL_CONSOLE = "115200 ttyS2"
UBOOT_MACHINE = "am57xx_evm_config"
WKS_FILE = "sdimage-bootpart.wks"
IMAGE_BOOT_FILES = "MLO u-boot.img"
IMAGE_FSTYPES += "tar.xz wic.xz"
do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
# UBI information. Note that this is board and kernel specific. Changes
# in your kernel port may require changes in these variables. For more
# details about this board please see
# http://processors.wiki.ti.com/index.php/UBIFS_Support
# do ubiattach /dev/ubi_ctrl -m 7 -O 2048
# From dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: logical eraseblock size: 126976 bytes
# from ubiattach stdout:
# UBI device number 0, total 1988 LEBs
MKUBIFS_ARGS = "-F -m 2048 -e 126976 -c 8192"
# do ubiattach /dev/ubi_ctrl -m 7 -O 2048
# from dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: physical eraseblock size: 131072 bytes (128 KiB)
# UBI: sub-page size: 512
# UBI: VID header offset: 2048 (aligned 2048)
UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512 -O 2048"
如何获取此DTSI文件进行编译?谢谢。
更新:事实证明Ubuntu DTC编译器也失败了(1.4版):
dtc -O dtb -o /home/user/Desktop/test.dtb /home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work-shared/beagle-x15/kernel-source/arch/arm/boot/dts/beagle-x15-cmem.dtsi
Error: /home/user/tisdk/build/arago-tmp-external-linaro-toolchain/work-shared/beagle-x15/kernel-source/arch/arm/boot/dts/beagle-x15-cmem.dtsi:1.1-2 syntax error
FATAL ERROR: Unable to parse input tree
答案 0 :(得分:2)
dtc编译器会将设备树版本视为0。版本0的语法与版本1不同。因此,您需要添加
/dts-v1/;
作为设备树文件的第一行。
除此以外,通常您需要直接编译.dts
文件,而不是直接编译.dtsi
(包含在内)。因此,您需要定义扩展名为.dts
的设备树文件,包括.dtsi
个文件。