嘉兴品牌网站建设个人开发app最简单方法
fdf的全称叫做flash device file,它用于描述固件在flash中的布局和位置,他可以分为几个部分[Defines],[FD],[FV],[Rule],本文主要介绍如下关键的3个部分:
- FD Section
这个部分需要在起始的地方标注[FD.xxx],一个fdf文件中可以分为多个FD Section。
################################################################################## FD Section# The [FD] Section is made up of the definition statements and a# description of what goes into the Flash Device Image. Each FD section# defines one flash "device" image. A flash device image may be one of# the following: Removable media bootable image (like a boot floppy# image,) an Option ROM image (that would be "flashed" into an add-in# card,) a System "Flash" image (that would be burned into a system's# flash) or an Update ("Capsule") image that will be used to update and# existing system flash.#################################################################################[FD.QcomModule_EFI]BaseAddress = 0x80200000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device.Size = 0x00024000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH DeviceErasePolarity = 1BlockSize = 0x200NumBlocks = 0x120
- FD Region
每个FD的最后都会跟上该FD的区域布局,通过Region Type可以来表示存放在该FD中的内容类型,比如是FV还是DATA,或者是FILE。举例如下:
################################################################################## Following are lists of FD Region layout which correspond to the locations of different# images within the flash device.## Regions must be defined in ascending order and may not overlap.## A Layout Region start with a eight digit hex offset (leading "0x" required) followed by# the pipe "|" character, followed by the size of the region, also in hex with the leading# "0x" characters. Like:# Offset|Size# PcdOffsetCName|PcdSizeCName# RegionType <FV, DATA, or FILE>################################################################################## 512 bytes of configuration header & 8 bytes of image header0x00000000|0x00024000gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|gEmbeddedTokenSpaceGuid.PcdFlashFvMainSizeFV = FVMAIN_COMPACT
这里的FV表示存放在该FD中的FV是什么,本例表示存放的是FVMAIN_COMPACT这个FV,它会在下面进行定义。
- FV(Flash Volume)
该区域定义该FD的布局形势,其中包含很多inf文件,表示的是该FD包含的各个子模块,该区域需要在起始位置标注[FV]如下所示:
################################################################################
#
# FV Section
#
# [FV] section is used to define what components or modules are placed within a flash
# device file. This section also defines order the components and modules are positioned
# within the image. The [FV] section consists of define statements, set statements and
# module statements.
#
################################################################################[FV.FvMain]
BlockSize = 0x40
NumBlocks = 0 # This FV gets compressed so make it just big enough
FvAlignment = 8 # FV alignment and FV attributes setting.
ERASE_POLARITY = 1
MEMORY_MAPPED = TRUE
STICKY_WRITE = TRUE
LOCK_CAP = TRUE
LOCK_STATUS = TRUE
WRITE_DISABLED_CAP = TRUE
WRITE_ENABLED_CAP = TRUE
WRITE_STATUS = TRUE
WRITE_LOCK_CAP = TRUE
WRITE_LOCK_STATUS = TRUE
READ_DISABLED_CAP = TRUE
READ_ENABLED_CAP = TRUE
READ_STATUS = TRUE
READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE
FvNameGuid = 046fae99-cf2e-49ed-a6a8-a1488b7e80d3INF QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf[FV.FVMAIN_COMPACT]FvAlignment = 8ERASE_POLARITY = 1MEMORY_MAPPED = TRUESTICKY_WRITE = TRUELOCK_CAP = TRUELOCK_STATUS = TRUEWRITE_DISABLED_CAP = TRUEWRITE_ENABLED_CAP = TRUEWRITE_STATUS = TRUEWRITE_LOCK_CAP = TRUEWRITE_LOCK_STATUS = TRUEREAD_DISABLED_CAP = TRUEREAD_ENABLED_CAP = TRUEREAD_STATUS = TRUEREAD_LOCK_CAP = TRUEREAD_LOCK_STATUS = TRUEFILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {SECTION FV_IMAGE = FVMAIN}}