LXR | KVM | PM | Time | Interrupt | Systems Performance | Bootup Optimization

基于现有dtb文件修改内容

 当有修改dtb需要,又不想经过linux编译生成dtb时,可以通过dtc工具进行dtb->dts,dts->dtb的转换。

dtc工具可以进行dtb和dts之间的转换,dts是可编辑文本。
Ubuntu下安装dtc工具:
sudo apt-get install device-tree-compiler

1 dtc将dtb反编译为dts

dtc -I dtb -O dts xxx.dtb -o yyy.dts

2 编辑dts文件

编辑dts文件。

3 dtc将dts编译为dtb

dtc -I dts -O dtb yyy.dts -o zzz.dtb

4 验证修改

为了验证修改后的的dtb文件,可以将对dtb文件打印查看修改内容。
dtc -I dtb -O dts zzz.dtb

5 dtc使用

复制代码
Usage: dtc [options] <input file>

Options: -[qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv]
  -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
        yaml - device tree encoded as YAML
        asm - assembler source
  -V, --out-version <arg>    
    Blob version to produce, defaults to 17 (for dtb and asm output)
  -d, --out-dependency <arg> 
    Output dependency file
复制代码

 

posted on   ArnoldLu  阅读(993)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
历史上的今天:
2020-10-06 《Linux/UNIX系统编程手册》第24章 进程的创建

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示