当前位置:网站首页>4.11 introduction to firmware image package

4.11 introduction to firmware image package

2022-06-13 02:11:00 Code changes the world CTW

Use firmware image ( FIP ) Allow boot loader images ( And maybe something else payloads) Package into a single file ,TF-A The file can be loaded from the nonvolatile platform storage . from FIP The driver that loads the image has been added to storage layer , And allow from supported platforms storage Read the package. The following provides and describes tools for creating firmware images .

4.11.1 Firmware image package layout (Firmware Image Package layout)

FIP Layout By subsequent payload data Of tab The composition of the watch (table of contents : ToC).ToC It has a title , Followed by one or more table entries .ToC Terminated by an end tag entry , And because of ToC The size is 0 byte , So the offset is equal to FIP Total file size . all ToC Entries describe some of the that have been appended to end of the binary package payload data. Use ToC Information provided in the entry , The corresponding payload date.

------------------
| ToC Header     |
|----------------|
| ToC Entry 0    |
|----------------|
| ToC Entry 1    |
|----------------|
| ToC End Marker |
|----------------|
|                |
|     Data 0     |
|                |
|----------------|
|                |
|     Data 1     |
|                |
------------------

ToC The header file and the entry format are described in the header file include/tools_share/firmware_image_package.h. This file consists of tools and TF-A Use .

ToC The header has the following fields :

`name`: The name of the ToC. This is currently used to validate the header.
`serial_number`: A non-zero number provided by the creation tool
`flags`: Flags associated with this data.
    Bits 0-31: Reserved
    Bits 32-47: Platform defined
    Bits 48-63: Reserved

ToC The entry has the following fields :

`uuid`: All files are referred to by a pre-defined Universally Unique
    IDentifier [UUID] . The UUIDs are defined in
    `include/tools_share/firmware_image_package.h`. The platform translates
    the requested image name into the corresponding UUID when accessing the
    package.
`offset_address`: The offset address at which the corresponding payload data
    can be found. The offset is calculated from the ToC base address.
`size`: The size of the corresponding payload data in bytes.
`flags`: Flags associated with this entry. None are yet defined.

4.11.2 Firmware image package creation tool --fiptool

Source code : tools/fiptool

Compilation of tools :make [DEBUG=1] [V=1] fiptool

 Insert picture description here

4.11.3 Firmware image ( FIP ) Loading

Firmware image ( FIP ) The driver can load images from binary packages on non-volatile platform storage .

The boot loader image is loaded according to the platform policy specified by the function plat_get_image_source(). This function is implemented by the platform vendor .

Personal understanding : This should be in BL2 call plat_get_image_source() Of , stay ATF In the code , There are two places to load these FIP Mirror image .
 Insert picture description here
 Insert picture description here

4.11.4 summary

Use fiptool Package some programs into FIP Mirror image , Save to disk .
When the machine is turned on , stay BL2 The stage will load these FIP Mirror image .

原网站

版权声明
本文为[Code changes the world CTW]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280546270642.html