lib/sw_apps/zynqmp_fsbl/src/xfsbl_ddr_init.c
static void XFsbl_DdrCalcBgAddr(struct DdrcInitData *DdrDataPtr, u32 *HifAddr)
{
	u32 Index;
	u32 BgBit;
	XFsbl_DimmParams *PDimmPtr = &DdrDataPtr->PDimm;

	/* Calculate Bank Group Addresses */
	for (BgBit = 0U; BgBit < XFSBL_MAX_BANK_GROUPS; BgBit++) {
		if (BgBit < PDimmPtr->NumBgAddr) {
			Index = BgBit + 2U;

			while (HifAddr[Index] != XFSBL_HIF_BG(BgBit)) {
				Index++;
			}

			if (Index >= (BgBit + 2U)) {
				DdrDataPtr->AddrMapBgBit[BgBit] = Index -
					(BgBit + 2U);
			} else {
				DdrDataPtr->AddrMapBgBit[BgBit] = 0U;
			}
		} else {
			DdrDataPtr->AddrMapBgBit[BgBit] = 0x1FU;
		}
	}
}
/*****************************************************************************/
/**
 * This function calculates the Bank Group Address Map based on HIF Addresses
 *
 * @param	DdrDataPtr is pointer to DDR Initialization Data Structure
 * @param	HifAddr is the pointer to the HIF Addresses Array
 *
 * @return	None
 *
 *****************************************************************************/
This function calculates the Bank Group Address Map based on HIF Addresses
@param       DdrDataPtr is pointer to DDR Initialization Data Structure
@param       HifAddr is the pointer to the HIF Addresses Array

@return      None
This function calculates the Bank Group Address Map based on HIF Addresses @param DdrDataPtr is pointer to DDR Initialization Data Structure @param HifAddr is the pointer to the HIF Addresses Array @return None
static void XFsbl_DdrCalcBgAddr(struct DdrcInitData *DdrDataPtr, u32 *HifAddr)
{
	u32 Index;
	u32 BgBit;
	XFsbl_DimmParams *PDimmPtr = &DdrDataPtr->PDimm;
	for (BgBit = 0U; BgBit < XFSBL_MAX_BANK_GROUPS; BgBit++) {
		if (BgBit < PDimmPtr->NumBgAddr) {
			Index = BgBit + 2U;
			while (HifAddr[Index] != XFSBL_HIF_BG(BgBit)) {
				Index++;
			}
			if (Index >= (BgBit + 2U)) {
				DdrDataPtr->AddrMapBgBit[BgBit] = Index -
					(BgBit + 2U);
			} else {
				DdrDataPtr->AddrMapBgBit[BgBit] = 0U;
			}
		} else {
			DdrDataPtr->AddrMapBgBit[BgBit] = 0x1FU;
		}
	}
}
static void XFsbl_DdrCalcBgAddr ( struct DdrcInitData * DdrDataPtr , u32 * HifAddr ) { u32 Index ; u32 BgBit ; XFsbl_DimmParams * PDimmPtr = & DdrDataPtr -> PDimm ; for ( BgBit = 0U ; BgBit < XFSBL_MAX_BANK_GROUPS ; BgBit ++ ) { if ( BgBit < PDimmPtr -> NumBgAddr ) { Index = BgBit + 2U ; while ( HifAddr [ Index ] != XFSBL_HIF_BG ( BgBit ) ) { Index ++ ; } if ( Index >= ( BgBit + 2U ) ) { DdrDataPtr -> AddrMapBgBit [ BgBit ] = Index - ( BgBit + 2U ) ; } else { DdrDataPtr -> AddrMapBgBit [ BgBit ] = 0U ; } } else { DdrDataPtr -> AddrMapBgBit [ BgBit ] = 0x1FU ; } } }
This function calculates the Bank Group Address Map based on HIF Addresses
 @param       DdrDataPtr is pointer to DDR Initialization Data Structure
 @param       HifAddr is the pointer to the HIF Addresses Array
This function calculates the Bank Group Address Map based on HIF Addresses @param DdrDataPtr is pointer to DDR Initialization Data Structure @param HifAddr is the pointer to the HIF Addresses Array
/* Calculate Bank Group Addresses */