デバイスツリー学習ノート1

5511 ワード


コンパイルによって生成されたデバイスツリーの内容を表示するにはどうすればいいですか?


デバイスツリー学習では,最終的に生成されたデバイスツリーの内容が見られると,デバイスツリーの学習や問題の解析に大きく役立つ.ここでは、デバイスツリー生成ツールdtcの逆コンパイル機能を使用する必要があります.
root@pengdl-VirtualBox:~/tq2440/Linux/linux-4.0.1# ./scripts/dtc/dtc -h Usage: dtc [options] <input file> Options: -[qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv] -q, --quiet Quiet: -q suppress warnings, -qq errors, -qqq all -I, --in-format <arg> Input formats are: dts - device tree source text dtb - device tree blob fs - /proc/device-tree style directory -o, --out <arg> Output file -O, --out-format <arg> Output formats are: dts - device tree source text dtb - device tree blob asm - assembler source -V, --out-version <arg> Blob version to produce, defaults to %d (for dtb and asm output) -d, --out-dependency <arg> Output dependency file
  -R, --reserve <arg> tMake space for <number> reserve map entries (for dtb and asm output) -S, --space <arg> Make the blob at least <bytes> long (extra space) -p, --pad <arg> Add padding to the blob of <bytes> long (extra space) -b, --boot-cpu <arg> Set the physical boot cpu -f, --force Try to produce output even if the input tree has errors -i, --include <arg> Add a path to search for include files -s, --sort Sort nodes and properties before outputting (useful for comparing trees) -H, --phandle <arg> Valid phandle formats are: legacy - "linux,phandle" properties only epapr - "phandle" properties only both - Both "linux,phandle" and "phandle" properties -W, --warning <arg> Enable/disable warnings (prefix with "no-") -E, --error <arg> Enable/disable errors (prefix with "no-") -h, --help Print this help and exit -v, --version Print version and exit

最終的なデバイスツリーファイルはarch/arm/boot/dts/s 3 c 2416-smdk 2416と仮定する.dtb
./scripts/dtc/dtc -I dtb -O dts -o output.dts arch/arm/boot/dts/s3c2416-smdk2416.dtb

出力ファイルdtsは逆アセンブリの結果であり,実際に生成されたデバイスツリーである.

Linux構成、デバイスツリーのサポート

make menuconfig ---> Boot options ---> Flattened Device Tree support

Linuxコンパイルデバイスツリー


arch/arm/boot/dts/Makefileで必要なデバイスツリーのdtbファイルが構成されているかどうかを確認できます.
make dtbs

 
 
 
 
 
 
 
 
 
 
 
 
==