uboot的FIT功能

别人的解释,特别清晰:

u-boot FIT image介绍1. 前言 Linux kernel在ARM架构中引入device tree(全称是flattened device tree,后续将会以FDT代称)的时候[1],其实怀揣了一....http://www.wowotech.net/u-boot/fit_image_overview.htmlgit上对于FIT的说明文档:

doc/uImage.FIT/source_file_format.txthttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/source_file_format.txtdoc/uImage.FIT/howto.txthttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/howto.txtdoc/uImage.FIT/kernel.itshttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/kernel.itsdoc/uImage.FIT/kernel_fdt.itshttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/kernel_fdt.itsdoc/uImage.FIT/multi.itshttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/multi.its      在官方手册中,将最终生成的、包含了设备树、内核、根文件系统(ramdisk,只有ramdisk才可以被包含在这里,因为普通的根文件系统是在物理磁盘内的,不需要在uboot阶段load进DDR中)的.itb文件称为《new uImage》,原话为<Resulting .itb file is the actual binary of a new uImage>,可以看到,.itb文件就是对旧的uImage的一种新的,集成度更高的镜像。

1 生成命令

       利用mkimage命令生成.itb文件。类似于生成.dtb文件需要.dts文件一样,生成.itb文件也需要一个.its配置文件,在.its文件中对zImage、xxx.dts、rootFs.tar.gz的结构,加载地址,加载方式等信息进行配置。

        命令:

        mkimage -f xxx.its xxx.itb

        注意,zImage xxx.dts rootFs.tar.gz必须与xxx.its在同一个目录下。

2 内容格式

/*dts的版本*/
/dts-v1/;

/*根节点*/
/{
    description = "this is itb file root node!";
    /*
        images节点: 
        这是一个内置的节点
        mkimage工具从configurations节点读出的配置信息全部要从images节点内获取
    */
    images {

            kernel@1 {
                    description = "linux-5.x.xx";
                    data = /incbin/("./zImage");
                    type = "kernel";
                    arch = "arm";
                    os = "linux";
                    compression = "none";
                    load = <0x8200000>;
                    entry = <0x8200000>;
                    
                    hash-1 {
                            algo = "sha1";
                    };
                    
            };
            
            fdt@1 {
                    description = "dtb";
                    data = /incbin/("./xxxx.dtb");
                    type = "flat_dt";
                    arch = "arm";
                    os = "linux";
                    compression = "none";
                    load = <0x8300000>;    
                
                    hash-1 {
                            algo = "sha1";
                    };
            };

    };
    
    /*
        configurations节点:
        这是一个内置节点
        u-boot根据此节点内的信息引导内核,加载设备树等操作
    */
    configurations{
                    /*default属性告诉uboot默认使用config@1配置*/
                    default = "config@1";
                    config@1 {
                                description = "config1";
                                kernel = "kernel@1";
                                fdt = "fdt@1";
                    };
                    
    };

};

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值