lib/sw_apps/zynqmp_pmufw/src/pm_pll.c
s32 PmPllSetParameterInt(PmPll* const pll, const u32 paramId, const u32 val)
{
	s32 status = XST_INVALID_PARAM;
	PmPllParam* p;

	if (paramId >= ARRAY_SIZE(pllParams)) {
		goto done;
	}

	p = &pllParams[paramId];
	if (val > MASK_OF_BITS(p->bits)) {
		goto done;
	}

	/*
	 * We're running on a ZynqMP compatible machine, make sure the
	 * VPLL only has one child. Check only while changing PLL rate.
	 * This helps to remove the warn in cases where the expected clock
	 * is not using vpll and vpll is used for other stuff.
	 */
	if ((NODE_VPLL == pll->node.nodeId) && (PM_PLL_PARAM_FBDIV == paramId)) {
		if (pll->childCount > 1U) {
			PmErr("More than 1 devices are using VPLL which is forbidden\r\n");
			status = XST_PM_MULT_USER;
			goto done;
		}
	}

	XPfw_RMW32(pll->addr + p->regOffset, MASK_OF_BITS(p->bits) << p->shift,
		   val << p->shift);
	status = XST_SUCCESS;

done:
	return status;
}
/**
 * PmPllSetParameterInt() - Set PLL parameter
 * @pll		PLL whose parameter should be set
 * @paramId	Parameter ID
 * @val		Parameter value to be set
 *
 * @return	Status of setting the parameter:
 *		XST_INVALID_PARAM if one of the given arguments is invalid
 *		XST_SUCCESS if parameter is set
 */
Set PLL parameter
@pll         PLL whose parameter should be set
@paramId     Parameter ID
@val         Parameter value to be set

@return      Status of setting the parameter:
XST_INVALID_PARAM if one of the given arguments is invalid
XST_SUCCESS if parameter is set
Set PLL parameter @pll PLL whose parameter should be set @paramId Parameter ID @val Parameter value to be set @return Status of setting the parameter : XST_INVALID_PARAM if one of the given arguments is invalid XST_SUCCESS if parameter is set
s32 PmPllSetParameterInt(PmPll* const pll, const u32 paramId, const u32 val)
{
	s32 status = XST_INVALID_PARAM;
	PmPllParam* p;
	if (paramId >= ARRAY_SIZE(pllParams)) {
		goto done;
	}
	p = &pllParams[paramId];
	if (val > MASK_OF_BITS(p->bits)) {
		goto done;
	}
	if ((NODE_VPLL == pll->node.nodeId) && (PM_PLL_PARAM_FBDIV == paramId)) {
		if (pll->childCount > 1U) {
			PmErr("More than 1 devices are using VPLL which is forbidden\r\n");
			status = XST_PM_MULT_USER;
			goto done;
		}
	}
	XPfw_RMW32(pll->addr + p->regOffset, MASK_OF_BITS(p->bits) << p->shift,
		   val << p->shift);
	status = XST_SUCCESS;
done:
	return status;
}
s32 PmPllSetParameterInt ( PmPll * const pll , const u32 paramId , const u32 val ) { s32 status = XST_INVALID_PARAM ; PmPllParam * p ; if ( paramId >= ARRAY_SIZE ( pllParams ) ) { goto done ; } p = & pllParams [ paramId ] ; if ( val > MASK_OF_BITS ( p -> bits ) ) { goto done ; } if ( ( NODE_VPLL == pll -> node . nodeId ) && ( PM_PLL_PARAM_FBDIV == paramId ) ) { if ( pll -> childCount > 1U ) { PmErr ( " \r \n " ) ; status = XST_PM_MULT_USER ; goto done ; } } XPfw_RMW32 ( pll -> addr + p -> regOffset , MASK_OF_BITS ( p -> bits ) << p -> shift , val << p -> shift ) ; status = XST_SUCCESS ; done : return status ; }
PmPllSetParameterInt() - Set PLL parameter
 @pll         PLL whose parameter should be set
 @paramId     Parameter ID
 @val         Parameter value to be set
PmPllSetParameterInt () - Set PLL parameter @pll PLL whose parameter should be set @paramId Parameter ID @val Parameter value to be set
/*
	 * We're running on a ZynqMP compatible machine, make sure the
	 * VPLL only has one child. Check only while changing PLL rate.
	 * This helps to remove the warn in cases where the expected clock
	 * is not using vpll and vpll is used for other stuff.
	 */