最終更新:2024-11-29 (金) 07:05:36 (9d)
デバイスツリー
Top / デバイスツリー
The device tree describes the hardware system such that the kernel can configure itself during boot.
仕様
概要
- Open Firmwareで使われているシステムのデバイス情報を記述するフォーマット
- DTS->DTB
メモ
- The device tree is used both by Open Firmware, and in the standalone Flattened Device Tree (FDT) form.
使い方
Linux/デバイスツリー
- The bootloader loads two binaries: the kernel image and the DTB
- Kernel image remains uImage or zImage
- DTB located in arch/arm/boot/dts, one per board
U-Boot
- The bootloader passes the DTB address through r2.
- bootm <kernel img addr> - <dtb addr>
eLinux.org
- Frank Rowand is a new devicetree maintainer
- Has been updating http://elinux.org/Device_Tree
- http://elinux.org/Device_Tree_presentations_papers_articles
- http://elinux.org/Linux_Drivers_Device_Tree_Guide
対応CPU
Linuxカーネル
- 少なくともLinux 2.6.38以降導入
sysfs
ファイル
DTS - Device Tree Source
- board-level definitions
DTSI? - Device Tree Source for included
- generally containing SoC-level definitions
DTB - Device Tree Blob
- produced by the compiler, and is the binary that gets loaded by the bootloader and parsed by the kernel at boot time.
使う側
- MODULE_DEVICE_TABLE
- of_device_id
- of_device_id.compatible?
コンパイラ
Xilinx
Device Tree Support
- http://wiki.xilinx.com/zynq-linux
- Device tree is a process by which the Linux kernel initializes itself based on the hardware platform. Device tree allows a single kernel image to run on multiple hardware platforms. A device tree file, named *.dts, is a text file that describes the hardware platform. It is compiled into a device tree blob, *.dtb, which is loaded into memory before the Linux kernel is started. The Linux kernel then uses that device tree blob to initialize itself at runtime.
- Device tree is supported and required for the Xilinx ARM kernel. Previously to Linux kernel 3.0, most ARM Linux kernels did not support device tree and were based on platform data. PowerPC and MicroBlaze also use device tree initialization.
MicroBlaze
- The build process for the kernel searches in the arch/microblaze/boot/dts directory for a specified device tree file and then builds the device tree into the kernel image.
.config
- CONFIG_PROC_DEVICETREE?
kernel.org
スライド
Device Tree 入門
関連
LinuxConとかの資料
- http://events.linuxfoundation.org/sites/events/files/slides/dt_debugging.pdf
- https://events.linuxfoundation.org/sites/events/files/slides/petazzoni-device-tree-dummies.pdf
参考
- http://elinux.org/Device_Tree
- http://omappedia.org/wiki/Device_Tree
- http://xillybus.com/tutorials/device-tree-zynq-1
- http://masahir0y.blogspot.jp/2014/05/device-tree.html
- https://www.nxp.com/docs/en/application-note/AN5125.pdf
- https://www.silex.jp/library/blog/20240529-2