代码之家  ›  专栏  ›  技术社区  ›  PhilBot

Linux内核DTSI文件无法从Yocto编译BeagleBone

  •  0
  • PhilBot  · 技术社区  · 6 年前

    我正在使用德州仪器官方yoctosdk为Beaglebone X-15(tiam5728处理器)构建一个完整的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"
    

    更新:原来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
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   Parthiban    6 年前

    默认情况下,如果未指定版本,dtc编译器将设备树版本视为0。版本0的语法与版本1不同。所以你需要补充一下,

    /dts-v1/;
    

    作为设备树文件的第一行。

    除此之外,通常需要编译 .dts .dtsi (包括)直接。所以需要根据设备树文件 .数据传输服务 扩展包括 文件夹。

    推荐文章