![]() |
xilpdi
Vitis Drivers API Documentation
|
Functions | |
| int | XilPdi_ValidateChecksum (const void *Buffer, u32 Length) |
| This function is used to validate the word checksum for the Image Header table and Partition Headers. More... | |
| int | XilPdi_ValidateImgHdrTbl (const XilPdi_ImgHdrTbl *ImgHdrTbl) |
| This function checks the fields of the Image Header Table and validates them. More... | |
| int | XilPdi_ValidatePrtnHdr (const XilPdi_PrtnHdr *PrtnHdr) |
| This function validates the Partition Header. More... | |
| void | XilPdi_ReadBootHdr (const XilPdi_BootHdr **BootHdrPtr) |
| This function reads the boot header. More... | |
| int | XilPdi_ReadImgHdrTbl (XilPdi_MetaHdr *MetaHdrPtr) |
| This function Reads the Image Header Table. More... | |
| int | XilPdi_ReadIhtAndOptionalData (XilPdi_MetaHdr *MetaHdrPtr, u8 PdiType) |
| This function reads IHT and optional data in Image Header Table. More... | |
| int | XilPdi_ReadOptionalData (XilPdi_MetaHdr *MetaHdrPtr, u8 PdiType) |
| This function reads optional data in Image Header Table. More... | |
| int | XilPdi_StoreDigestTable (XilPdi_MetaHdr *MetaHdrPtr) |
| This function stores digest table for given data Id. More... | |
| u64 | XilPdi_SearchOptionalData (u64 StartAddress, u64 EndAddress, u32 DataId) |
| This function search offset of optional data address. More... | |
| XilPdi_PrtnHashInfo * | XilPdi_IsPrtnHashPresent (u32 PrtnNum, u32 HashTableSize) |
| This function checks if partition hash is present. More... | |
| int | XilPdi_ReadImgHdrs (const XilPdi_MetaHdr *MetaHdrPtr) |
| This function reads the Image Headers. More... | |
| int | XilPdi_ReadPrtnHdrs (const XilPdi_MetaHdr *MetaHdrPtr) |
| This function reads the Partition Headers. More... | |
| int | XilPdi_VerifyPrtnHdrs (const XilPdi_MetaHdr *MetaHdrPtr) |
| This function verifies Partition Headers. More... | |
| int | XilPdi_VerifyImgHdrs (const XilPdi_MetaHdr *MetaHdrPtr) |
| This function verifies Image headers. More... | |
| XilPdi_PrtnHashInfo* XilPdi_IsPrtnHashPresent | ( | u32 | PrtnNum, |
| u32 | HashTableSize | ||
| ) |
This function checks if partition hash is present.
| PrtnNum | PrtnNum to check partition hash is present or not |
| HashTableSize | Size of hash table |
References XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR.
| void XilPdi_ReadBootHdr | ( | const XilPdi_BootHdr ** | BootHdrPtr | ) |
This function reads the boot header.
| BootHdrPtr | is pointer to the address of Boot Header |
References XIH_BH_PRAM_ADDR.
| int XilPdi_ReadIhtAndOptionalData | ( | XilPdi_MetaHdr * | MetaHdrPtr, |
| u8 | PdiType | ||
| ) |
This function reads IHT and optional data in Image Header Table.
| MetaHdrPtr | is pointer to MetaHeader table. |
Clear 2KB PMC RAM which is allocated to store IHT OPTIONAL DATA
References XilPdi_MetaHdr::ImgHdrTbl, XIH_IHT_LEN, XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR, and XilPdi_ReadOptionalData().
| int XilPdi_ReadImgHdrs | ( | const XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function reads the Image Headers.
| MetaHdrPtr | is pointer to Meta Header |
References XilPdi_MetaHdr::DeviceCopy, XilPdi_MetaHdr::FlashOfstAddr, XilPdi_MetaHdr::ImgHdr, XilPdi_ImgHdrTbl::ImgHdrAddr, XilPdi_MetaHdr::ImgHdrTbl, and XilPdi_ImgHdrTbl::NoOfImgs.
| int XilPdi_ReadImgHdrTbl | ( | XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function Reads the Image Header Table.
| MetaHdrPtr | is pointer to MetaHeader table |
References XilPdi_MetaHdr::DeviceCopy, XilPdi_MetaHdr::FlashOfstAddr, XilPdi_MetaHdr::ImgHdrTbl, XilPdi_MetaHdr::MetaHdrOfst, SMAP_BUS_WIDTH_LENGTH, and XIH_IHT_LEN.
| int XilPdi_ReadOptionalData | ( | XilPdi_MetaHdr * | MetaHdrPtr, |
| u8 | PdiType | ||
| ) |
This function reads optional data in Image Header Table.
| MetaHdrPtr | is pointer to MetaHeader table. |
| PdiType | is PDI type |
References XilPdi_MetaHdr::DeviceCopy, XilPdi_MetaHdr::FlashOfstAddr, XilPdi_MetaHdr::ImgHdrTbl, XilPdi_MetaHdr::MetaHdrOfst, XilPdi_ImgHdrTbl::OptionalDataLen, SMAP_BUS_WIDTH_LENGTH, XIH_IHT_LEN, and XILPDI_OPTIONAL_DATA_MAX_SIZE_16K_BYTES.
Referenced by XilPdi_ReadIhtAndOptionalData().
| int XilPdi_ReadPrtnHdrs | ( | const XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function reads the Partition Headers.
| MetaHdrPtr | is pointer to Meta Header |
References XilPdi_MetaHdr::DeviceCopy, XilPdi_MetaHdr::FlashOfstAddr, XilPdi_MetaHdr::ImgHdrTbl, XilPdi_ImgHdrTbl::NoOfPrtns, XilPdi_MetaHdr::PrtnHdr, and XilPdi_ImgHdrTbl::PrtnHdrAddr.
| u64 XilPdi_SearchOptionalData | ( | u64 | StartAddress, |
| u64 | EndAddress, | ||
| u32 | DataId | ||
| ) |
This function search offset of optional data address.
| StartAddress | is start address of IHT optional data |
| EndAddress | is end address of IHT optional data |
| DataId | is to identify type of data in data structure |
Referenced by XilPdi_StoreDigestTable().
| int XilPdi_StoreDigestTable | ( | XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function stores digest table for given data Id.
| MetaHdrPtr | is pointer to MetaHeader table. |
IHT Optional data format: ------------------------------------------------------------------------- | 0x00 | Size (31:16) | Data Id (15:0) | ------------------------------------------------------------------------- | 0x04 | Data (Size in words) | ------------------------------------------------------------------------- | Last | Checksum (Sum of previous words in DS) | ------------------------------------------------------------------------- DigestTableSize is size of Data except first(0x00) and last word(Last)
Verify checksum of data structure info
Copy only data part
References XilPdi_MetaHdr::DigestTableSize, XilPdi_MetaHdr::ImgHdrTbl, XilPdi_MetaHdr::IsAuthOptimized, XilPdi_ImgHdrTbl::OptionalDataLen, XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR, XILPDI_OPTIONAL_DATA_WORD_LEN, XILPDI_PARTITION_HASH_DATA_ID, XilPdi_SearchOptionalData(), and XilPdi_ValidateChecksum().
| int XilPdi_ValidateChecksum | ( | const void * | Buffer, |
| u32 | Length | ||
| ) |
This function is used to validate the word checksum for the Image Header table and Partition Headers.
Checksum is based on the below formula
Checksum = ~(X1 + X2 + X3 + .... + Xn)
| Buffer | pointer for the data words |
| Length | of the buffer for which checksum should be calculated. Last word is taken as expected checksum. |
References XILPDI_CHECKSUM_MIN_BUF_LEN, and XILPDI_INVERT_CHECKSUM.
Referenced by XilPdi_StoreDigestTable(), XilPdi_ValidateImgHdrTbl(), XilPdi_VerifyImgHdrs(), and XilPdi_VerifyPrtnHdrs().
| int XilPdi_ValidateImgHdrTbl | ( | const XilPdi_ImgHdrTbl * | ImgHdrTbl | ) |
This function checks the fields of the Image Header Table and validates them.
Image Header Table contains the fields that are common across all the partitions and images.
| ImgHdrTbl | pointer to the Image Header Table |
References XilPdi_ImgHdrTbl::NoOfImgs, XilPdi_ImgHdrTbl::NoOfPrtns, XIH_IHT_LEN, XILPDI_ERR_IHT_CHECKSUM, and XilPdi_ValidateChecksum().
| int XilPdi_ValidatePrtnHdr | ( | const XilPdi_PrtnHdr * | PrtnHdr | ) |
This function validates the Partition Header.
| PrtnHdr | is pointer to Partition Header |
References XilPdi_PrtnHdr::EncDataWordLen, XilPdi_PrtnHdr::TotalDataWordLen, XilPdi_PrtnHdr::UnEncDataWordLen, and XIH_PH_ATTRB_PRTN_TYPE_RSVD.
| int XilPdi_VerifyImgHdrs | ( | const XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function verifies Image headers.
| MetaHdrPtr | is pointer to MetaHeader table. |
References XilPdi_MetaHdr::ImgHdr, XilPdi_MetaHdr::ImgHdrTbl, XilPdi_ImgHdrTbl::NoOfImgs, and XilPdi_ValidateChecksum().
| int XilPdi_VerifyPrtnHdrs | ( | const XilPdi_MetaHdr * | MetaHdrPtr | ) |
This function verifies Partition Headers.
| MetaHdrPtr | is pointer to MetaHeader table |
References XilPdi_MetaHdr::ImgHdrTbl, XilPdi_ImgHdrTbl::NoOfPrtns, XilPdi_MetaHdr::PrtnHdr, and XilPdi_ValidateChecksum().