diff mbox

[2/3] pm: at91: pm_suspend: MOR register KEY was missing

Message ID 1423709533-8416-1-git-send-email-wenyou.yang@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wenyou Yang Feb. 12, 2015, 2:52 a.m. UTC
From: Patrice Vilchez <patrice.vilchez@atmel.com>

Because writing the MOR register requires the PASSWD(0x37),
if missed, the write operation will be aborted.

Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 arch/arm/mach-at91/pm_suspend.S |    2 ++
 1 file changed, 2 insertions(+)

Comments

Alexandre Belloni Feb. 17, 2015, 10:24 a.m. UTC | #1
On 12/02/2015 at 10:52:13 +0800, Wenyou Yang wrote :
> From: Patrice Vilchez <patrice.vilchez@atmel.com>
> 
> Because writing the MOR register requires the PASSWD(0x37),
> if missed, the write operation will be aborted.
> 
> Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

> ---
>  arch/arm/mach-at91/pm_suspend.S |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
> index 1c7256a..5347ad4 100644
> --- a/arch/arm/mach-at91/pm_suspend.S
> +++ b/arch/arm/mach-at91/pm_suspend.S
> @@ -132,6 +132,7 @@ ENTRY(at91_pm_suspend_in_sram)
>  	/* Turn off the main oscillator */
>  	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
>  	bic	tmp1, tmp1, #AT91_PMC_MOSCEN
> +	orr	tmp1, tmp1, #AT91_PMC_KEY
>  	str	tmp1, [pmc, #AT91_CKGR_MOR]
>  
>  skip_disable_main_clock:
> @@ -149,6 +150,7 @@ skip_disable_main_clock:
>  	/* Turn on the main oscillator */
>  	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
>  	orr	tmp1, tmp1, #AT91_PMC_MOSCEN
> +	orr	tmp1, tmp1, #AT91_PMC_KEY
>  	str	tmp1, [pmc, #AT91_CKGR_MOR]
>  
>  	wait_moscrdy
> -- 
> 1.7.9.5
>
diff mbox

Patch

diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index 1c7256a..5347ad4 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -132,6 +132,7 @@  ENTRY(at91_pm_suspend_in_sram)
 	/* Turn off the main oscillator */
 	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
 	bic	tmp1, tmp1, #AT91_PMC_MOSCEN
+	orr	tmp1, tmp1, #AT91_PMC_KEY
 	str	tmp1, [pmc, #AT91_CKGR_MOR]
 
 skip_disable_main_clock:
@@ -149,6 +150,7 @@  skip_disable_main_clock:
 	/* Turn on the main oscillator */
 	ldr	tmp1, [pmc, #AT91_CKGR_MOR]
 	orr	tmp1, tmp1, #AT91_PMC_MOSCEN
+	orr	tmp1, tmp1, #AT91_PMC_KEY
 	str	tmp1, [pmc, #AT91_CKGR_MOR]
 
 	wait_moscrdy