public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
@ 2009-03-08 17:20 Juha Yrjola
  2009-03-09 17:21 ` Tony Lindgren
  0 siblings, 1 reply; 8+ messages in thread
From: Juha Yrjola @ 2009-03-08 17:20 UTC (permalink / raw)
  To: linux-omap; +Cc: Juha Yrjola

The reboot mode can be communicated to a bootloader (or the
kernel itself) with a scratchpad register. This functionality
is especially useful, if userspace is allowed to change
the reboot mode.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
---
 arch/arm/mach-omap2/prcm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index f945156..2bd239e 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
 
 	if (cpu_is_omap24xx())
 		prcm_offs = WKUP_MOD;
-	else if (cpu_is_omap34xx())
+	else if (cpu_is_omap34xx()) {
+		u32 l;
+
 		prcm_offs = OMAP3430_GR_MOD;
-	else
+		l = ('B' << 24) | ('M' << 16) | mode;
+		/* Reserve the first word in scratchpad for communicating
+		 * with the boot ROM. */
+		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
+	} else
 		WARN_ON(1);
 
 	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
-- 
1.6.1.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-08 17:20 [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx Juha Yrjola
@ 2009-03-09 17:21 ` Tony Lindgren
  2009-03-09 17:50   ` Kevin Hilman
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tony Lindgren @ 2009-03-09 17:21 UTC (permalink / raw)
  To: Juha Yrjola; +Cc: linux-omap, Kevin Hilman, Paul Walmsley

* Juha Yrjola <juha.yrjola@solidboot.com> [090308 10:20]:
> The reboot mode can be communicated to a bootloader (or the
> kernel itself) with a scratchpad register. This functionality
> is especially useful, if userspace is allowed to change
> the reboot mode.
> 
> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
> ---
>  arch/arm/mach-omap2/prcm.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
> index f945156..2bd239e 100644
> --- a/arch/arm/mach-omap2/prcm.c
> +++ b/arch/arm/mach-omap2/prcm.c
> @@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
>  
>  	if (cpu_is_omap24xx())
>  		prcm_offs = WKUP_MOD;
> -	else if (cpu_is_omap34xx())
> +	else if (cpu_is_omap34xx()) {
> +		u32 l;
> +
>  		prcm_offs = OMAP3430_GR_MOD;
> -	else
> +		l = ('B' << 24) | ('M' << 16) | mode;
> +		/* Reserve the first word in scratchpad for communicating
> +		 * with the boot ROM. */
> +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
> +	} else
>  		WARN_ON(1);
>  
>  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);

Looks OK to me, any comments from Kevin or Paul?

Regards,

Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-09 17:21 ` Tony Lindgren
@ 2009-03-09 17:50   ` Kevin Hilman
  2009-03-09 18:08     ` Juha Yrjola
  2009-03-12  7:57   ` Paul Walmsley
  2009-08-13 12:51   ` Kevin Hilman
  2 siblings, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2009-03-09 17:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Juha Yrjola, linux-omap, Paul Walmsley

Tony Lindgren <tony@atomide.com> writes:

> * Juha Yrjola <juha.yrjola@solidboot.com> [090308 10:20]:
>> The reboot mode can be communicated to a bootloader (or the
>> kernel itself) with a scratchpad register. This functionality
>> is especially useful, if userspace is allowed to change
>> the reboot mode.
>> 
>> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
>> ---
>>  arch/arm/mach-omap2/prcm.c |   10 ++++++++--
>>  1 files changed, 8 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
>> index f945156..2bd239e 100644
>> --- a/arch/arm/mach-omap2/prcm.c
>> +++ b/arch/arm/mach-omap2/prcm.c
>> @@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
>>  
>>  	if (cpu_is_omap24xx())
>>  		prcm_offs = WKUP_MOD;
>> -	else if (cpu_is_omap34xx())
>> +	else if (cpu_is_omap34xx()) {
>> +		u32 l;
>> +
>>  		prcm_offs = OMAP3430_GR_MOD;
>> -	else
>> +		l = ('B' << 24) | ('M' << 16) | mode;
>> +		/* Reserve the first word in scratchpad for communicating
>> +		 * with the boot ROM. */
>> +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
>> +	} else
>>  		WARN_ON(1);
>>  
>>  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
>
> Looks OK to me, any comments from Kevin or Paul?
>

Looks ok to me.

Maybe just a brief description of this scratchpad location is reserved.
Is there a boot ROM doc that could be referenced?

Any interactions with bootrom are a bit of black magic, so I like there to be
as much description as possible.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-09 17:50   ` Kevin Hilman
@ 2009-03-09 18:08     ` Juha Yrjola
  2009-03-09 18:25       ` Kevin Hilman
  0 siblings, 1 reply; 8+ messages in thread
From: Juha Yrjola @ 2009-03-09 18:08 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Tony Lindgren, linux-omap, Paul Walmsley

Kevin Hilman wrote:

> Maybe just a brief description of this scratchpad location is reserved.
> Is there a boot ROM doc that could be referenced?

I don't know how public the boot ROM behaviour is. On my OMAP34xx TRM, 
the relevant info is in Chapter 26.4.4.4, Software Booting Configuration.

Cheers,
Juha

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-09 18:08     ` Juha Yrjola
@ 2009-03-09 18:25       ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2009-03-09 18:25 UTC (permalink / raw)
  To: Juha Yrjola; +Cc: Tony Lindgren, linux-omap, Paul Walmsley

Juha Yrjola <juha.yrjola@solidboot.com> writes:

> Kevin Hilman wrote:
>
>> Maybe just a brief description of this scratchpad location is reserved.
>> Is there a boot ROM doc that could be referenced?
>
> I don't know how public the boot ROM behaviour is. On my OMAP34xx TRM,
> the relevant info is in Chapter 26.4.4.4, Software Booting
> Configuration.

I think we can reference the TRM section without describing it and
that should be safe under the NDAs.

Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-09 17:21 ` Tony Lindgren
  2009-03-09 17:50   ` Kevin Hilman
@ 2009-03-12  7:57   ` Paul Walmsley
  2009-08-13 12:51   ` Kevin Hilman
  2 siblings, 0 replies; 8+ messages in thread
From: Paul Walmsley @ 2009-03-12  7:57 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Juha Yrjola, linux-omap, Kevin Hilman

On Mon, 9 Mar 2009, Tony Lindgren wrote:

> * Juha Yrjola <juha.yrjola@solidboot.com> [090308 10:20]:
> > The reboot mode can be communicated to a bootloader (or the
> > kernel itself) with a scratchpad register. This functionality
> > is especially useful, if userspace is allowed to change
> > the reboot mode.
> > 
> > Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
> > ---
> >  arch/arm/mach-omap2/prcm.c |   10 ++++++++--
> >  1 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
> > index f945156..2bd239e 100644
> > --- a/arch/arm/mach-omap2/prcm.c
> > +++ b/arch/arm/mach-omap2/prcm.c
> > @@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
> >  
> >  	if (cpu_is_omap24xx())
> >  		prcm_offs = WKUP_MOD;
> > -	else if (cpu_is_omap34xx())
> > +	else if (cpu_is_omap34xx()) {
> > +		u32 l;
> > +
> >  		prcm_offs = OMAP3430_GR_MOD;
> > -	else
> > +		l = ('B' << 24) | ('M' << 16) | mode;
> > +		/* Reserve the first word in scratchpad for communicating
> > +		 * with the boot ROM. */
> > +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
> > +	} else
> >  		WARN_ON(1);
> >  
> >  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
> 
> Looks OK to me, any comments from Kevin or Paul?

Can't find "BMxx" in the Rev O 34xx TRM. Is this a NOLO-specific feature, 
or is this a known standard supported by other bootloaders?  If the 
former, maybe it would be good to add a few lines of documentation in 
Documentation/arm/OMAP/rebooting or some other place?



- Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-03-09 17:21 ` Tony Lindgren
  2009-03-09 17:50   ` Kevin Hilman
  2009-03-12  7:57   ` Paul Walmsley
@ 2009-08-13 12:51   ` Kevin Hilman
  2009-08-13 12:54     ` Paul Walmsley
  2 siblings, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2009-08-13 12:51 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Juha Yrjola, linux-omap, Paul Walmsley

Tony Lindgren <tony@atomide.com> writes:

> * Juha Yrjola <juha.yrjola@solidboot.com> [090308 10:20]:
>> The reboot mode can be communicated to a bootloader (or the
>> kernel itself) with a scratchpad register. This functionality
>> is especially useful, if userspace is allowed to change
>> the reboot mode.
>> 
>> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
>> ---
>>  arch/arm/mach-omap2/prcm.c |   10 ++++++++--
>>  1 files changed, 8 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
>> index f945156..2bd239e 100644
>> --- a/arch/arm/mach-omap2/prcm.c
>> +++ b/arch/arm/mach-omap2/prcm.c
>> @@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
>>  
>>  	if (cpu_is_omap24xx())
>>  		prcm_offs = WKUP_MOD;
>> -	else if (cpu_is_omap34xx())
>> +	else if (cpu_is_omap34xx()) {
>> +		u32 l;
>> +
>>  		prcm_offs = OMAP3430_GR_MOD;
>> -	else
>> +		l = ('B' << 24) | ('M' << 16) | mode;
>> +		/* Reserve the first word in scratchpad for communicating
>> +		 * with the boot ROM. */
>> +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
>> +	} else
>>  		WARN_ON(1);
>>  
>>  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
>
> Looks OK to me, any comments from Kevin or Paul?
>

Acked-by: Kevin Hilman <khilman@deeprootsystems.com>

I've had this one in the PM branch for awhile now I think can go upstream.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx
  2009-08-13 12:51   ` Kevin Hilman
@ 2009-08-13 12:54     ` Paul Walmsley
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Walmsley @ 2009-08-13 12:54 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Tony Lindgren, Juha Yrjola, linux-omap

On Thu, 13 Aug 2009, Kevin Hilman wrote:

> Tony Lindgren <tony@atomide.com> writes:
> 
> > * Juha Yrjola <juha.yrjola@solidboot.com> [090308 10:20]:
> >> The reboot mode can be communicated to a bootloader (or the
> >> kernel itself) with a scratchpad register. This functionality
> >> is especially useful, if userspace is allowed to change
> >> the reboot mode.
> >> 
> >> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
> >> ---
> >>  arch/arm/mach-omap2/prcm.c |   10 ++++++++--
> >>  1 files changed, 8 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
> >> index f945156..2bd239e 100644
> >> --- a/arch/arm/mach-omap2/prcm.c
> >> +++ b/arch/arm/mach-omap2/prcm.c
> >> @@ -43,9 +43,15 @@ void omap_prcm_arch_reset(char mode)
> >>  
> >>  	if (cpu_is_omap24xx())
> >>  		prcm_offs = WKUP_MOD;
> >> -	else if (cpu_is_omap34xx())
> >> +	else if (cpu_is_omap34xx()) {
> >> +		u32 l;
> >> +
> >>  		prcm_offs = OMAP3430_GR_MOD;
> >> -	else
> >> +		l = ('B' << 24) | ('M' << 16) | mode;
> >> +		/* Reserve the first word in scratchpad for communicating
> >> +		 * with the boot ROM. */
> >> +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
> >> +	} else
> >>  		WARN_ON(1);
> >>  
> >>  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
> >
> > Looks OK to me, any comments from Kevin or Paul?
> >
> 
> Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
> 
> I've had this one in the PM branch for awhile now I think can go upstream.

The omap_writel() should be nuked and replaced that with an 
omap_ctrl_write().  Other than that, I don't have any comment on it...


- Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-13 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-08 17:20 [PATCH] OMAP: Store reboot mode in scratchpad on OMAP34xx Juha Yrjola
2009-03-09 17:21 ` Tony Lindgren
2009-03-09 17:50   ` Kevin Hilman
2009-03-09 18:08     ` Juha Yrjola
2009-03-09 18:25       ` Kevin Hilman
2009-03-12  7:57   ` Paul Walmsley
2009-08-13 12:51   ` Kevin Hilman
2009-08-13 12:54     ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox