如何将DTS Linux设备树源文件编译为DTB?

如何将DTS Linux设备树源文件编译为DTB?

问题描述:

我有一个设备树文件(.dts),我想为基于Powerpc的主板编译该文件.

I have a device tree file (.dts) and I want to compile the file for my powerpc based board.

如何在不基于Powerpc的计算机上执行此操作?我可以在Ubuntu系统上安装DTC吗?还是更像是使用单独的编译器并传递ARCH信息(例如使用工具链)?

How can I do it on my machine, which is not powerpc based?? Can I do it with the DTC installed on my Ubuntu system? Or will it be more like using a separate compiler and passing ARCH information (like using a toolchain)?

不需要使用具有体系结构意识"的工具来编译设备树.您的ubuntu机器上的dtc编译器可能是最新的,足以编译您的设备树.或者,您可以下载最新的源代码并自己编译. dtc编译器可以在这里找到:

Device trees do not need to be compiled with "architecture-aware" tools. The dtc compiler on your ubuntu machine is probably current enough to compile your device tree. Or you can download the latest source and compile it yourself. The dtc compiler can be found here:

https://git.kernel.org/pub/scm/utils/dtc/dtc.git

该软件包中有一些不错的文档,可以帮助您总体上更好地了解设备树.

There are some good documents in that package that will help you better understand device trees in general.

编译(和分解)设备树非常容易.例如

It's pretty easy to compile (and disassemble) device trees. For example

$ dtc -O dtb -o p4080ds.dtb p4080ds.dts

要从设备树blob中获取文本形式的设备树,请执行以下操作:

To get the device tree in text from from the device tree blob, do this:

$ dtc -I dtb -O dts p4080ds.dtb

希望这会有所帮助!