Re: [PATCHv2 1/2] ARM: VFP: Fixed suspend and added context save support

2010-05-13 Thread ye janboe
+ peoples who are in CC list.

Janboe Ye

2010/5/13 ye janboe :
> Thanks for Russell and Tony.
>
> I think this patch is needed when MPU support OFF mode, special on
> omap. Otherwise, VFP state will be lost.
>
> Reviewed-by: Janboe Ye 
>
> 2010/5/12 Russell King - ARM Linux :
>> On Tue, May 11, 2010 at 11:15:13AM +0800, ye janboe wrote:
>>> Is this patch ignored by you? I do not see any ack for this patch.
>>
>> Patch is fine, shame some of the people on the Cc haven't acked it though.
>> Can we get acks from anyone of those, and then submit it to the patch
>> system?
>>
>>> > Signed-off-by: Tero Kristo 
>>> > Cc: Vishwanath Sripathy 
>>> > Cc: Rajendra Nayak 
>>> > Cc: Richard Woodruff 
>>> > Cc: Peter 'p2' De Schrijver 
>>
>
--
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: [PATCHv2 1/2] ARM: VFP: Fixed suspend and added context save support

2010-05-12 Thread ye janboe
Thanks for Russell and Tony.

I think this patch is needed when MPU support OFF mode, special on
omap. Otherwise, VFP state will be lost.

Reviewed-by: Janboe Ye 

2010/5/12 Russell King - ARM Linux :
> On Tue, May 11, 2010 at 11:15:13AM +0800, ye janboe wrote:
>> Is this patch ignored by you? I do not see any ack for this patch.
>
> Patch is fine, shame some of the people on the Cc haven't acked it though.
> Can we get acks from anyone of those, and then submit it to the patch
> system?
>
>> > Signed-off-by: Tero Kristo 
>> > Cc: Vishwanath Sripathy 
>> > Cc: Rajendra Nayak 
>> > Cc: Richard Woodruff 
>> > Cc: Peter 'p2' De Schrijver 
>
--
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: [PATCHv2 1/2] ARM: VFP: Fixed suspend and added context save support

2010-05-10 Thread ye janboe
hi, Russell, Tony

Is this patch ignored by you? I do not see any ack for this patch.

Thanks

Janboe Ye

2009/12/3 Tero Kristo :
> From: Tero Kristo 
>
> In some ARM architectures, like OMAP3, the VFP context can be lost during
> dynamic sleep cycle. For this purpose, there is now a function
> vfp_pm_save_context() that should be called before the VFP is assumed to
> lose context. Next VFP trap will then restore context automatically.
>
> We need to have the last_VFP_context[cpu] cleared after the save in idle,
> else the restore would fail to restore when it sees that the last_VFP_context
> is same as the current threads vfp_state. This happens when the same
> process/thread traps an exception post idle.
>
> This patch also fixes a potential problem with vfp_pm_suspend(), where
> VFP context can be lost if the current process does not have VFP enabled.
> Fixed by calling vfp_pm_save_context().
>
> Signed-off-by: Tero Kristo 
> Cc: Vishwanath Sripathy 
> Cc: Rajendra Nayak 
> Cc: Richard Woodruff 
> Cc: Peter 'p2' De Schrijver 
> ---
>  arch/arm/vfp/vfpmodule.c |   28 
>  1 files changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 2d7423a..920a33b 100644
> --- a/arch/arm/vfp/vfpmodule.c
> +++ b/arch/arm/vfp/vfpmodule.c
> @@ -329,22 +329,34 @@ static void vfp_enable(void *unused)
>  #ifdef CONFIG_PM
>  #include 
>
> -static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
> +void vfp_pm_save_context(void)
>  {
> -       struct thread_info *ti = current_thread_info();
>        u32 fpexc = fmrx(FPEXC);
> +       unsigned int cpu = get_cpu();
> +
> +       /* Save last_VFP_context if needed */
> +       if (last_VFP_context[cpu]) {
> +               /* Enable vfp to save context */
> +               if (!(fpexc & FPEXC_EN)) {
> +                       vfp_enable(NULL);
> +                       fmxr(FPEXC, fpexc | FPEXC_EN);
> +               }
>
> -       /* if vfp is on, then save state for resumption */
> -       if (fpexc & FPEXC_EN) {
>                printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
> -               vfp_save_state(&ti->vfpstate, fpexc);
> +               vfp_save_state(last_VFP_context[cpu], fpexc);
>
>                /* disable, just in case */
> -               fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
> +               fmxr(FPEXC, fpexc & ~FPEXC_EN);
> +
> +               last_VFP_context[cpu] = NULL;
>        }
>
> -       /* clear any information we had about last context state */
> -       memset(last_VFP_context, 0, sizeof(last_VFP_context));
> +       put_cpu();
> +}
> +
> +static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
> +{
> +       vfp_pm_save_context();
>
>        return 0;
>  }
> --
> 1.5.4.3
>
> --
> 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
>
--
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


[PATCH] OMAP SRAM: flush the right address after memcpy in omap_sram_push

2009-08-28 Thread ye janboe
the original flush operation is to flush the function address which is
copied from.
But we do not change the function code and it is not necessary to flush it.

Signed-off-by: janboe 
---
 arch/arm/plat-omap/sram.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index f2b0fa6..f549d8a 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -270,7 +270,8 @@ void * omap_sram_push(void * start, unsigned long size)
omap_sram_ceil -= size;
omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *));
memcpy((void *)omap_sram_ceil, start, size);
-   flush_icache_range((unsigned long)start, (unsigned long)(start + size));
+   flush_icache_range((unsigned long)omap_sram_ceil,
+   (unsigned long)(omap_sram_ceil + size));

return (void *)omap_sram_ceil;
 }
--
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] flush the function in sdram is not correct because sram is changed.

2009-08-28 Thread ye janboe
Hi, Paul

I resent the patch after fix the format issue.

Please help to review it.

Thanks

Janboe

2009/8/28 Paul Walmsley :
> Hello janboe,
>
> On Fri, 28 Aug 2009, ye janboe wrote:
>
>> >From f10090bf307066f1317d7152c6f9a6f395007d4a Mon Sep 17 00:00:00 2001
>> From: janboe 
>> Date: Fri, 28 Aug 2009 13:50:57 +0800
>> Subject: [PATCH] flush the function in sdram is not correct because
>> sram is changed.
>>
>> Signed-off-by: janboe 
>
> The technical part of the patch makes sense, but the patch format needs
> to be changed.
>
> Your subject line should start with something like "[PATCH] OMAP SRAM:",
> and you should add a short patch description that describes the bug and
> why the patch does what it does to fix it.
>
> Also your post should not include the "From", "Date", and "Subject" lines
> inside the E-mail.  You might wish to consider using 'git send-email' or
> at least 'git format-patch' if possible.
>
>
> - Paul
>
>> ---
>>  arch/arm/plat-omap/sram.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
>> index f2b0fa6..253fcf7 100644
>> --- a/arch/arm/plat-omap/sram.c
>> +++ b/arch/arm/plat-omap/sram.c
>> @@ -270,7 +270,7 @@ void * omap_sram_push(void * start, unsigned long size)
>>         omap_sram_ceil -= size;
>>         omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *));
>>         memcpy((void *)omap_sram_ceil, start, size);
>> -       flush_icache_range((unsigned long)start, (unsigned long)(start + 
>> size));
>> +       flush_icache_range((unsigned long)omap_sram_ceil, (unsigned
>> long)(omap_sram_ceil + size));
>>
>>         return (void *)omap_sram_ceil;
>>  }
>> --
>> 1.6.3.3
>>
>
>
>
--
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


[PATCH] flush the right address after memcpy in omap_sram_push

2009-08-28 Thread ye janboe
Signed-off-by: janboe 
---
 arch/arm/plat-omap/sram.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index f2b0fa6..f549d8a 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -270,7 +270,8 @@ void * omap_sram_push(void * start, unsigned long size)
omap_sram_ceil -= size;
omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *));
memcpy((void *)omap_sram_ceil, start, size);
-   flush_icache_range((unsigned long)start, (unsigned long)(start + size));
+   flush_icache_range((unsigned long)omap_sram_ceil,
+   (unsigned long)(omap_sram_ceil + size));

return (void *)omap_sram_ceil;
 }
--
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


[PATCH] flush the function in sdram is not correct because sram is changed.

2009-08-27 Thread ye janboe
resend because little format issue.

>From fc5e771b808b5bf094846051a1c59c7e5e8ec149 Mon Sep 17 00:00:00 2001
From: janboe 
Date: Fri, 28 Aug 2009 13:50:57 +0800
Subject: [PATCH] flush the function in sdram is not correct because
sram is changed.

Signed-off-by: janboe 
---
 arch/arm/plat-omap/sram.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index f2b0fa6..f549d8a 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -270,7 +270,8 @@ void * omap_sram_push(void * start, unsigned long size)
omap_sram_ceil -= size;
omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *));
memcpy((void *)omap_sram_ceil, start, size);
-   flush_icache_range((unsigned long)start, (unsigned long)(start + size));
+   flush_icache_range((unsigned long)omap_sram_ceil,
+   (unsigned long)(omap_sram_ceil + size));

return (void *)omap_sram_ceil;
 }
-- 
1.6.3.3
--
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


[PATCH] flush the function in sdram is not correct because sram is changed.

2009-08-27 Thread ye janboe
>From f10090bf307066f1317d7152c6f9a6f395007d4a Mon Sep 17 00:00:00 2001
From: janboe 
Date: Fri, 28 Aug 2009 13:50:57 +0800
Subject: [PATCH] flush the function in sdram is not correct because
sram is changed.

Signed-off-by: janboe 
---
 arch/arm/plat-omap/sram.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index f2b0fa6..253fcf7 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -270,7 +270,7 @@ void * omap_sram_push(void * start, unsigned long size)
omap_sram_ceil -= size;
omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *));
memcpy((void *)omap_sram_ceil, start, size);
-   flush_icache_range((unsigned long)start, (unsigned long)(start + size));
+   flush_icache_range((unsigned long)omap_sram_ceil, (unsigned
long)(omap_sram_ceil + size));

return (void *)omap_sram_ceil;
 }
-- 
1.6.3.3
--
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


[PATCH] Clear the SDRC_POWER.PWRENA bit before putting the SDRAM into self-refresh before suspend

2009-07-07 Thread ye janboe
Hi, Paul

I saw you clear clear the SDRC PWRENA bit during SDRC frequency change
but not during suspend.

Please review if it is necessary to clear PWRENA bit during suspend.

Thanks

Janboe Ye

rom 287db2e188391be0ac95128131724e0e035e945a Mon Sep 17 00:00:00 2001
From: janboe 
Date: Tue, 7 Jul 2009 16:30:26 -0500
Subject: [PATCH] Clear the SDRC_POWER.PWRENA bit before putting the
SDRAM into self-refresh and then suspend

Signed-off-by: janboe 
---
 arch/arm/mach-omap2/sleep34xx.S |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index e5e2553..2bc0c3b 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -70,6 +70,7 @@ loop:
ldr r4, sdrc_power  @ read the SDRC_POWER register
ldr r5, [r4]@ read the contents of SDRC_POWER
orr r5, r5, #0x40   @ enable self refresh on idle req
+   bic r5, r5, #0x4@ clear PWDENA
str r5, [r4]@ write back to SDRC_POWER register

cmp r1, #0x0
-- 
1.6.3.1
--
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


[PATCH] initialize gpio debounce register

2009-06-19 Thread ye janboe
Hi,
some bootloader may initialize debounce register and this will make
dbclk not consist with the debounce register after linux kernel boot
up.

>From 8f97e5b50e50627e9e4b40f5d4fba09d750aceb1 Mon Sep 17 00:00:00 2001
From: janboe 
Date: Fri, 19 Jun 2009 10:56:02 -0500
Subject: [PATCH] initialize gpio debounce register

Signed-off-by: janboe 
---
 arch/arm/plat-omap/gpio.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7fd89ba..26b387c 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1585,6 +1585,7 @@ static int __init _omap_gpio_init(void)
__raw_writel(0x, bank->base + 
OMAP24XX_GPIO_IRQENABLE1);
__raw_writel(0x, bank->base + 
OMAP24XX_GPIO_IRQSTATUS1);
__raw_writew(0x0015, bank->base + 
OMAP24XX_GPIO_SYSCONFIG);
+   __raw_writel(0x, bank->base + 
OMAP24XX_GPIO_DEBOUNCE_EN);

/* Initialize interface clock ungated, module enabled */
__raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
--
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