コード例 #1
0
ファイル: cpu.c プロジェクト: Viharrai/u-boot
static void power_partition(u32 status, u32 partid)
{
	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;

	debug("%s: status = %08X, part ID = %08X\n", __func__, status, partid);
	/* Is the partition already on? */
	if (!is_partition_powered(status)) {
		/* No, toggle the partition power state (OFF -> ON) */
		debug("power_partition, toggling state\n");
		clrbits_le32(&pmc->pmc_pwrgate_toggle, 0x1F);
		setbits_le32(&pmc->pmc_pwrgate_toggle, partid);
		setbits_le32(&pmc->pmc_pwrgate_toggle, START_CP);

		/* Wait for the power to come up */
		while (!is_partition_powered(status))
			;

		/* Wait for the clamp status to be cleared */
		while (is_clamp_enabled(status))
			;

		/* Give I/O signals time to stabilize */
		udelay(IO_STABILIZATION_DELAY);
	}
}
コード例 #2
0
ファイル: cpu.c プロジェクト: CogSystems/u-boot
static void power_partition(u32 partid)
{
	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;

	debug("%s: part ID = %08X\n", __func__, partid);
	/* Is the partition already on? */
	if (!is_partition_powered(partid)) {
		/* No, toggle the partition power state (OFF -> ON) */
		debug("power_partition, toggling state\n");
		writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);

		/* Wait for the power to come up */
		while (!is_partition_powered(partid))
			;

		/* Give I/O signals time to stabilize */
		udelay(IO_STABILIZATION_DELAY);
	}
}