ARM-LINUX基础
+ -

设备树

2025-08-07 1 0
  • DTS:原始的设备树文件,扩展名为dts,dts文件也可以有头文件,dtsi
  • DTC:设备树文件编译工具
  • DTB:DTS经过DTC编译后的文件

编译设备树

make dtbs  //编译aarch\arm\boot\dts下所有设备树

make all是编计的事情有的东西,包括zImage,ko,当然也包括dtb

编译指定设备树

make xxxx.dtb //这里是dtb输出名

编译设备树的工具dtc源代码:

linux-imx-4.1.15-2.1.0-g3dc0a4b-v2.7.tar\scripts\dtc

设备树路径

内核启动的时候会解析设树,然后会在/proc/device-tree中显示

root@ATK-IMX6U:/proc/device-tree# ll
total 0
-r--r--r--  1 root root  4 Dec  4 12:32 '#address-cells'
drwxr-xr-x  2 root root  0 Dec  4 12:32 aliases/
drwxr-xr-x  2 root root  0 Dec  4 12:32 backlight/
drwxr-xr-x  2 root root  0 Dec  4 12:32 chosen/
drwxr-xr-x  6 root root  0 Dec  4 12:32 clocks/
-r--r--r--  1 root root 34 Dec  4 12:32 compatible
drwxr-xr-x  3 root root  0 Dec  4 12:32 cpus/
drwxr-xr-x  2 root root  0 Dec  4 12:32 dht11/
drwxr-xr-x  2 root root  0 Dec  4 12:32 ds18b20/
drwxr-xr-x  3 root root  0 Dec  4 12:32 'gpio_keys@0'/
drwxr-xr-x  2 root root  0 Dec  4 12:32 'interrupt-controller@00a01000'/
drwxr-xr-x  4 root root  0 Dec  4 12:32 leds/
drwxr-xr-x  2 root root  0 Dec  4 12:32 memory/
-r--r--r--  1 root root 36 Dec  4 12:32 model
-r--r--r--  1 root root  1 Dec  4 12:32 name
drwxr-xr-x  2 root root  0 Dec  4 12:32 pxp_v4l2/
drwxr-xr-x  5 root root  0 Dec  4 12:32 regulators/
drwxr-xr-x  3 root root  0 Dec  4 12:32 reserved-memory/
drwxr-xr-x  2 root root  0 Dec  4 12:32 sii902x-reset/
-r--r--r--  1 root root  4 Dec  4 12:32 '#size-cells'
drwxr-xr-x 12 root root  0 Dec  4 12:32 soc/
drwxr-xr-x  2 root root  0 Dec  4 12:32 sound/
drwxr-xr-x  3 root root  0 Dec  4 12:32 spi4/

节说明

aliases:别名,会在/dev/下显示设备

0 篇笔记 写笔记

关注公众号
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!