Ejemplo n.º 1
0
const char *opp54xx_by_voltage_get(voltdm54xx_id vdd_id)
{
	CHECK_CPU(54xx, NULL);
	CHECK_ARG_LESS_THAN(vdd_id, VDD54XX_ID_MAX, NULL);

	opp54xx_init();

	return opp_by_voltage_get(voltdm54xx_id2s(vdd_id), 1);
}
Ejemplo n.º 2
0
/* ------------------------------------------------------------------------*//**
 * @FUNCTION		opp_get
 * @BRIEF		return the current voltage domain OPP name
 * @RETURNS		current voltage domain OPP name (as defined in opp.h)
 *			NULL pointer in case of error
 * @param[in]		voltdm: voltage domain name (as defined in voltdm.h)
 * @param[in]		quiet: if == 0, print warning message when OPP
 *			could not be found
 * @DESCRIPTION		return the current voltage domain OPP name. Search it by
 *			voltage first, then if failed search it by rates.
 *//*------------------------------------------------------------------------ */
const char *opp_get(const char *voltdm, unsigned int quiet)
{
	const char *opp = NULL;

	CHECK_NULL_ARG(voltdm, NULL);

	opp_init();

	/*
	 *
	 * Due to Smart-Reflex AVS Class1.5 which dynamically updates nominal
	 * voltages, it is not possible to search OPP using nominal voltages.
	 * Even if SR AVS Class1.5 could be disabled before and
	 * during the search, it is considered too constraining,
	 * as it would reset the voltage and force a new calibration to happen.
	 * Also if it was ever needed to print the current voltage, it would
	 * have to be done before the search, otherwise it may not always show
	 * the converged voltage.
	 *
	 * Another reason to skip it is that we want to be really strict,
	 * then OPP is a strict combination of voltage and frequency.
	 * which means we would have to search by voltage AND by frequency,
	 * and only consider it OK if both are found and are matching.
	 *
	 */
#if 0
	dprintf("%s(%s): searching OPP by voltage first:\n", __func__, voltdm);
	opp = opp_by_voltage_get(voltdm, quiet);
	if (opp != NULL) {
		dprintf("%s(%s): OPP search by voltage succeeded.\n",
			__func__, voltdm);
		goto opp_get_end;
	}
	/*
	 * Could not detect OPP using voltage, try again
	 * using frequencies instead.
	 */
	dprintf("%s(): OPP search by voltage failed, try using rate instead.\n",
		__func__);
#endif
	opp = opp_by_rate_get(voltdm, quiet);

#if 0
opp_get_end:
#endif
	#ifdef OPP_DEBUG
	if (opp != NULL)
		printf("%s(%s): found %s OPP\n", __func__, voltdm, opp);
	else
		printf("%s(%s): OPP not found!\n", __func__, voltdm);
	#endif

	return opp;
}