Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-11-25 Thread MyungJoo Ham
On Wed, Jun 30, 2010 at 11:28 PM, Hiroshi DOYU  wrote:
> From: Hiroshi DOYU 
>
> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
>
> Based on the original work from Romit and Raghu at TI. The original
> patch(*1) was sent to LOML by Teerth Reddy 
>
> *1: https://patchwork.kernel.org/patch/96442/
>
> Signed-off-by: Hiroshi DOYU 

(snip)

> +config ARCH_HIBERNATION_POSSIBLE
> +       def_bool y
> +       depends on CPU_V7 && !SMP
> +

(snip)

> +/*
> + * FIXME: Only support for Cortex A8 now
> + */

(snip)

> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -149,7 +149,6 @@ SECTIONS
>                __init_end = .;
>  #endif
>
> -               NOSAVE_DATA
>                CACHELINE_ALIGNED_DATA(32)
>
>                /*
> @@ -172,6 +171,8 @@ SECTIONS
>        }
>        _edata_loc = __data_loc + SIZEOF(.data);
>
> +       NOSAVE_DATA
> +
>  #ifdef CONFIG_HAVE_TCM
>         /*
>         * We align everything to a page boundary so we can
> --

I have been working on the hibernation feature on S5PC210 (ARM Cortex
A9 MP-Core) based on this patch and it's working find with minor
modifications. (and will send as soon as clutters are removed and
tested further)

However, I've got a question on your patch: is it really necessary to
patch [arch/arm/kernel/vmlinux.lds.S] file? Without patching that
file, it works fine at my system (although it's based on 2.6.36, not
37 rc #) and with that patch, the linker spits an error. If it's
necessary to patch [arch/arm/kernel/vmlinux.lds.S], could you please
explain a bit about it?

Thank you.


- MyungJoo

> 1.7.1.rc2
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>



-- 
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-08-30 Thread Kevin Hilman
On Fri, 2010-07-16 at 12:10 +0300, Hiroshi DOYU wrote:
> From: ext Russell King - ARM Linux 
> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> Date: Fri, 16 Jul 2010 09:52:44 +0200
> 
> > On Thu, Jul 15, 2010 at 12:08:07PM +0300, Hiroshi DOYU wrote:
> >> From: ext Russell King - ARM Linux 
> >> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> >> Date: Thu, 15 Jul 2010 10:41:18 +0200
> >> 
> >> > On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
> >> >> Russell, would it be possible to put this into your next merge queue?
> >> > 
> >> > I think it needs quite a bit of rework - I certainly don't like all
> >> > those CP15 register accesses there - that's asking for lots of ifdefs
> >> > to spring up as more CPUs are supported.
> >> >
> >> > Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
> >> > properly restored?
> >> 
> >> Right. This arch specific part can be something like
> >> "suspend-v[3-7].S" to accomodate those differences
> > 
> > It's not quite that simple - things like iWMMXt aren't part of the ARM
> > arch specs.
> >
> >> > We already have code which knows what needs to be saved across a
> >> > power-off transition - its what we use for our normal suspend/resume
> >> > functionality, so we should look at re-using that code for hibernate
> >> > as well.  We really don't want to be maintaining two sets of code
> >> > doing the same thing.
> >> 
> >> Could you explain which code you're refering for the existing one?
> > 
> > The code which handles saving state for the existing suspend/resume
> > support.  This code already saves the necessary state from CP15 and
> > any other state which needs to be saved prior to putting the system
> > into low power mode.
> > 
> > Every machine class which supports suspend today has their own chunk
> > of code which does this, normally called something like sleep.S
> 
> Ok, it seems to be the way to try to make use of the existing one for
> suspend-to-ram with some modifications.

[sorry to be late to the party here]

At least on OMAP, we already have everything needed to save/restore
context for off-mode transitions handled in the suspend (and idle)
paths.  So, at least in terms of context save/restore, there should be
minimal changes needed there.

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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-17 Thread Marek Vasut
Dne Čt 15. července 2010 08:04:06 Marek Vasut napsal(a):
> Dne Čt 15. července 2010 08:00:28 Hiroshi DOYU napsal(a):
> > From: ext Marek Vasut 
> > Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> > Date: Thu, 15 Jul 2010 07:56:11 +0200
> > 
> > > Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):
> > >> From: ext Marek Vasut 
> > >> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> > >> Date: Thu, 15 Jul 2010 06:48:50 +0200
> > >> 
> > >> > Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
> > >> >> From: Hiroshi DOYU 
> > >> >> 
> > >> >> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
> > >> >> 
> > >> >> Based on the original work from Romit and Raghu at TI. The original
> > >> >> patch(*1) was sent to LOML by Teerth Reddy 
> > >> >> 
> > >> >> *1: https://patchwork.kernel.org/patch/96442/
> > >> >> 
> > >> >> Signed-off-by: Hiroshi DOYU 
> > >> > 
> > >> > Hey, can this also run on pre-v7 arms ? Or is there something I
> > >> > missed that'd make that impossible?
> > >> 
> > >> What I verified is with OMAP3(Cortex A8) based board.
> > >> 
> > >> cp15 part has to be modified, but it might work without this part
> > >> itself, I guess.
> > > 
> > > I see ... do I need any special support on the bootloader or userland
> > > side ?
> > 
> > No, I don't think so. The resuming boot could set up most of states
> > basically.
> 
> I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx
> too.

Sorry I wasn't able to test this yet, I'm having trouble with my cross-
toolchain.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-16 Thread Hiroshi DOYU
From: "ext Shilimkar, Santosh" 
Subject: RE: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 10:48:00 +0200

> Hiroshi,
>> -Original Message-
>> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
>> ow...@vger.kernel.org] On Behalf Of Russell King - ARM Linux
>> Sent: Friday, July 16, 2010 1:23 PM
>> To: Hiroshi DOYU
>> Cc: linux-arm-ker...@lists.infradead.org; pa...@ucw.cz;
>> khil...@deeprootsystems.com; Reddy, Teerth; linux...@lists.linux-
>> foundation.org; yoshiya.hir...@nokia.com; linux-omap@vger.kernel.org
>> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
>> 
>> On Thu, Jul 15, 2010 at 12:08:07PM +0300, Hiroshi DOYU wrote:
>> > From: ext Russell King - ARM Linux 
>> > Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
>> > Date: Thu, 15 Jul 2010 10:41:18 +0200
>> >
>> > > On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
>> > >> Russell, would it be possible to put this into your next merge queue?
>> > >
>> > > I think it needs quite a bit of rework - I certainly don't like all
>> > > those CP15 register accesses there - that's asking for lots of ifdefs
>> > > to spring up as more CPUs are supported.
>> > >
>> > > Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
>> > > properly restored?
>> >
>> > Right. This arch specific part can be something like
>> > "suspend-v[3-7].S" to accomodate those differences
>> 
>> It's not quite that simple - things like iWMMXt aren't part of the ARM
>> arch specs.
>> 
>> > > We already have code which knows what needs to be saved across a
>> > > power-off transition - its what we use for our normal suspend/resume
>> > > functionality, so we should look at re-using that code for hibernate
>> > > as well.  We really don't want to be maintaining two sets of code
>> > > doing the same thing.
>> >
>> > Could you explain which code you're refering for the existing one?
>> 
>> The code which handles saving state for the existing suspend/resume
>> support.  This code already saves the necessary state from CP15 and
>> any other state which needs to be saved prior to putting the system
>> into low power mode.
>> 
>> Every machine class which supports suspend today has their own chunk
>> of code which does this, normally called something like sleep.S
>> 
> When this getting developed in TI, we had one more concern about handling
> the trustzone part for the CP15 resgiters.
> This patch will hang on restoration on some devices implementing trustzone.

Thanks for the info.

I think that this trustzone issue and PXA part can be revisited later
once the basic stuff is accepted.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-16 Thread Hiroshi DOYU
From: ext Russell King - ARM Linux 
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Fri, 16 Jul 2010 09:52:44 +0200

> On Thu, Jul 15, 2010 at 12:08:07PM +0300, Hiroshi DOYU wrote:
>> From: ext Russell King - ARM Linux 
>> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
>> Date: Thu, 15 Jul 2010 10:41:18 +0200
>> 
>> > On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
>> >> Russell, would it be possible to put this into your next merge queue?
>> > 
>> > I think it needs quite a bit of rework - I certainly don't like all
>> > those CP15 register accesses there - that's asking for lots of ifdefs
>> > to spring up as more CPUs are supported.
>> >
>> > Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
>> > properly restored?
>> 
>> Right. This arch specific part can be something like
>> "suspend-v[3-7].S" to accomodate those differences
> 
> It's not quite that simple - things like iWMMXt aren't part of the ARM
> arch specs.
>
>> > We already have code which knows what needs to be saved across a
>> > power-off transition - its what we use for our normal suspend/resume
>> > functionality, so we should look at re-using that code for hibernate
>> > as well.  We really don't want to be maintaining two sets of code
>> > doing the same thing.
>> 
>> Could you explain which code you're refering for the existing one?
> 
> The code which handles saving state for the existing suspend/resume
> support.  This code already saves the necessary state from CP15 and
> any other state which needs to be saved prior to putting the system
> into low power mode.
> 
> Every machine class which supports suspend today has their own chunk
> of code which does this, normally called something like sleep.S

Ok, it seems to be the way to try to make use of the existing one for
suspend-to-ram with some modifications.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-16 Thread Shilimkar, Santosh
Hiroshi,
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Russell King - ARM Linux
> Sent: Friday, July 16, 2010 1:23 PM
> To: Hiroshi DOYU
> Cc: linux-arm-ker...@lists.infradead.org; pa...@ucw.cz;
> khil...@deeprootsystems.com; Reddy, Teerth; linux...@lists.linux-
> foundation.org; yoshiya.hir...@nokia.com; linux-omap@vger.kernel.org
> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> 
> On Thu, Jul 15, 2010 at 12:08:07PM +0300, Hiroshi DOYU wrote:
> > From: ext Russell King - ARM Linux 
> > Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> > Date: Thu, 15 Jul 2010 10:41:18 +0200
> >
> > > On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
> > >> Russell, would it be possible to put this into your next merge queue?
> > >
> > > I think it needs quite a bit of rework - I certainly don't like all
> > > those CP15 register accesses there - that's asking for lots of ifdefs
> > > to spring up as more CPUs are supported.
> > >
> > > Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
> > > properly restored?
> >
> > Right. This arch specific part can be something like
> > "suspend-v[3-7].S" to accomodate those differences
> 
> It's not quite that simple - things like iWMMXt aren't part of the ARM
> arch specs.
> 
> > > We already have code which knows what needs to be saved across a
> > > power-off transition - its what we use for our normal suspend/resume
> > > functionality, so we should look at re-using that code for hibernate
> > > as well.  We really don't want to be maintaining two sets of code
> > > doing the same thing.
> >
> > Could you explain which code you're refering for the existing one?
> 
> The code which handles saving state for the existing suspend/resume
> support.  This code already saves the necessary state from CP15 and
> any other state which needs to be saved prior to putting the system
> into low power mode.
> 
> Every machine class which supports suspend today has their own chunk
> of code which does this, normally called something like sleep.S
> 
When this getting developed in TI, we had one more concern about handling
the trustzone part for the CP15 resgiters.
This patch will hang on restoration on some devices implementing trustzone.

Regards,
Santosh

--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-16 Thread Russell King - ARM Linux
On Thu, Jul 15, 2010 at 12:08:07PM +0300, Hiroshi DOYU wrote:
> From: ext Russell King - ARM Linux 
> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> Date: Thu, 15 Jul 2010 10:41:18 +0200
> 
> > On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
> >> Russell, would it be possible to put this into your next merge queue?
> > 
> > I think it needs quite a bit of rework - I certainly don't like all
> > those CP15 register accesses there - that's asking for lots of ifdefs
> > to spring up as more CPUs are supported.
> >
> > Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
> > properly restored?
> 
> Right. This arch specific part can be something like
> "suspend-v[3-7].S" to accomodate those differences

It's not quite that simple - things like iWMMXt aren't part of the ARM
arch specs.

> > We already have code which knows what needs to be saved across a
> > power-off transition - its what we use for our normal suspend/resume
> > functionality, so we should look at re-using that code for hibernate
> > as well.  We really don't want to be maintaining two sets of code
> > doing the same thing.
> 
> Could you explain which code you're refering for the existing one?

The code which handles saving state for the existing suspend/resume
support.  This code already saves the necessary state from CP15 and
any other state which needs to be saved prior to putting the system
into low power mode.

Every machine class which supports suspend today has their own chunk
of code which does this, normally called something like sleep.S
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-15 Thread Hiroshi DOYU
From: ext Russell King - ARM Linux 
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 10:41:18 +0200

> On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
>> Russell, would it be possible to put this into your next merge queue?
> 
> I think it needs quite a bit of rework - I certainly don't like all
> those CP15 register accesses there - that's asking for lots of ifdefs
> to spring up as more CPUs are supported.
>
> Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
> properly restored?

Right. This arch specific part can be something like
"suspend-v[3-7].S" to accomodate those differences

> We already have code which knows what needs to be saved across a
> power-off transition - its what we use for our normal suspend/resume
> functionality, so we should look at re-using that code for hibernate
> as well.  We really don't want to be maintaining two sets of code
> doing the same thing.

Could you explain which code you're refering for the existing one?
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-15 Thread Russell King - ARM Linux
On Thu, Jul 15, 2010 at 08:34:50AM +0300, Hiroshi DOYU wrote:
> Russell, would it be possible to put this into your next merge queue?

I think it needs quite a bit of rework - I certainly don't like all
those CP15 register accesses there - that's asking for lots of ifdefs
to spring up as more CPUs are supported.

Eg, what about ensuring that state such as iWMMXt on PXA CPUs is
properly restored?

We already have code which knows what needs to be saved across a
power-off transition - its what we use for our normal suspend/resume
functionality, so we should look at re-using that code for hibernate
as well.  We really don't want to be maintaining two sets of code
doing the same thing.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Marek Vasut
Dne Čt 15. července 2010 08:00:28 Hiroshi DOYU napsal(a):
> From: ext Marek Vasut 
> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> Date: Thu, 15 Jul 2010 07:56:11 +0200
> 
> > Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):
> >> From: ext Marek Vasut 
> >> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> >> Date: Thu, 15 Jul 2010 06:48:50 +0200
> >> 
> >> > Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
> >> >> From: Hiroshi DOYU 
> >> >> 
> >> >> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
> >> >> 
> >> >> Based on the original work from Romit and Raghu at TI. The original
> >> >> patch(*1) was sent to LOML by Teerth Reddy 
> >> >> 
> >> >> *1: https://patchwork.kernel.org/patch/96442/
> >> >> 
> >> >> Signed-off-by: Hiroshi DOYU 
> >> > 
> >> > Hey, can this also run on pre-v7 arms ? Or is there something I missed
> >> > that'd make that impossible?
> >> 
> >> What I verified is with OMAP3(Cortex A8) based board.
> >> 
> >> cp15 part has to be modified, but it might work without this part
> >> itself, I guess.
> > 
> > I see ... do I need any special support on the bootloader or userland
> > side ?
> 
> No, I don't think so. The resuming boot could set up most of states
> basically.

I'll test it on xscale/pxa270 ... if it works, I can test on various pxa3xx too.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Hiroshi DOYU
From: ext Marek Vasut 
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 07:56:11 +0200

> Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):
>> From: ext Marek Vasut 
>> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
>> Date: Thu, 15 Jul 2010 06:48:50 +0200
>> 
>> > Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
>> >> From: Hiroshi DOYU 
>> >> 
>> >> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
>> >> 
>> >> Based on the original work from Romit and Raghu at TI. The original
>> >> patch(*1) was sent to LOML by Teerth Reddy 
>> >> 
>> >> *1: https://patchwork.kernel.org/patch/96442/
>> >> 
>> >> Signed-off-by: Hiroshi DOYU 
>> > 
>> > Hey, can this also run on pre-v7 arms ? Or is there something I missed
>> > that'd make that impossible?
>> 
>> What I verified is with OMAP3(Cortex A8) based board.
>> 
>> cp15 part has to be modified, but it might work without this part itself, I
>> guess.
> 
> I see ... do I need any special support on the bootloader or userland side ?

No, I don't think so. The resuming boot could set up most of states basically.


--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Marek Vasut
Dne Čt 15. července 2010 07:39:31 Hiroshi DOYU napsal(a):
> From: ext Marek Vasut 
> Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
> Date: Thu, 15 Jul 2010 06:48:50 +0200
> 
> > Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
> >> From: Hiroshi DOYU 
> >> 
> >> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
> >> 
> >> Based on the original work from Romit and Raghu at TI. The original
> >> patch(*1) was sent to LOML by Teerth Reddy 
> >> 
> >> *1: https://patchwork.kernel.org/patch/96442/
> >> 
> >> Signed-off-by: Hiroshi DOYU 
> > 
> > Hey, can this also run on pre-v7 arms ? Or is there something I missed
> > that'd make that impossible?
> 
> What I verified is with OMAP3(Cortex A8) based board.
> 
> cp15 part has to be modified, but it might work without this part itself, I
> guess.

I see ... do I need any special support on the bootloader or userland side ?

Sorry for stupid questions :)
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Hiroshi DOYU
From: ext Marek Vasut 
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Thu, 15 Jul 2010 06:48:50 +0200

> Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
>> From: Hiroshi DOYU 
>> 
>> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
>> 
>> Based on the original work from Romit and Raghu at TI. The original
>> patch(*1) was sent to LOML by Teerth Reddy 
>> 
>> *1: https://patchwork.kernel.org/patch/96442/
>> 
>> Signed-off-by: Hiroshi DOYU 
> 
> 
> Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd 
> make that impossible?

What I verified is with OMAP3(Cortex A8) based board.

cp15 part has to be modified, but it might work without this part itself, I 
guess.
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Hiroshi DOYU
From: ext Pavel Machek 
Subject: Re: [RFC][PATCH 1/1] ARM: Add initial hibernation support
Date: Wed, 14 Jul 2010 15:22:55 +0200

> Hi!
> 
>> From: Hiroshi DOYU 
>> 
>> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
>> 
>> Based on the original work from Romit and Raghu at TI. The original
>> patch(*1) was sent to LOML by Teerth Reddy 
>> 
>> *1: https://patchwork.kernel.org/patch/96442/
>> 
>> Signed-off-by: Hiroshi DOYU 
> 
> Looks ok to me. ACK.

Pavel, Thanks.

Russell, would it be possible to put this into your next merge queue?
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Marek Vasut
Dne St 30. června 2010 16:28:01 Hiroshi DOYU napsal(a):
> From: Hiroshi DOYU 
> 
> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
> 
> Based on the original work from Romit and Raghu at TI. The original
> patch(*1) was sent to LOML by Teerth Reddy 
> 
> *1: https://patchwork.kernel.org/patch/96442/
> 
> Signed-off-by: Hiroshi DOYU 


Hey, can this also run on pre-v7 arms ? Or is there something I missed that'd 
make that impossible?

Thanks
--
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: [RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-07-14 Thread Pavel Machek
Hi!

> From: Hiroshi DOYU 
> 
> Hibernation (a.k.a: Suspend-To-Disk) support for ARM
> 
> Based on the original work from Romit and Raghu at TI. The original
> patch(*1) was sent to LOML by Teerth Reddy 
> 
> *1: https://patchwork.kernel.org/patch/96442/
> 
> Signed-off-by: Hiroshi DOYU 

Looks ok to me. ACK.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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


[RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-06-30 Thread Hiroshi DOYU
From: Hiroshi DOYU 

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original
patch(*1) was sent to LOML by Teerth Reddy 

*1: https://patchwork.kernel.org/patch/96442/

Signed-off-by: Hiroshi DOYU 
---
 arch/arm/Kconfig|4 +
 arch/arm/include/asm/memory.h   |1 +
 arch/arm/include/asm/suspend.h  |6 +
 arch/arm/kernel/Makefile|1 +
 arch/arm/kernel/hibernate.c |  234 +++
 arch/arm/kernel/hibernate_asm.S |  135 ++
 arch/arm/kernel/vmlinux.lds.S   |3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1f254bd..c19a206 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -189,6 +189,10 @@ config VECTORS_BASE
help
  The base address of exception vectors.
 
+config ARCH_HIBERNATION_POSSIBLE
+   def_bool y
+   depends on CPU_V7 && !SMP
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4312ee5..cd49706 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -194,6 +194,7 @@ static inline void *phys_to_virt(unsigned long x)
  */
 #define __pa(x)__virt_to_phys((unsigned long)(x))
 #define __va(x)((void *)__phys_to_virt((unsigned 
long)(x)))
+#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
 #define pfn_to_kaddr(pfn)  __va((pfn) << PAGE_SHIFT)
 
 /*
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
new file mode 100644
index 000..8857c79
--- /dev/null
+++ b/arch/arm/include/asm/suspend.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARM_SUSPEND_H
+#define __ASM_ARM_SUSPEND_H
+
+static inline int arch_prepare_suspend(void) { return 0; }
+
+#endif /* __ASM_ARM_SUSPEND_H */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 26d302c..38a0b10 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
 obj-$(CONFIG_KGDB) += kgdb.o
 obj-$(CONFIG_ARM_UNWIND)   += unwind.o
 obj-$(CONFIG_HAVE_TCM) += tcm.o
+obj-$(CONFIG_HIBERNATION)   += hibernate.o hibernate_asm.o
 
 obj-$(CONFIG_CRUNCH)   += crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o   := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c
new file mode 100644
index 000..692c720
--- /dev/null
+++ b/arch/arm/kernel/hibernate.c
@@ -0,0 +1,234 @@
+/*
+ * Hibernation support specific for ARM
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2006 Rafael J. Wysocki 
+ *
+ * Contact: Hiroshi DOYU 
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#include 
+#include 
+
+/*
+ * Image of the saved processor state
+ *
+ * coprocessor 15 registers(RW)
+ */
+struct saved_context {
+/*
+ * FIXME: Only support for Cortex A8 now
+ */
+   /* CR0 */
+   u32 cssr;   /* Cache Size Selection */
+   /* CR1 */
+   u32 cr; /* Control */
+   u32 cacr;   /* Coprocessor Access Control */
+   /* CR2 */
+   u32 ttb_0r; /* Translation Table Base 0 */
+   u32 ttb_1r; /* Translation Table Base 1 */
+   u32 ttbcr;  /* Translation Talbe Base Control */
+   /* CR3 */
+   u32 dacr;   /* Domain Access Control */
+   /* CR5 */
+   u32 d_fsr;  /* Data Fault Status */
+   u32 i_fsr;  /* Instruction Fault Status */
+   u32 d_afsr; /* Data Auxilirary Fault Status */   ;
+   u32 i_afsr; /* Instruction Auxilirary Fault Status */;
+   /* CR6 */
+   u32 d_far;  /* Data Fault Address */
+   u32 i_far;  /* Instruction Fault Address */
+   /* CR7 */
+   u32 par;/* Physical Address */
+   /* CR9 */   /* FIXME: Are they necessary? */
+   u32 pmcontrolr; /* Performance Monitor Control */
+   u32 cesr;   /* Count Enable Set */
+   u32 cecr;   /* Count Enable Clear */
+   u32 ofsr;   /* Overflow Flag Status */
+   u32 sir;/* Software Increment */
+   u32 pcsr;   /* Performance Counter Selection */
+   u32 ccr;/* Cycle Count */
+   u32 esr;/* Event Selection */
+   u32 pmcountr;   /* Performance Monitor Count */
+   u32 uer;/* User Enable */
+   u32 iesr;   /* Interrupt Enable Set */
+   u32 iecr;   /* Interrupt Enable Clear */
+   u32 l2clr;  /* L2 Cache Lockdown */
+   /* CR10 */
+   u32 d_tlblr;/* Data TLB Lockdown Register */
+   u32 i_tlblr;/* Instruction TLB Lockdown Register */
+