lib/sw_apps/zynqmp_fsbl/src/xfsbl_ddr_init.c
static u32 XFsbl_PhyRegsInit(struct DdrcInitData *DdrDataPtr)
{
	XFsbl_DimmParams *PDimmPtr = &DdrDataPtr->PDimm;
	u32 PhyCfg[512U] = XFSBL_PHY_REG_DEFVAL;
	u32 Status;

	Status = XFsbl_PhyCalcCommonRegVal(PDimmPtr, PhyCfg);
	if (Status != XFSBL_SUCCESS) {
		Status = XFSBL_FAILURE;
		goto END;
	}

	if (PDimmPtr->MemType == SPD_MEMTYPE_DDR3) {
		Status = XFsbl_PhyCalcDdr3RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}

	if (PDimmPtr->MemType == SPD_MEMTYPE_DDR4) {
		Status = XFsbl_PhyCalcDdr4RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}

	if (PDimmPtr->MemType == SPD_MEMTYPE_LPDDR3) {
		Status = XFsbl_PhyCalcLpddr3RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}

	if (PDimmPtr->MemType == SPD_MEMTYPE_LPDDR4) {
		Status = XFsbl_PhyCalcLpddr4RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}

	XFsbl_PhyRegsWrite(PDimmPtr, PhyCfg);

END:
	return Status;
}
/*****************************************************************************/
/**
 * This function calculates and writes the DDR-PHY registers
 *
 * @param	DdrDataPtr is pointer to DDR Initialization Data Structure
 *
 * @return	None
 *
 *****************************************************************************/
This function calculates and writes the DDR-PHY registers
@param       DdrDataPtr is pointer to DDR Initialization Data Structure

@return      None
This function calculates and writes the DDR - PHY registers @param DdrDataPtr is pointer to DDR Initialization Data Structure @return None
static u32 XFsbl_PhyRegsInit(struct DdrcInitData *DdrDataPtr)
{
	XFsbl_DimmParams *PDimmPtr = &DdrDataPtr->PDimm;
	u32 PhyCfg[512U] = XFSBL_PHY_REG_DEFVAL;
	u32 Status;
	Status = XFsbl_PhyCalcCommonRegVal(PDimmPtr, PhyCfg);
	if (Status != XFSBL_SUCCESS) {
		Status = XFSBL_FAILURE;
		goto END;
	}
	if (PDimmPtr->MemType == SPD_MEMTYPE_DDR3) {
		Status = XFsbl_PhyCalcDdr3RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}
	if (PDimmPtr->MemType == SPD_MEMTYPE_DDR4) {
		Status = XFsbl_PhyCalcDdr4RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}
	if (PDimmPtr->MemType == SPD_MEMTYPE_LPDDR3) {
		Status = XFsbl_PhyCalcLpddr3RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}
	if (PDimmPtr->MemType == SPD_MEMTYPE_LPDDR4) {
		Status = XFsbl_PhyCalcLpddr4RegVal(PDimmPtr, PhyCfg);
		if (Status != XFSBL_SUCCESS) {
			Status = XFSBL_FAILURE;
			goto END;
		}
	}
	XFsbl_PhyRegsWrite(PDimmPtr, PhyCfg);
END:
	return Status;
}
static u32 XFsbl_PhyRegsInit ( struct DdrcInitData * DdrDataPtr ) { XFsbl_DimmParams * PDimmPtr = & DdrDataPtr -> PDimm ; u32 PhyCfg [ 512U ] = XFSBL_PHY_REG_DEFVAL ; u32 Status ; Status = XFsbl_PhyCalcCommonRegVal ( PDimmPtr , PhyCfg ) ; if ( Status != XFSBL_SUCCESS ) { Status = XFSBL_FAILURE ; goto END ; } if ( PDimmPtr -> MemType == SPD_MEMTYPE_DDR3 ) { Status = XFsbl_PhyCalcDdr3RegVal ( PDimmPtr , PhyCfg ) ; if ( Status != XFSBL_SUCCESS ) { Status = XFSBL_FAILURE ; goto END ; } } if ( PDimmPtr -> MemType == SPD_MEMTYPE_DDR4 ) { Status = XFsbl_PhyCalcDdr4RegVal ( PDimmPtr , PhyCfg ) ; if ( Status != XFSBL_SUCCESS ) { Status = XFSBL_FAILURE ; goto END ; } } if ( PDimmPtr -> MemType == SPD_MEMTYPE_LPDDR3 ) { Status = XFsbl_PhyCalcLpddr3RegVal ( PDimmPtr , PhyCfg ) ; if ( Status != XFSBL_SUCCESS ) { Status = XFSBL_FAILURE ; goto END ; } } if ( PDimmPtr -> MemType == SPD_MEMTYPE_LPDDR4 ) { Status = XFsbl_PhyCalcLpddr4RegVal ( PDimmPtr , PhyCfg ) ; if ( Status != XFSBL_SUCCESS ) { Status = XFSBL_FAILURE ; goto END ; } } XFsbl_PhyRegsWrite ( PDimmPtr , PhyCfg ) ; END : return Status ; }
This function calculates and writes the DDR-PHY registers
 @param       DdrDataPtr is pointer to DDR Initialization Data Structure
This function calculates and writes the DDR - PHY registers @param DdrDataPtr is pointer to DDR Initialization Data Structure