如何将 dts Linux 设备树源文件编译为 dtb? [英] How to compile dts Linux device tree source files to dtb?

查看:90
本文介绍了如何将 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

希望这有帮助!

这篇关于如何将 dts Linux 设备树源文件编译为 dtb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆