示例#1
0
/* ------------------------------------------------------------------------*//**
 * @FUNCTION		powerdm_init
 * @BRIEF		initialize internal data
 * @DESCRIPTION		initialize internal data (architecture dependent)
 *//*------------------------------------------------------------------------ */
void powerdm_init(void)
{
	#ifdef PWRDM_DEBUG
	int i, count;
	const genlist *pwrdm_list;
	powerdm_info pwrdm;
	#endif

	if (cpu_is_omap44xx()) {
		pwrdm44xx_init();
	} else if (cpu_is_omap54xx()) {
		pwrdm54xx_init();
	} else {
		fprintf(stderr,
			"omapconf: %s(): cpu not supported!!!\n", __func__);
	}

	#ifdef PWRDM_DEBUG
	pwrdm_list = powerdm_list_get();
	count = genlist_getcount((genlist *) pwrdm_list);
	printf("Power Domain List:\n");
	for (i = 0; i < count; i++) {
		genlist_get((genlist *) pwrdm_list, i, (powerdm_info *) &pwrdm);
		printf(" %s:\n", pwrdm.name);
		printf("  ID:%d\n", pwrdm.id);
		printf("  VoltDM: %s\n", pwrdm.voltdm);
		printf("  PWRSTCTRL REG: %s\n", (pwrdm.pwrstctrl)->name);
		printf("  PWRSTST REG: %s\n", (pwrdm.pwrstst)->name);
		printf("  Properties: %d\n", pwrdm.properties);
		printf("\n\n");
	}
	printf("Power Domain count: %d\n\n", count);
	#endif
}
示例#2
0
/* ------------------------------------------------------------------------*//**
 * @FUNCTION		_powerdm_info_get
 * @BRIEF		return the saved informations of a given power domain.
 * @RETURNS		0 in case of success
 *			-1 in case of error
 * @param[in]		powerdm: power domain name
 * @param[in,out]	data: power domain details
 * @DESCRIPTION		return the saved informations of a given power domain.
 *//*------------------------------------------------------------------------ */
static int _powerdm_info_get(const char *powerdm, powerdm_info *data)
{
	const genlist *pwrdm_list;
	int i, count;

	CHECK_NULL_ARG(powerdm, -1);
	CHECK_NULL_ARG(data, -1);

	pwrdm_list = powerdm_list_get();
	count = genlist_getcount((genlist *) pwrdm_list);
	for (i = 0; i < count; i++) {
		genlist_get((genlist *) pwrdm_list, i, (void *) data);
		if (strcmp(data->name, powerdm) == 0) {
			dprintf("%s(%s): found.\n", __func__, powerdm);
			return 0;
		}
	}

	dprintf("%s(%s): not found!\n", __func__, powerdm);
	return -1;
}