设备树配置与编译

编译所有配置的设备树

make dtbs

编译指定的.dts文件

以编译arch/arm/boot/dts/100ask_imx6ull-14x14.dts文件为例,编译后dts文件会变为dtb文件,首先检查dts文件是否配置使能了。

查看arch/arm/boot/dts/Makefile文件,要编译出100ask_imx6ull-14x14.dtb,需要使能CONFIG_SOC_IMX6ULL配置选项:

查看顶层.config文件中配置选项是否使能:

book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$ grep CONFIG_SOC_IMX6ULL .config 
CONFIG_SOC_IMX6ULL=y
book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$

 编译指定dts文件:

book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$ make 100ask_imx6ull-14x14.dtb V=1
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.asm-generic \
            src=asm obj=arch/arm/include/generated/asm
make -f ./scripts/Makefile.asm-generic \
            src=uapi/asm obj=arch/arm/include/generated/uapi/asm
make -f ./scripts/Makefile.build obj=scripts
make -f ./scripts/Makefile.build obj=scripts/dtc
make -f ./scripts/Makefile.build obj=scripts/genksyms
make -f ./scripts/Makefile.build obj=scripts/mod
make -f ./scripts/Makefile.build obj=arch/arm/boot/dts MACHINE= arch/arm/boot/dts/100ask_imx6ull-14x14.dtb

 查看编译目录产生的脚本

当dtb文件被编译过后,编译时的命令会保留在编译目录下:

book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$ ls arch/arm/boot/dts/.*.dtb.cmd
arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.cmd                            arch/arm/boot/dts/.imx6sl-evk-uart.dtb.cmd
arch/arm/boot/dts/.100ask_imx6ull_mini.dtb.cmd                             arch/arm/boot/dts/.imx6sll-evk-btwifi.dtb.cmd
arch/arm/boot/dts/.100ask_myir_imx6ull_mini.dtb.cmd                        
.....省略了多余的行
book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$

 打开编译命令文件,查看一下里面的内容:

book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$ cat arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.cmd
cmd_arch/arm/boot/dts/100ask_imx6ull-14x14.dtb := mkdir -p arch/arm/boot/dts/ ; arm-buildroot-linux-gnueabihf-gcc -E -Wp,-MD,arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.d.pre.tmp -nostdinc -I./arch/arm/boot/dts -I./arch/arm/boot/dts/include -I./drivers/of/testcase-data -undef -D__DTS__ -x assembler-with-cpp -o arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.dts.tmp arch/arm/boot/dts/100ask_imx6ull-14x14.dts ; ./scripts/dtc/dtc -O dtb -o arch/arm/boot/dts/100ask_imx6ull-14x14.dtb -b 0 -i arch/arm/boot/dts/ -Wno-unit_address_vs_reg -d arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.d.dtc.tmp arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.dts.tmp ; cat arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.d.pre.tmp arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.d.dtc.tmp > arch/arm/boot/dts/.100ask_imx6ull-14x14.dtb.d

source_arch/arm/boot/dts/100ask_imx6ull-14x14.dtb := arch/arm/boot/dts/100ask_imx6ull-14x14.dts

deps_arch/arm/boot/dts/100ask_imx6ull-14x14.dtb := \
  arch/arm/boot/dts/include/dt-bindings/input/input.h \
  arch/arm/boot/dts/include/dt-bindings/input/linux-event-codes.h \
  arch/arm/boot/dts/imx6ull.dtsi \
  arch/arm/boot/dts/include/dt-bindings/clock/imx6ul-clock.h \
  arch/arm/boot/dts/include/dt-bindings/gpio/gpio.h \
  arch/arm/boot/dts/include/dt-bindings/interrupt-controller/arm-gic.h \
  arch/arm/boot/dts/include/dt-bindings/interrupt-controller/irq.h \
  arch/arm/boot/dts/imx6ull-pinfunc.h \
  arch/arm/boot/dts/imx6ul-pinfunc.h \
  arch/arm/boot/dts/imx6ull-pinfunc-snvs.h \
  arch/arm/boot/dts/skeleton.dtsi \

arch/arm/boot/dts/100ask_imx6ull-14x14.dtb: $(deps_arch/arm/boot/dts/100ask_imx6ull-14x14.dtb)

$(deps_arch/arm/boot/dts/100ask_imx6ull-14x14.dtb):
book@100ask:~/100ask_imx6ull-sdk/Linux-4.9.88$

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值