Skip to content

Commit

Permalink
ARM: EXYNOS4: Add save/restore for other ARM registers
Browse files Browse the repository at this point in the history
This patch adds save/restore values for Power Control Register and
Diagnostic Register for PM.

Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Jaecheol Lee authored and Kukjin Kim committed Jul 20, 2011
1 parent 12974e9 commit f4ba4b0
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion arch/arm/mach-exynos4/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ static struct sleep_save exynos4_l2cc_save[] = {
SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL),
};

void exynos4_cpu_suspend(void)
/* For Cortex-A9 Diagnostic and Power control register */
static unsigned int save_arm_register[2];

void exynos4_cpu_suspend(unsigned long arg)
{
outer_flush_all();

Expand Down Expand Up @@ -301,6 +304,16 @@ static int exynos4_pm_suspend(void)
tmp &= ~S5P_CENTRAL_LOWPWR_CFG;
__raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);

/* Save Power control register */
asm ("mrc p15, 0, %0, c15, c0, 0"
: "=r" (tmp) : : "cc");
save_arm_register[0] = tmp;

/* Save Diagnostic register */
asm ("mrc p15, 0, %0, c15, c0, 1"
: "=r" (tmp) : : "cc");
save_arm_register[1] = tmp;

return 0;
}

Expand All @@ -321,6 +334,17 @@ static void exynos4_pm_resume(void)
/* No need to perform below restore code */
goto early_wakeup;
}
/* Restore Power control register */
tmp = save_arm_register[0];
asm volatile ("mcr p15, 0, %0, c15, c0, 0"
: : "r" (tmp)
: "cc");

/* Restore Diagnostic register */
tmp = save_arm_register[1];
asm volatile ("mcr p15, 0, %0, c15, c0, 1"
: : "r" (tmp)
: "cc");

/* For release retention */

Expand Down

0 comments on commit f4ba4b0

Please sign in to comment.