lib/sw_apps/zynqmp_fsbl/src/xfsbl_partition_load.c
static u8 XFsbl_GetPcrIndex(const XFsblPs * FsblInstancePtr, u32 PartitionNum)
{
	u8 PcrIndex = 0U;
	const XFsblPs_PartitionHeader * PartitionHeader =
		&FsblInstancePtr->ImageHeader.PartitionHeader[PartitionNum];
	u32 DestinationCpu = XFsbl_GetDestinationCpu(PartitionHeader);
	u32 PartitionAttributes = PartitionHeader->PartitionAttributes;
	u32 DestinationDevice = XFsbl_GetDestinationDevice(PartitionHeader);
	u32 ElFlag = PartitionAttributes & XIH_PH_ATTRB_TARGET_EL_MASK;

	if (DestinationDevice == XIH_PH_ATTRB_DEST_DEVICE_PL)
	{
		PcrIndex = XFSBL_TPM_PL_PCR_INDEX;
	}
	else if (DestinationCpu == XIH_PH_ATTRB_DEST_CPU_A53_0)
	{
		if (ElFlag == XFSBL_EL3_VAL)
		{
			PcrIndex = XFSBL_TPM_ATF_PCR_INDEX;
		}
		else if (ElFlag == XFSBL_EL2_VAL)
		{
			PcrIndex = XFSBL_TPM_UBOOT_PCR_INDEX;
		}
	}

	return PcrIndex;
}
/*****************************************************************************/
/**
 * This function returns PCR index of the partition. Its 6 for PL,
 * 2 for ATF and 3 for U-boot.
 *
 * @param	FsblInstancePtr is pointer to the XFsbl Instance
 * @param	PartitionNum is the partition number to measure
 *
 * @return	PcrIndex
 *
 *****************************************************************************/
This function returns PCR index of the partition. Its 6 for PL,
2 for ATF and 3 for U-boot.

@param       FsblInstancePtr is pointer to the XFsbl Instance
@param       PartitionNum is the partition number to measure


This function returns PCR index of the partition . Its 6 for PL 2 for ATF and 3 for U - boot . @param FsblInstancePtr is pointer to the XFsbl Instance @param PartitionNum is the partition number to measure
static u8 XFsbl_GetPcrIndex(const XFsblPs * FsblInstancePtr, u32 PartitionNum)
{
	u8 PcrIndex = 0U;
	const XFsblPs_PartitionHeader * PartitionHeader =
		&FsblInstancePtr->ImageHeader.PartitionHeader[PartitionNum];
	u32 DestinationCpu = XFsbl_GetDestinationCpu(PartitionHeader);
	u32 PartitionAttributes = PartitionHeader->PartitionAttributes;
	u32 DestinationDevice = XFsbl_GetDestinationDevice(PartitionHeader);
	u32 ElFlag = PartitionAttributes & XIH_PH_ATTRB_TARGET_EL_MASK;
	if (DestinationDevice == XIH_PH_ATTRB_DEST_DEVICE_PL)
	{
		PcrIndex = XFSBL_TPM_PL_PCR_INDEX;
	}
	else if (DestinationCpu == XIH_PH_ATTRB_DEST_CPU_A53_0)
	{
		if (ElFlag == XFSBL_EL3_VAL)
		{
			PcrIndex = XFSBL_TPM_ATF_PCR_INDEX;
		}
		else if (ElFlag == XFSBL_EL2_VAL)
		{
			PcrIndex = XFSBL_TPM_UBOOT_PCR_INDEX;
		}
	}
	return PcrIndex;
}
static u8 XFsbl_GetPcrIndex ( const XFsblPs * FsblInstancePtr , u32 PartitionNum ) { u8 PcrIndex = 0U ; const XFsblPs_PartitionHeader * PartitionHeader = & FsblInstancePtr -> ImageHeader . PartitionHeader [ PartitionNum ] ; u32 DestinationCpu = XFsbl_GetDestinationCpu ( PartitionHeader ) ; u32 PartitionAttributes = PartitionHeader -> PartitionAttributes ; u32 DestinationDevice = XFsbl_GetDestinationDevice ( PartitionHeader ) ; u32 ElFlag = PartitionAttributes & XIH_PH_ATTRB_TARGET_EL_MASK ; if ( DestinationDevice == XIH_PH_ATTRB_DEST_DEVICE_PL ) { PcrIndex = XFSBL_TPM_PL_PCR_INDEX ; } else if ( DestinationCpu == XIH_PH_ATTRB_DEST_CPU_A53_0 ) { if ( ElFlag == XFSBL_EL3_VAL ) { PcrIndex = XFSBL_TPM_ATF_PCR_INDEX ; } else if ( ElFlag == XFSBL_EL2_VAL ) { PcrIndex = XFSBL_TPM_UBOOT_PCR_INDEX ; } } return PcrIndex ; }
This function returns PCR index of the partition.
This function returns PCR index of the partition .