4.11-固件映像包 ( FIP:Firmware Image Package )简介
使用固件映像包 ( FIP ) 允許將引導加載程序映像(以及可能的其他payloads)打包到單個文件中,TF-A 可以從非易失性平臺存儲中加載該文件。從 FIP 加載鏡像的驅動程序已添加到storage層,并允許從支持的平臺storage讀取該package。下面提供并描述了用于創建固件映像包的工具.
4.11.1 固件鏡像包布局(Firmware Image Package layout)
FIP Layout由隨后的payload data的tab表組成(table of contents : ToC)。ToC 本身有一個標題,后跟一個或多個表條目。ToC 由結束標記條目終止,并且由于 ToC 的大小為 0 字節,因此偏移量等于 FIP 文件的總大小。所有 ToC 條目都描述了一些已附加到二進制包末尾的payload data。使用 ToC 條目中提供的信息,可以檢索相應的payload date。
------------------ | ToC Header | |----------------| | ToC Entry 0 | |----------------| | ToC Entry 1 | |----------------| | ToC End Marker | |----------------| | | | Data 0 | | | |----------------| | | | Data 1 | | | ------------------ToC 頭文件和條目格式在頭文件中描述 include/tools_share/firmware_image_package.h。該文件由工具和 TF-A 使用。
ToC 標頭具有以下字段:
`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: ReservedBits 32-47: Platform definedBits 48-63: ReservedToC 條目具有以下字段:
`uuid`: All files are referred to by a pre-defined Universally UniqueIDentifier [UUID] . The UUIDs are defined in`include/tools_share/firmware_image_package.h`. The platform translatesthe requested image name into the corresponding UUID when accessing thepackage. `offset_address`: The offset address at which the corresponding payload datacan 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 固件鏡像包創建工具 --fiptool
源碼 : tools/fiptool
工具的編譯:make [DEBUG=1] [V=1] fiptool
4.11.3 固件映像包 ( FIP )的加載
固件映像包 ( FIP ) 驅動程序可以從非易失性平臺存儲上的二進制包加載映像。
引導加載程序映像根據函數指定的平臺策略加載plat_get_image_source()。 該函數是由平臺廠商來實現的。
個人理解:這里應該是在BL2 調用 plat_get_image_source() 的,在ATF代碼中,有兩處地方會加載這些FIP鏡像。
4.11.4 總結
使用fiptool對部分程序打包成FIP鏡像,存到磁盤中。
開機的時候,在BL2階段會加載這些FIP鏡像。
總結
以上是生活随笔為你收集整理的4.11-固件映像包 ( FIP:Firmware Image Package )简介的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ATF(TF-A)的编译方法
- 下一篇: `Caused by: java.lan