示例#1
0
/* ------------------------------------------------------------------------*//**
 * @FUNCTION		mpu44xx_config_show
 * @BRIEF		analyze MPU power configuration
 * @RETURNS		0 in case of success
 *			OMAPCONF_ERR_CPU
 *			OMAPCONF_ERR_REG_ACCESS
 * @param[in]		stream: output file stream
 * @DESCRIPTION		analyze MPU power configuration
 *//*------------------------------------------------------------------------ */
int mpu44xx_config_show(FILE *stream)
{
	unsigned int pm_pda_cpu0_pwrstctrl;
	unsigned int pm_pda_cpu0_pwrstst;
	unsigned int rm_pda_cpu0_context;
	unsigned int cm_pda_cpu0_clkctrl;
	unsigned int cm_pda_cpu0_clkstctrl;
	unsigned int pm_pda_cpu1_pwrstctrl;
	unsigned int pm_pda_cpu1_pwrstst;
	unsigned int rm_pda_cpu1_context;
	unsigned int cm_pda_cpu1_clkctrl;
	unsigned int cm_pda_cpu1_clkstctrl;
	unsigned int scu_cpu_power_status;
	char s0[32], s1[32];
	unsigned int cm_clkmode_dpll_mpu;
	unsigned int cm_idlest_dpll_mpu;
	unsigned int cm_autoidle_dpll_mpu;
	omap4_dpll_params dpll_mpu_params;
	unsigned int pm_pwstctrl;
	unsigned int pm_pwstst;
	unsigned int cm_clkstctrl;
	unsigned int rm_context;
	unsigned int cm_clkctrl;
	int ret;

	CHECK_CPU(44xx, OMAPCONF_ERR_CPU);

	if (!init_done)
		mpu44xx_regtable_init();

	if (mem_read(OMAP4430_PM_PDA_CPU0_PWRSTCTRL,
		&pm_pda_cpu0_pwrstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_PM_PDA_CPU0_PWRSTST, &pm_pda_cpu0_pwrstst) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_RM_PDA_CPU0_CPU0_CONTEXT,
		&rm_pda_cpu0_context) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_PDA_CPU0_CPU0_CLKCTRL,
		&cm_pda_cpu0_clkctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_PDA_CPU0_CLKSTCTRL,
		&cm_pda_cpu0_clkstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_PM_PDA_CPU1_PWRSTCTRL,
		&pm_pda_cpu1_pwrstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_PM_PDA_CPU1_PWRSTST,
		&pm_pda_cpu1_pwrstst) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_RM_PDA_CPU1_CPU1_CONTEXT,
		&rm_pda_cpu1_context) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_PDA_CPU1_CPU1_CLKCTRL,
		&cm_pda_cpu1_clkctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_PDA_CPU1_CLKSTCTRL,
		&cm_pda_cpu1_clkstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_SCU_CPU_POWER_STATUS,
		&scu_cpu_power_status) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_CLKMODE_DPLL_MPU,
		&cm_clkmode_dpll_mpu) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_IDLEST_DPLL_MPU,
		&cm_idlest_dpll_mpu) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_CM_AUTOIDLE_DPLL_MPU,
		&cm_autoidle_dpll_mpu) != 0)
		return OMAPCONF_ERR_REG_ACCESS;

	ret = dpll44xx_dpll_params_get(DPLL44XX_MPU,
		&dpll_mpu_params, 0);
	if (ret < 0)
		return ret;

	/* MPU LPRM config */
	fprintf(stream, "|----------------------------------------------------"
		"----|\n");
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "MPU LPRM Configuration",
		"CPU0",	"CPU1");
	fprintf(stream, "|--------------------------------|-----------|-------"
		"----|\n");
	pwrdm_state2string(s0,
		(pwrdm_state) extract_bitfield(pm_pda_cpu0_pwrstst, 0, 2));
	pwrdm_state2string(s1,
		(pwrdm_state) extract_bitfield(pm_pda_cpu1_pwrstst, 0, 2));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Current Power State",
		s0, s1);
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Current Logic State",
		((extract_bit(pm_pda_cpu0_pwrstst, 2) == 1) ? "ON" : "OFF"),
		((extract_bit(pm_pda_cpu1_pwrstst, 2) == 1) ? "ON" : "OFF"));
	pwrdm_state2string(s0,
		(pwrdm_state) extract_bitfield(pm_pda_cpu0_pwrstst, 4, 2));
	pwrdm_state2string(s1,
		(pwrdm_state) extract_bitfield(pm_pda_cpu1_pwrstst, 4, 2));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n",
		"Current L1$ State", s0, s1);
	pwrdm_state2string(s0,
		(pwrdm_state)extract_bitfield(pm_pda_cpu0_pwrstctrl, 0, 2));
	pwrdm_state2string(s1,
		(pwrdm_state) extract_bitfield(pm_pda_cpu1_pwrstctrl, 0, 2));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n",
		"Standby Status",
		((extract_bit(cm_pda_cpu0_clkctrl, 0) == 1) ?
			"STANDBY" : "RUNNING"),
		((extract_bit(cm_pda_cpu1_clkctrl, 0) == 1) ?
			"STANDBY" : "RUNNING"));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "", "", "");
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Target Power State",
		s0, s1);
	fprintf(stream, "| %-30s | %-9s | %-9s |\n",
		"Logic State When Domain is RET",
		((extract_bit(pm_pda_cpu0_pwrstctrl, 2) == 1) ? "RET" : "OFF"),
		((extract_bit(pm_pda_cpu1_pwrstctrl, 2) == 1) ? "RET" : "OFF"));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Clock Control",
		clkdm_ctrl_mode_name_get((clkdm_ctrl_mode)
			extract_bitfield(cm_pda_cpu0_clkstctrl, 0, 2)),
		clkdm_ctrl_mode_name_get((clkdm_ctrl_mode)
			extract_bitfield(cm_pda_cpu1_clkstctrl, 0, 2)));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "", "", "");
	if ((cpu_is_omap4430() && (cpu_revision_get() != REV_ES1_0)) ||
		cpu_is_omap4460() || cpu_is_omap4470()) {
		pwrdm_state2string(s0, (pwrdm_state)
			extract_bitfield(pm_pda_cpu0_pwrstst, 24, 2));
		pwrdm_state2string(s1, (pwrdm_state)
			extract_bitfield(pm_pda_cpu1_pwrstst, 24, 2));
		fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Last Power State",
			s0, s1);
	}
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Last L1$ Context",
		((extract_bit(rm_pda_cpu0_context, 8) == 1) ?
			"LOST" : "RETAINED"),
		((extract_bit(rm_pda_cpu1_context, 8) == 1) ?
			"LOST" : "RETAINED"));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "Last CPU Context",
		((extract_bit(rm_pda_cpu0_context, 0) == 1) ?
			"LOST" : "RETAINED"),
		((extract_bit(rm_pda_cpu1_context, 0) == 1) ?
			"LOST" : "RETAINED"));
	fprintf(stream, "|----------------------------------------------------"
		"----|\n");
	fprintf(stream, "\n");

	/* SCU Configuration */
	fprintf(stream, "|----------------------------------------------------"
	"----|\n");
	fprintf(stream, "| %-30s | %-9s | %-9s |\n",
		"SCU Configuration", "CPU0", "CPU1");
	fprintf(stream, "|--------------------------------|-----------|-------"
		"----|\n");
	OMAPCONF_SCU_CPU_POWER_STATUS_2_STRING(s0,
		extract_bitfield(scu_cpu_power_status, 0, 2));
	OMAPCONF_SCU_CPU_POWER_STATUS_2_STRING(s1,
		extract_bitfield(scu_cpu_power_status, 8, 2));
	fprintf(stream, "| %-30s | %-9s | %-9s |\n", "CPU Power Status",
		s0, s1);
	fprintf(stream, "|---------------------------------------------------"
		"-----|\n");
	fprintf(stream, "\n");

	/* MPU Power Domain Configuration */
	if (mem_read(OMAP4430_PM_MPU_PWRSTCTRL, &pm_pwstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_PM_MPU_PWRSTST, &pm_pwstst) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	ret = pwrdm44xx_config_show(stream, "MPU",
		OMAP4430_PM_MPU_PWRSTCTRL, pm_pwstctrl,
		OMAP4430_PM_MPU_PWRSTST, pm_pwstst);
	if (ret != 0)
		return ret;

	/* MPU Clock Domain Configuration */
	if (mem_read(OMAP4430_CM_MPU_CLKSTCTRL, &cm_clkstctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	ret = clkdm44xx_config_show(stream, "MPU",
		OMAP4430_CM_MPU_CLKSTCTRL, cm_clkstctrl);
	if (ret != 0)
		return ret;

	/* MPU Module Power Configuration */
	if (mem_read(OMAP4430_CM_MPU_MPU_CLKCTRL, &cm_clkctrl) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	if (mem_read(OMAP4430_RM_MPU_MPU_CONTEXT, &rm_context) != 0)
		return OMAPCONF_ERR_REG_ACCESS;
	ret = mod44xx_config_show(stream, "MPU",
		OMAP4430_CM_MPU_MPU_CLKCTRL, cm_clkctrl,
		OMAP4430_RM_MPU_MPU_CONTEXT, rm_context);
	if (ret != 0)
		return ret;

	/* MPU DPLL Configuration */
	fprintf(stream, "|----------------------------------------------------"
		"----|\n");
	fprintf(stream, "| MPU DPLL Configuration                             "
		"    |\n");
	fprintf(stream, "|--------------------------------|-------------------"
		"----|\n");
	fprintf(stream, "| %-30s | %-21s |\n", "Status",
		dpll_status_name_get((dpll_status) dpll_mpu_params.status));
	sprintf(s0, "%d", (unsigned int) dpll_mpu_params.M2_speed);
	fprintf(stream, "| %-30s | %-21s |\n", "Clock Speed (MHz)", s0);
	fprintf(stream, "| %-30s | %-21s |\n", "Mode",
		dpll_mode_name_get((dpll_mode) dpll_mpu_params.mode));
	fprintf(stream, "| %-30s | %-21s |\n", "Low-Power Mode",
		(dpll_mpu_params.lpmode == 1) ? "Enabled" : "Disabled");
	fprintf(stream, "| %-30s | %-21s |\n", "Autoidle Mode",
		dpll_autoidle_mode_name_get((dpll_autoidle_mode)
			dpll_mpu_params.autoidle_mode));
	fprintf(stream, "| %-30s | %-21s |\n", "M2 Output Autogating",
		(dpll_mpu_params.M2_autogating == 1) ? "Enabled" : "Disabled");
	fprintf(stream, "|----------------------------------------------------"
		"----|\n");
	fprintf(stream, "\nNB: type \"omapconf dplls cfg\" "
		"for detailed DPLL configuration.\n\n");

	return 0;
}
示例#2
0
/* ------------------------------------------------------------------------*//**
 * @FUNCTION		pwrdm44xx_config_show
 * @BRIEF		analyze power domain configuration
 * @RETURNS		0 in case of error
 * @param[in,out]	stream: output file
 * @param[in,out]	name: domain name
 * @param[in]		pm_pwstctrl_addr: PM_xyz_PWSTCTRL register address
 * @param[in]		pm_pwstctrl: PM_xyz_PWSTCTRL register content
 * @param[in]		pm_pwstst_addr: PM_xyz_PWSTST register address
 * @param[in]		pm_pwstst: PM_xyz_PWSTST register content
 * @DESCRIPTION		analyze power domain configuration
 *//*------------------------------------------------------------------------ */
int pwrdm44xx_config_show(FILE *stream, const char name[11],
	unsigned int pm_pwstctrl_addr, unsigned int pm_pwstctrl,
	unsigned int pm_pwstst_addr, unsigned int pm_pwstst)
{
	char curr[32], tgt[32], last[32];

	dprintf("%s(): name=%s\n", __func__, name);
	dprintf("%s(): pm_pwstctrl addr=0x%08X\n", __func__, pm_pwstctrl_addr);
	dprintf("%s(): pm_pwstctrl=0x%08X\n", __func__, pm_pwstctrl);
	dprintf("%s(): pm_pwstst addr=0x%08X\n", __func__, pm_pwstst_addr);
	dprintf("%s(): pm_pwstst=0x%08X\n", __func__, pm_pwstst);
	dprintf("\n");

	fprintf(stream, "|---------------------------------------------------"
		"-----------|\n");
	fprintf(stream, "| %-10s Power Domain Configuration                  "
		"      |\n", name);
	fprintf(stream, "|---------------------------------------------------"
		"-----------|\n");
	fprintf(stream, "| %-30s | %-7s | %-7s | %-7s |\n", "Power State",
		"Current", "Target", "Last");
	fprintf(stream, "|--------------------------------|---------|--------"
		"-|---------|\n");
	pwrdm_state2string(curr,
		(pwrdm_state) extract_bitfield(pm_pwstst, 0, 2));
	pwrdm_state2string(tgt,
		(pwrdm_state) extract_bitfield(pm_pwstctrl, 0, 2));
	if ((cpu_is_omap4430() && (cpu_revision_get() != REV_ES1_0)) ||
		cpu_is_omap4460() || cpu_is_omap4470()) {
		switch (pm_pwstst_addr) {
		case OMAP4430_PM_MPU_PWRSTST:
		case OMAP4430_PM_DSP_PWRSTST:
		case OMAP4430_PM_ABE_PWRSTST:
		case OMAP4430_PM_CORE_PWRSTST:
		case OMAP4430_PM_IVAHD_PWRSTST:
		case OMAP4430_PM_L3INIT_PWRSTST:
		case OMAP4430_PM_L4PER_PWRSTST:
			pwrdm_state2string(last, (pwrdm_state)
				extract_bitfield(pm_pwstst, 24, 2));
			break;
		case OMAP4430_PM_CAM_PWRSTST:
		case OMAP4430_PM_DSS_PWRSTST:
		case OMAP4430_PM_GFX_PWRSTST:
		case OMAP4430_PM_EMU_PWRSTST:
			if (!cpu_is_omap4430())
				pwrdm_state2string(last, (pwrdm_state)
					extract_bitfield(pm_pwstst, 24, 2));
			else
				strcpy(last, "");
			break;
		default:
			strcpy(last, "");
		}
	} else {
		strcpy(last, "");
	}
	fprintf(stream, "| %-30s | %-7s | %-7s | %-7s |\n",
		"Domain", curr, tgt, last);

	if ((pm_pwstctrl_addr == OMAP4430_PM_CAM_PWRSTCTRL) ||
			(pm_pwstctrl_addr == OMAP4430_PM_EMU_PWRSTCTRL) ||
			(pm_pwstctrl_addr == OMAP4430_PM_GFX_PWRSTCTRL)) {
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n", "Logic",
			((extract_bit(pm_pwstst, 2) == 1) ? "ON" : "OFF"),
			"");
	} else {
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n", "Logic",
			((extract_bit(pm_pwstst, 2) == 1) ? "ON" : "OFF"),
			((extract_bit(pm_pwstctrl, 2) == 1) ? "RET" : "OFF"));
	}
	fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
		"Memory", "", "");
	switch (pm_pwstctrl_addr) {
	case OMAP4430_PM_CORE_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 12, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 12));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    OCP_WP Bank & DMM Bank2", curr, tgt);
		break;
	default:
		break;
	}

	switch (pm_pwstctrl_addr) {
	case OMAP4430_PM_IVAHD_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 10, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 11));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    TCM2", curr, tgt);
		break;
	case OMAP4430_PM_CORE_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 10, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 11));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    MPU_M3 Unicache", curr, tgt);
	default:
		break;
	}

	switch (pm_pwstctrl_addr) {
	case OMAP4430_PM_MPU_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 8, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 10));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    RAM", curr, tgt);
		break;
	case OMAP4430_PM_DSP_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 8, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 10));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    EDMA", curr, tgt);
		break;
	case OMAP4430_PM_DSS_PWRSTCTRL:
	case OMAP4430_PM_CAM_PWRSTCTRL:
	case OMAP4430_PM_GFX_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    MEM", curr, tgt);
		break;
	case OMAP4430_PM_IVAHD_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 8, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 10));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    TCM1", curr, tgt);
	case OMAP4430_PM_CORE_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 8, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 10));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    MPU_M3 L2 RAM", curr, tgt);
	default:
		break;
	}

	switch (pm_pwstctrl_addr) {
	case OMAP4430_PM_ABE_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 8, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 10));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    PERIPHMEM", curr, tgt);
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    AESSMEM", curr, tgt);
		break;
	case OMAP4430_PM_MPU_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 6, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 9));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    L2$", curr, tgt);
		if (cpu_is_omap4430())
			pwrdm_state2string(curr,
				extract_bitfield(pm_pwstst, 4, 2));
		else
			strcpy(curr, ""); /* not available on OMAP44[60-70] */
		pwrdm_state2string(tgt,
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    L1$", curr, tgt);
		break;
	case OMAP4430_PM_DSP_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 6, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 9));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    L2$", curr, tgt);
		pwrdm_state2string(curr,
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt,
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    L1$", curr, tgt);
		break;
	case OMAP4430_PM_IVAHD_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 6, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 9));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    SL2", curr, tgt);
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    HWA", curr, tgt);
		break;
	case OMAP4430_PM_L4PER_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 6, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 9));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    NONRETAINED", curr, tgt);
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    RETAINED", curr, tgt);
		break;
	case OMAP4430_PM_CORE_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 6, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 9));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    OCM RAM", curr, tgt);
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    DMA/ICR Bank & DMM Bank1", curr, tgt);
		break;
	case OMAP4430_PM_L3INIT_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bit(pm_pwstctrl, 8));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    L3INIT Bank1", curr, tgt);
		break;
	case OMAP4430_PM_EMU_PWRSTCTRL:
		pwrdm_state2string(curr, (pwrdm_state)
			extract_bitfield(pm_pwstst, 4, 2));
		pwrdm_state2string(tgt, (pwrdm_state)
			extract_bitfield(pm_pwstctrl, 16, 2));
		fprintf(stream, "| %-30s | %-7s | %-7s |         |\n",
			"    EMU Bank", curr, tgt);
		break;
	default:
		break;
	}
	fprintf(stream, "|---------------------------------------------------"
		"-----------|\n");
	fprintf(stream, "| %-30s | %-27s |\n", "Ongoing Power Transition?",
		((extract_bit(pm_pwstst, 20) == 1) ? "YES" : "NO"));
	fprintf(stream, "|---------------------------------------------------"
		"-----------|\n");
	fprintf(stream, "\n");

	return 0;
}