Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-25 Thread Jean Pihet
On Tue, Jan 25, 2011 at 11:33 AM, Dave Martin  wrote:
> On Mon, Jan 24, 2011 at 5:25 PM, Jean Pihet  wrote:
>> Hi,
>>
>> On Mon, Jan 24, 2011 at 5:11 PM, Dave Martin  wrote:
>>> Hi there, I just spotted a couple of things merging your patch...
>>>
>>> On Tue, Jan 18, 2011 at 12:02 PM,   wrote:
 From: Jean Pihet 

 The new fncpy API is better suited for copying some
 code to SRAM at runtime. This patch changes the ad-hoc
 code to the more generic fncpy API.

 Tested OK on OMAP3 in low power modes (RET/OFF)
 using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
 Compile tested on OMAP1/2 using omap1_defconfig.

 Signed-off-by: Jean Pihet 
 ---
  arch/arm/mach-omap1/pm.h               |    6 +++---
  arch/arm/mach-omap1/sleep.S            |    3 +++
  arch/arm/mach-omap1/sram.S             |    1 +
  arch/arm/mach-omap2/pm.h               |    2 +-
  arch/arm/mach-omap2/sleep24xx.S        |    2 ++
  arch/arm/mach-omap2/sleep34xx.S        |    2 ++
  arch/arm/mach-omap2/sram242x.S         |    3 +++
  arch/arm/mach-omap2/sram243x.S         |    3 +++
  arch/arm/mach-omap2/sram34xx.S         |    1 +
  arch/arm/plat-omap/include/plat/sram.h |   14 +-
  arch/arm/plat-omap/sram.c              |   14 +-
  11 files changed, 41 insertions(+), 10 deletions(-)

 diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
 index 56a6479..cd926dc 100644
 --- a/arch/arm/mach-omap1/pm.h
 +++ b/arch/arm/mach-omap1/pm.h
 @@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
  extern void omap1_pm_idle(void);
  extern void omap1_pm_suspend(void);

 -extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
 -extern void omap1510_cpu_suspend(unsigned short, unsigned short);
 -extern void omap1610_cpu_suspend(unsigned short, unsigned short);
 +extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
 +extern void omap1510_cpu_suspend(unsigned long, unsigned long);
 +extern void omap1610_cpu_suspend(unsigned long, unsigned long);
  extern void omap7xx_idle_loop_suspend(void);
  extern void omap1510_idle_loop_suspend(void);
  extern void omap1610_idle_loop_suspend(void);
 diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
 index ef771ce..c875bdc 100644
 --- a/arch/arm/mach-omap1/sleep.S
 +++ b/arch/arm/mach-omap1/sleep.S
 @@ -58,6 +58,7 @@
  */

  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
 +       .align  3
  ENTRY(omap7xx_cpu_suspend)

        @ save registers on stack
 @@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
  #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */

  #ifdef CONFIG_ARCH_OMAP15XX
 +       .align  3
  ENTRY(omap1510_cpu_suspend)

        @ save registers on stack
 @@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
  #endif /* CONFIG_ARCH_OMAP15XX */

  #if defined(CONFIG_ARCH_OMAP16XX)
 +       .align  3
  ENTRY(omap1610_cpu_suspend)

        @ save registers on stack
 diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
 index 7724e52..692587d 100644
 --- a/arch/arm/mach-omap1/sram.S
 +++ b/arch/arm/mach-omap1/sram.S
 @@ -18,6 +18,7 @@
  /*
  * Reprograms ULPD and CKCTL.
  */
 +       .align  3
  ENTRY(omap1_sram_reprogram_clock)
        stmfd   sp!, {r0 - r12, lr}             @ save registers on stack

 diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
 index 1c1b0ab..39580e6 100644
 --- a/arch/arm/mach-omap2/pm.h
 +++ b/arch/arm/mach-omap2/pm.h
 @@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem 
 *sdrc_dlla_ctrl,
                                        void __iomem *sdrc_power);
  extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
 -extern void save_secure_ram_context(u32 *addr);
 +extern int save_secure_ram_context(u32 *addr);
  extern void omap3_save_scratchpad_contents(void);

  extern unsigned int omap24xx_idle_loop_suspend_sz;
 diff --git a/arch/arm/mach-omap2/sleep24xx.S 
 b/arch/arm/mach-omap2/sleep24xx.S
 index c7780cc..b5071a4 100644
 --- a/arch/arm/mach-omap2/sleep24xx.S
 +++ b/arch/arm/mach-omap2/sleep24xx.S
 @@ -47,6 +47,7 @@
  * Note: This code get's copied to internal SRAM at boot. When the OMAP
  *      wakes up it continues execution at the point it went to sleep.
  */
 +       .align  3
  ENTRY(omap24xx_idle_loop_suspend)
        stmfd   sp!, {r0, lr}           @ save registers on stack
        mov     r0, #0                  @ clear for mcr setup
 @@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
  * The DLL load value is not kept in RETENT

Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-25 Thread Dave Martin
On Mon, Jan 24, 2011 at 5:25 PM, Jean Pihet  wrote:
> Hi,
>
> On Mon, Jan 24, 2011 at 5:11 PM, Dave Martin  wrote:
>> Hi there, I just spotted a couple of things merging your patch...
>>
>> On Tue, Jan 18, 2011 at 12:02 PM,   wrote:
>>> From: Jean Pihet 
>>>
>>> The new fncpy API is better suited for copying some
>>> code to SRAM at runtime. This patch changes the ad-hoc
>>> code to the more generic fncpy API.
>>>
>>> Tested OK on OMAP3 in low power modes (RET/OFF)
>>> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
>>> Compile tested on OMAP1/2 using omap1_defconfig.
>>>
>>> Signed-off-by: Jean Pihet 
>>> ---
>>>  arch/arm/mach-omap1/pm.h               |    6 +++---
>>>  arch/arm/mach-omap1/sleep.S            |    3 +++
>>>  arch/arm/mach-omap1/sram.S             |    1 +
>>>  arch/arm/mach-omap2/pm.h               |    2 +-
>>>  arch/arm/mach-omap2/sleep24xx.S        |    2 ++
>>>  arch/arm/mach-omap2/sleep34xx.S        |    2 ++
>>>  arch/arm/mach-omap2/sram242x.S         |    3 +++
>>>  arch/arm/mach-omap2/sram243x.S         |    3 +++
>>>  arch/arm/mach-omap2/sram34xx.S         |    1 +
>>>  arch/arm/plat-omap/include/plat/sram.h |   14 +-
>>>  arch/arm/plat-omap/sram.c              |   14 +-
>>>  11 files changed, 41 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
>>> index 56a6479..cd926dc 100644
>>> --- a/arch/arm/mach-omap1/pm.h
>>> +++ b/arch/arm/mach-omap1/pm.h
>>> @@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
>>>  extern void omap1_pm_idle(void);
>>>  extern void omap1_pm_suspend(void);
>>>
>>> -extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
>>> -extern void omap1510_cpu_suspend(unsigned short, unsigned short);
>>> -extern void omap1610_cpu_suspend(unsigned short, unsigned short);
>>> +extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
>>> +extern void omap1510_cpu_suspend(unsigned long, unsigned long);
>>> +extern void omap1610_cpu_suspend(unsigned long, unsigned long);
>>>  extern void omap7xx_idle_loop_suspend(void);
>>>  extern void omap1510_idle_loop_suspend(void);
>>>  extern void omap1610_idle_loop_suspend(void);
>>> diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
>>> index ef771ce..c875bdc 100644
>>> --- a/arch/arm/mach-omap1/sleep.S
>>> +++ b/arch/arm/mach-omap1/sleep.S
>>> @@ -58,6 +58,7 @@
>>>  */
>>>
>>>  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
>>> +       .align  3
>>>  ENTRY(omap7xx_cpu_suspend)
>>>
>>>        @ save registers on stack
>>> @@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
>>>  #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
>>>
>>>  #ifdef CONFIG_ARCH_OMAP15XX
>>> +       .align  3
>>>  ENTRY(omap1510_cpu_suspend)
>>>
>>>        @ save registers on stack
>>> @@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
>>>  #endif /* CONFIG_ARCH_OMAP15XX */
>>>
>>>  #if defined(CONFIG_ARCH_OMAP16XX)
>>> +       .align  3
>>>  ENTRY(omap1610_cpu_suspend)
>>>
>>>        @ save registers on stack
>>> diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
>>> index 7724e52..692587d 100644
>>> --- a/arch/arm/mach-omap1/sram.S
>>> +++ b/arch/arm/mach-omap1/sram.S
>>> @@ -18,6 +18,7 @@
>>>  /*
>>>  * Reprograms ULPD and CKCTL.
>>>  */
>>> +       .align  3
>>>  ENTRY(omap1_sram_reprogram_clock)
>>>        stmfd   sp!, {r0 - r12, lr}             @ save registers on stack
>>>
>>> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
>>> index 1c1b0ab..39580e6 100644
>>> --- a/arch/arm/mach-omap2/pm.h
>>> +++ b/arch/arm/mach-omap2/pm.h
>>> @@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
>>>  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem 
>>> *sdrc_dlla_ctrl,
>>>                                        void __iomem *sdrc_power);
>>>  extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
>>> -extern void save_secure_ram_context(u32 *addr);
>>> +extern int save_secure_ram_context(u32 *addr);
>>>  extern void omap3_save_scratchpad_contents(void);
>>>
>>>  extern unsigned int omap24xx_idle_loop_suspend_sz;
>>> diff --git a/arch/arm/mach-omap2/sleep24xx.S 
>>> b/arch/arm/mach-omap2/sleep24xx.S
>>> index c7780cc..b5071a4 100644
>>> --- a/arch/arm/mach-omap2/sleep24xx.S
>>> +++ b/arch/arm/mach-omap2/sleep24xx.S
>>> @@ -47,6 +47,7 @@
>>>  * Note: This code get's copied to internal SRAM at boot. When the OMAP
>>>  *      wakes up it continues execution at the point it went to sleep.
>>>  */
>>> +       .align  3
>>>  ENTRY(omap24xx_idle_loop_suspend)
>>>        stmfd   sp!, {r0, lr}           @ save registers on stack
>>>        mov     r0, #0                  @ clear for mcr setup
>>> @@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
>>>  * The DLL load value is not kept in RETENTION or OFF. It needs to be 
>>> restored
>>>  * at wake
>>>  */
>>> +       .align  3
>>>  ENTRY(omap24xx_cpu_suspend)
>>>        stmfd   sp!, {r0 - r12, lr}     @ save regi

Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-24 Thread Jean Pihet
Hi,

On Mon, Jan 24, 2011 at 5:11 PM, Dave Martin  wrote:
> Hi there, I just spotted a couple of things merging your patch...
>
> On Tue, Jan 18, 2011 at 12:02 PM,   wrote:
>> From: Jean Pihet 
>>
>> The new fncpy API is better suited for copying some
>> code to SRAM at runtime. This patch changes the ad-hoc
>> code to the more generic fncpy API.
>>
>> Tested OK on OMAP3 in low power modes (RET/OFF)
>> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
>> Compile tested on OMAP1/2 using omap1_defconfig.
>>
>> Signed-off-by: Jean Pihet 
>> ---
>>  arch/arm/mach-omap1/pm.h               |    6 +++---
>>  arch/arm/mach-omap1/sleep.S            |    3 +++
>>  arch/arm/mach-omap1/sram.S             |    1 +
>>  arch/arm/mach-omap2/pm.h               |    2 +-
>>  arch/arm/mach-omap2/sleep24xx.S        |    2 ++
>>  arch/arm/mach-omap2/sleep34xx.S        |    2 ++
>>  arch/arm/mach-omap2/sram242x.S         |    3 +++
>>  arch/arm/mach-omap2/sram243x.S         |    3 +++
>>  arch/arm/mach-omap2/sram34xx.S         |    1 +
>>  arch/arm/plat-omap/include/plat/sram.h |   14 +-
>>  arch/arm/plat-omap/sram.c              |   14 +-
>>  11 files changed, 41 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
>> index 56a6479..cd926dc 100644
>> --- a/arch/arm/mach-omap1/pm.h
>> +++ b/arch/arm/mach-omap1/pm.h
>> @@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
>>  extern void omap1_pm_idle(void);
>>  extern void omap1_pm_suspend(void);
>>
>> -extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
>> -extern void omap1510_cpu_suspend(unsigned short, unsigned short);
>> -extern void omap1610_cpu_suspend(unsigned short, unsigned short);
>> +extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
>> +extern void omap1510_cpu_suspend(unsigned long, unsigned long);
>> +extern void omap1610_cpu_suspend(unsigned long, unsigned long);
>>  extern void omap7xx_idle_loop_suspend(void);
>>  extern void omap1510_idle_loop_suspend(void);
>>  extern void omap1610_idle_loop_suspend(void);
>> diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
>> index ef771ce..c875bdc 100644
>> --- a/arch/arm/mach-omap1/sleep.S
>> +++ b/arch/arm/mach-omap1/sleep.S
>> @@ -58,6 +58,7 @@
>>  */
>>
>>  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
>> +       .align  3
>>  ENTRY(omap7xx_cpu_suspend)
>>
>>        @ save registers on stack
>> @@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
>>  #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
>>
>>  #ifdef CONFIG_ARCH_OMAP15XX
>> +       .align  3
>>  ENTRY(omap1510_cpu_suspend)
>>
>>        @ save registers on stack
>> @@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
>>  #endif /* CONFIG_ARCH_OMAP15XX */
>>
>>  #if defined(CONFIG_ARCH_OMAP16XX)
>> +       .align  3
>>  ENTRY(omap1610_cpu_suspend)
>>
>>        @ save registers on stack
>> diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
>> index 7724e52..692587d 100644
>> --- a/arch/arm/mach-omap1/sram.S
>> +++ b/arch/arm/mach-omap1/sram.S
>> @@ -18,6 +18,7 @@
>>  /*
>>  * Reprograms ULPD and CKCTL.
>>  */
>> +       .align  3
>>  ENTRY(omap1_sram_reprogram_clock)
>>        stmfd   sp!, {r0 - r12, lr}             @ save registers on stack
>>
>> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
>> index 1c1b0ab..39580e6 100644
>> --- a/arch/arm/mach-omap2/pm.h
>> +++ b/arch/arm/mach-omap2/pm.h
>> @@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
>>  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
>>                                        void __iomem *sdrc_power);
>>  extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
>> -extern void save_secure_ram_context(u32 *addr);
>> +extern int save_secure_ram_context(u32 *addr);
>>  extern void omap3_save_scratchpad_contents(void);
>>
>>  extern unsigned int omap24xx_idle_loop_suspend_sz;
>> diff --git a/arch/arm/mach-omap2/sleep24xx.S 
>> b/arch/arm/mach-omap2/sleep24xx.S
>> index c7780cc..b5071a4 100644
>> --- a/arch/arm/mach-omap2/sleep24xx.S
>> +++ b/arch/arm/mach-omap2/sleep24xx.S
>> @@ -47,6 +47,7 @@
>>  * Note: This code get's copied to internal SRAM at boot. When the OMAP
>>  *      wakes up it continues execution at the point it went to sleep.
>>  */
>> +       .align  3
>>  ENTRY(omap24xx_idle_loop_suspend)
>>        stmfd   sp!, {r0, lr}           @ save registers on stack
>>        mov     r0, #0                  @ clear for mcr setup
>> @@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
>>  * The DLL load value is not kept in RETENTION or OFF. It needs to be 
>> restored
>>  * at wake
>>  */
>> +       .align  3
>>  ENTRY(omap24xx_cpu_suspend)
>>        stmfd   sp!, {r0 - r12, lr}     @ save registers on stack
>>        mov     r3, #0x0                @ clear for mcr call
>> diff --git a/arch/arm/mach-omap2/sleep34xx.S 
>> b/arch/arm/mach-omap2/sleep34xx.S
>> index 98d8232.

Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-24 Thread Dave Martin
Hi there, I just spotted a couple of things merging your patch...

On Tue, Jan 18, 2011 at 12:02 PM,   wrote:
> From: Jean Pihet 
>
> The new fncpy API is better suited for copying some
> code to SRAM at runtime. This patch changes the ad-hoc
> code to the more generic fncpy API.
>
> Tested OK on OMAP3 in low power modes (RET/OFF)
> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
> Compile tested on OMAP1/2 using omap1_defconfig.
>
> Signed-off-by: Jean Pihet 
> ---
>  arch/arm/mach-omap1/pm.h               |    6 +++---
>  arch/arm/mach-omap1/sleep.S            |    3 +++
>  arch/arm/mach-omap1/sram.S             |    1 +
>  arch/arm/mach-omap2/pm.h               |    2 +-
>  arch/arm/mach-omap2/sleep24xx.S        |    2 ++
>  arch/arm/mach-omap2/sleep34xx.S        |    2 ++
>  arch/arm/mach-omap2/sram242x.S         |    3 +++
>  arch/arm/mach-omap2/sram243x.S         |    3 +++
>  arch/arm/mach-omap2/sram34xx.S         |    1 +
>  arch/arm/plat-omap/include/plat/sram.h |   14 +-
>  arch/arm/plat-omap/sram.c              |   14 +-
>  11 files changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
> index 56a6479..cd926dc 100644
> --- a/arch/arm/mach-omap1/pm.h
> +++ b/arch/arm/mach-omap1/pm.h
> @@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
>  extern void omap1_pm_idle(void);
>  extern void omap1_pm_suspend(void);
>
> -extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
> -extern void omap1510_cpu_suspend(unsigned short, unsigned short);
> -extern void omap1610_cpu_suspend(unsigned short, unsigned short);
> +extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
> +extern void omap1510_cpu_suspend(unsigned long, unsigned long);
> +extern void omap1610_cpu_suspend(unsigned long, unsigned long);
>  extern void omap7xx_idle_loop_suspend(void);
>  extern void omap1510_idle_loop_suspend(void);
>  extern void omap1610_idle_loop_suspend(void);
> diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
> index ef771ce..c875bdc 100644
> --- a/arch/arm/mach-omap1/sleep.S
> +++ b/arch/arm/mach-omap1/sleep.S
> @@ -58,6 +58,7 @@
>  */
>
>  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
> +       .align  3
>  ENTRY(omap7xx_cpu_suspend)
>
>        @ save registers on stack
> @@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
>  #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
>
>  #ifdef CONFIG_ARCH_OMAP15XX
> +       .align  3
>  ENTRY(omap1510_cpu_suspend)
>
>        @ save registers on stack
> @@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
>  #endif /* CONFIG_ARCH_OMAP15XX */
>
>  #if defined(CONFIG_ARCH_OMAP16XX)
> +       .align  3
>  ENTRY(omap1610_cpu_suspend)
>
>        @ save registers on stack
> diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
> index 7724e52..692587d 100644
> --- a/arch/arm/mach-omap1/sram.S
> +++ b/arch/arm/mach-omap1/sram.S
> @@ -18,6 +18,7 @@
>  /*
>  * Reprograms ULPD and CKCTL.
>  */
> +       .align  3
>  ENTRY(omap1_sram_reprogram_clock)
>        stmfd   sp!, {r0 - r12, lr}             @ save registers on stack
>
> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
> index 1c1b0ab..39580e6 100644
> --- a/arch/arm/mach-omap2/pm.h
> +++ b/arch/arm/mach-omap2/pm.h
> @@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
>  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
>                                        void __iomem *sdrc_power);
>  extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
> -extern void save_secure_ram_context(u32 *addr);
> +extern int save_secure_ram_context(u32 *addr);
>  extern void omap3_save_scratchpad_contents(void);
>
>  extern unsigned int omap24xx_idle_loop_suspend_sz;
> diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
> index c7780cc..b5071a4 100644
> --- a/arch/arm/mach-omap2/sleep24xx.S
> +++ b/arch/arm/mach-omap2/sleep24xx.S
> @@ -47,6 +47,7 @@
>  * Note: This code get's copied to internal SRAM at boot. When the OMAP
>  *      wakes up it continues execution at the point it went to sleep.
>  */
> +       .align  3
>  ENTRY(omap24xx_idle_loop_suspend)
>        stmfd   sp!, {r0, lr}           @ save registers on stack
>        mov     r0, #0                  @ clear for mcr setup
> @@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
>  * The DLL load value is not kept in RETENTION or OFF. It needs to be restored
>  * at wake
>  */
> +       .align  3
>  ENTRY(omap24xx_cpu_suspend)
>        stmfd   sp!, {r0 - r12, lr}     @ save registers on stack
>        mov     r3, #0x0                @ clear for mcr call
> diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
> index 98d8232..951a0be 100644
> --- a/arch/arm/mach-omap2/sleep34xx.S
> +++ b/arch/arm/mach-omap2/sleep34xx.S
> @@ -118,6 +118,7 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
>
>        .text
>  /* Functio

Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-20 Thread Jean Pihet
On Wed, Jan 19, 2011 at 11:10 PM, Tony Lindgren  wrote:
> * Kevin Hilman  [110119 13:37]:
>> Kevin Hilman  writes:
>>
>> > jean.pi...@newoldbits.com writes:
>> >
>> >> From: Jean Pihet 
>> >>
>> >> The new fncpy API is better suited for copying some
>> >> code to SRAM at runtime. This patch changes the ad-hoc
>> >> code to the more generic fncpy API.
>> >>
>> >> Tested OK on OMAP3 in low power modes (RET/OFF)
>> >> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
>> >> Compile tested on OMAP1/2 using omap1_defconfig.
>> >>
>> >> Signed-off-by: Jean Pihet 
>> >
>> > Acked-by: Kevin Hilman 
>> >
>> > Boot tested on OMAP1 & OMAP2 as well.  Note that neither OMAP1 or OMAP2
>> > has had working suspend/resume for a long time now, so I did not test
>> > suspend/resume.
>>
>> For OMAP2:
>>
>> Tested-by: Kevin Hilman 
>>
>> to test a little more on OMAP2, I just removed the WFI from the
>> low-level code and tested suspend that way.  That's enough to be sure
>> the copied code is copied and executed.
>>
>> Worked fine on OMAP2420/n810.
>>
>> For OMAP1, this didn't work and would require more serious hacking on
>> the OMAP1 suspend path, which I currently have no plans to do.
>
> Boots fine on osk5912 and n800 too:
>
> Tested-by: Tony Lindgren 
>

Thanks for testing!

Regards,
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-19 Thread Tony Lindgren
* Kevin Hilman  [110119 13:37]:
> Kevin Hilman  writes:
> 
> > jean.pi...@newoldbits.com writes:
> >
> >> From: Jean Pihet 
> >>
> >> The new fncpy API is better suited for copying some
> >> code to SRAM at runtime. This patch changes the ad-hoc
> >> code to the more generic fncpy API.
> >>
> >> Tested OK on OMAP3 in low power modes (RET/OFF)
> >> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
> >> Compile tested on OMAP1/2 using omap1_defconfig.
> >>
> >> Signed-off-by: Jean Pihet 
> >
> > Acked-by: Kevin Hilman 
> >
> > Boot tested on OMAP1 & OMAP2 as well.  Note that neither OMAP1 or OMAP2
> > has had working suspend/resume for a long time now, so I did not test
> > suspend/resume.
> 
> For OMAP2:
> 
> Tested-by: Kevin Hilman 
> 
> to test a little more on OMAP2, I just removed the WFI from the
> low-level code and tested suspend that way.  That's enough to be sure
> the copied code is copied and executed.
> 
> Worked fine on OMAP2420/n810.
> 
> For OMAP1, this didn't work and would require more serious hacking on
> the OMAP1 suspend path, which I currently have no plans to do.

Boots fine on osk5912 and n800 too:

Tested-by: Tony Lindgren 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-19 Thread Kevin Hilman
Kevin Hilman  writes:

> jean.pi...@newoldbits.com writes:
>
>> From: Jean Pihet 
>>
>> The new fncpy API is better suited for copying some
>> code to SRAM at runtime. This patch changes the ad-hoc
>> code to the more generic fncpy API.
>>
>> Tested OK on OMAP3 in low power modes (RET/OFF)
>> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
>> Compile tested on OMAP1/2 using omap1_defconfig.
>>
>> Signed-off-by: Jean Pihet 
>
> Acked-by: Kevin Hilman 
>
> Boot tested on OMAP1 & OMAP2 as well.  Note that neither OMAP1 or OMAP2
> has had working suspend/resume for a long time now, so I did not test
> suspend/resume.

For OMAP2:

Tested-by: Kevin Hilman 

to test a little more on OMAP2, I just removed the WFI from the
low-level code and tested suspend that way.  That's enough to be sure
the copied code is copied and executed.

Worked fine on OMAP2420/n810.

For OMAP1, this didn't work and would require more serious hacking on
the OMAP1 suspend path, which I currently have no plans to do.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-19 Thread Kevin Hilman
jean.pi...@newoldbits.com writes:

> From: Jean Pihet 
>
> The new fncpy API is better suited for copying some
> code to SRAM at runtime. This patch changes the ad-hoc
> code to the more generic fncpy API.
>
> Tested OK on OMAP3 in low power modes (RET/OFF)
> using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
> Compile tested on OMAP1/2 using omap1_defconfig.
>
> Signed-off-by: Jean Pihet 

Acked-by: Kevin Hilman 

Boot tested on OMAP1 & OMAP2 as well.  Note that neither OMAP1 or OMAP2
has had working suspend/resume for a long time now, so I did not test
suspend/resume.

Kevin

> ---
>  arch/arm/mach-omap1/pm.h   |6 +++---
>  arch/arm/mach-omap1/sleep.S|3 +++
>  arch/arm/mach-omap1/sram.S |1 +
>  arch/arm/mach-omap2/pm.h   |2 +-
>  arch/arm/mach-omap2/sleep24xx.S|2 ++
>  arch/arm/mach-omap2/sleep34xx.S|2 ++
>  arch/arm/mach-omap2/sram242x.S |3 +++
>  arch/arm/mach-omap2/sram243x.S |3 +++
>  arch/arm/mach-omap2/sram34xx.S |1 +
>  arch/arm/plat-omap/include/plat/sram.h |   14 +-
>  arch/arm/plat-omap/sram.c  |   14 +-
>  11 files changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
> index 56a6479..cd926dc 100644
> --- a/arch/arm/mach-omap1/pm.h
> +++ b/arch/arm/mach-omap1/pm.h
> @@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
>  extern void omap1_pm_idle(void);
>  extern void omap1_pm_suspend(void);
>  
> -extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
> -extern void omap1510_cpu_suspend(unsigned short, unsigned short);
> -extern void omap1610_cpu_suspend(unsigned short, unsigned short);
> +extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
> +extern void omap1510_cpu_suspend(unsigned long, unsigned long);
> +extern void omap1610_cpu_suspend(unsigned long, unsigned long);
>  extern void omap7xx_idle_loop_suspend(void);
>  extern void omap1510_idle_loop_suspend(void);
>  extern void omap1610_idle_loop_suspend(void);
> diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
> index ef771ce..c875bdc 100644
> --- a/arch/arm/mach-omap1/sleep.S
> +++ b/arch/arm/mach-omap1/sleep.S
> @@ -58,6 +58,7 @@
>   */
>  
>  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
> + .align  3
>  ENTRY(omap7xx_cpu_suspend)
>  
>   @ save registers on stack
> @@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
>  #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
>  
>  #ifdef CONFIG_ARCH_OMAP15XX
> + .align  3
>  ENTRY(omap1510_cpu_suspend)
>  
>   @ save registers on stack
> @@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
>  #endif /* CONFIG_ARCH_OMAP15XX */
>  
>  #if defined(CONFIG_ARCH_OMAP16XX)
> + .align  3
>  ENTRY(omap1610_cpu_suspend)
>  
>   @ save registers on stack
> diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
> index 7724e52..692587d 100644
> --- a/arch/arm/mach-omap1/sram.S
> +++ b/arch/arm/mach-omap1/sram.S
> @@ -18,6 +18,7 @@
>  /*
>   * Reprograms ULPD and CKCTL.
>   */
> + .align  3
>  ENTRY(omap1_sram_reprogram_clock)
>   stmfd   sp!, {r0 - r12, lr} @ save registers on stack
>  
> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
> index 1c1b0ab..39580e6 100644
> --- a/arch/arm/mach-omap2/pm.h
> +++ b/arch/arm/mach-omap2/pm.h
> @@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
>  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
>   void __iomem *sdrc_power);
>  extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
> -extern void save_secure_ram_context(u32 *addr);
> +extern int save_secure_ram_context(u32 *addr);
>  extern void omap3_save_scratchpad_contents(void);
>  
>  extern unsigned int omap24xx_idle_loop_suspend_sz;
> diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
> index c7780cc..b5071a4 100644
> --- a/arch/arm/mach-omap2/sleep24xx.S
> +++ b/arch/arm/mach-omap2/sleep24xx.S
> @@ -47,6 +47,7 @@
>   * Note: This code get's copied to internal SRAM at boot. When the OMAP
>   *wakes up it continues execution at the point it went to sleep.
>   */
> + .align  3
>  ENTRY(omap24xx_idle_loop_suspend)
>   stmfd   sp!, {r0, lr}   @ save registers on stack
>   mov r0, #0  @ clear for mcr setup
> @@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
>   * The DLL load value is not kept in RETENTION or OFF.   It needs to be 
> restored
>   * at wake
>   */
> + .align  3
>  ENTRY(omap24xx_cpu_suspend)
>   stmfd   sp!, {r0 - r12, lr} @ save registers on stack
>   mov r3, #0x0@ clear for mcr call
> diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
> index 98d8232..951a0be 100644
> --- a/arch/arm/mach-omap2/sleep34xx.S
> +++ 

[PATCH v2] OMAP: use fncpy to copy the PM code functions to SRAM

2011-01-18 Thread jean . pihet
From: Jean Pihet 

The new fncpy API is better suited for copying some
code to SRAM at runtime. This patch changes the ad-hoc
code to the more generic fncpy API.

Tested OK on OMAP3 in low power modes (RET/OFF)
using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL.
Compile tested on OMAP1/2 using omap1_defconfig.

Signed-off-by: Jean Pihet 
---
 arch/arm/mach-omap1/pm.h   |6 +++---
 arch/arm/mach-omap1/sleep.S|3 +++
 arch/arm/mach-omap1/sram.S |1 +
 arch/arm/mach-omap2/pm.h   |2 +-
 arch/arm/mach-omap2/sleep24xx.S|2 ++
 arch/arm/mach-omap2/sleep34xx.S|2 ++
 arch/arm/mach-omap2/sram242x.S |3 +++
 arch/arm/mach-omap2/sram243x.S |3 +++
 arch/arm/mach-omap2/sram34xx.S |1 +
 arch/arm/plat-omap/include/plat/sram.h |   14 +-
 arch/arm/plat-omap/sram.c  |   14 +-
 11 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
index 56a6479..cd926dc 100644
--- a/arch/arm/mach-omap1/pm.h
+++ b/arch/arm/mach-omap1/pm.h
@@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
 extern void omap1_pm_idle(void);
 extern void omap1_pm_suspend(void);
 
-extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
-extern void omap1510_cpu_suspend(unsigned short, unsigned short);
-extern void omap1610_cpu_suspend(unsigned short, unsigned short);
+extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
+extern void omap1510_cpu_suspend(unsigned long, unsigned long);
+extern void omap1610_cpu_suspend(unsigned long, unsigned long);
 extern void omap7xx_idle_loop_suspend(void);
 extern void omap1510_idle_loop_suspend(void);
 extern void omap1610_idle_loop_suspend(void);
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index ef771ce..c875bdc 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -58,6 +58,7 @@
  */
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
+   .align  3
 ENTRY(omap7xx_cpu_suspend)
 
@ save registers on stack
@@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
 #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
 
 #ifdef CONFIG_ARCH_OMAP15XX
+   .align  3
 ENTRY(omap1510_cpu_suspend)
 
@ save registers on stack
@@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
 #endif /* CONFIG_ARCH_OMAP15XX */
 
 #if defined(CONFIG_ARCH_OMAP16XX)
+   .align  3
 ENTRY(omap1610_cpu_suspend)
 
@ save registers on stack
diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
index 7724e52..692587d 100644
--- a/arch/arm/mach-omap1/sram.S
+++ b/arch/arm/mach-omap1/sram.S
@@ -18,6 +18,7 @@
 /*
  * Reprograms ULPD and CKCTL.
  */
+   .align  3
 ENTRY(omap1_sram_reprogram_clock)
stmfd   sp!, {r0 - r12, lr} @ save registers on stack
 
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 1c1b0ab..39580e6 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
 extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
void __iomem *sdrc_power);
 extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
-extern void save_secure_ram_context(u32 *addr);
+extern int save_secure_ram_context(u32 *addr);
 extern void omap3_save_scratchpad_contents(void);
 
 extern unsigned int omap24xx_idle_loop_suspend_sz;
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index c7780cc..b5071a4 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -47,6 +47,7 @@
  * Note: This code get's copied to internal SRAM at boot. When the OMAP
  *  wakes up it continues execution at the point it went to sleep.
  */
+   .align  3
 ENTRY(omap24xx_idle_loop_suspend)
stmfd   sp!, {r0, lr}   @ save registers on stack
mov r0, #0  @ clear for mcr setup
@@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
  * The DLL load value is not kept in RETENTION or OFF. It needs to be restored
  * at wake
  */
+   .align  3
 ENTRY(omap24xx_cpu_suspend)
stmfd   sp!, {r0 - r12, lr} @ save registers on stack
mov r3, #0x0@ clear for mcr call
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 98d8232..951a0be 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -118,6 +118,7 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
 
.text
 /* Function to call rom code to save secure ram context */
+   .align  3
 ENTRY(save_secure_ram_context)
stmfd   sp!, {r1-r12, lr}   @ save registers on stack
adr r3, api_params  @ r3 points to parameters
@@ -169,6 +170,7 @@ ENTRY(save_secure_ram_context_sz)
  *   depending on the low p