diff mbox

[v2] OMAP: Store reboot mode in scratchpad on OMAP34xx

Message ID 1236633661-11911-1-git-send-email-juha.yrjola@solidboot.com (mailing list archive)
State Accepted
Commit 73b65cde9647508313b3d686dff0f3d1d92482d1
Headers show

Commit Message

Juha Yrjola March 9, 2009, 9:21 p.m. UTC
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 |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Comments

Kevin Hilman March 9, 2009, 10:12 p.m. UTC | #1
Juha Yrjola <juha.yrjola@solidboot.com> writes:

> 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>

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

> ---
>  arch/arm/mach-omap2/prcm.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
> index f945156..2f828cb 100644
> --- a/arch/arm/mach-omap2/prcm.c
> +++ b/arch/arm/mach-omap2/prcm.c
> @@ -43,9 +43,18 @@ 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. A pointer to a data structure
> +		 * describing the boot process can be stored there,
> +		 * cf. OMAP34xx TRM, Initialization / Software Booting
> +		 * Configuration. */
> +		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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 10, 2009, 7:35 p.m. UTC | #2
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Commit: 73b65cde9647508313b3d686dff0f3d1d92482d1

PatchWorks
http://patchwork.kernel.org/patch/10718/

Git
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=73b65cde9647508313b3d686dff0f3d1d92482d1


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Brownell March 10, 2009, 9:05 p.m. UTC | #3
On Tuesday 10 March 2009, Tony Lindgren wrote:
> This patch has been applied to the linux-omap
> by youw fwiendly patch wobot.

  CC      arch/arm/mach-omap2/prcm.o
arch/arm/mach-omap2/prcm.c: In function 'omap_prcm_arch_reset':
arch/arm/mach-omap2/prcm.c:56: error: 'OMAP343X_SCRATCHPAD' undeclared (first use in this function)
arch/arm/mach-omap2/prcm.c:56: error: (Each undeclared identifier is reported only once
arch/arm/mach-omap2/prcm.c:56: error: for each function it appears in.)
make[1]: *** [arch/arm/mach-omap2/prcm.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

> 
> Commit: 73b65cde9647508313b3d686dff0f3d1d92482d1
> 
> PatchWorks
> http://patchwork.kernel.org/patch/10718/
> 
> Git
> http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=73b65cde9647508313b3d686dff0f3d1d92482d1
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 10, 2009, 9:14 p.m. UTC | #4
* David Brownell <david-b@pacbell.net> [090310 14:05]:
> On Tuesday 10 March 2009, Tony Lindgren wrote:
> > This patch has been applied to the linux-omap
> > by youw fwiendly patch wobot.
> 
>   CC      arch/arm/mach-omap2/prcm.o
> arch/arm/mach-omap2/prcm.c: In function 'omap_prcm_arch_reset':
> arch/arm/mach-omap2/prcm.c:56: error: 'OMAP343X_SCRATCHPAD' undeclared (first use in this function)
> arch/arm/mach-omap2/prcm.c:56: error: (Each undeclared identifier is reported only once
> arch/arm/mach-omap2/prcm.c:56: error: for each function it appears in.)
> make[1]: *** [arch/arm/mach-omap2/prcm.o] Error 1
> make: *** [arch/arm/mach-omap2] Error 2

I already pushed a fix for that as commit
3388c8ffb612af2c9d4267e0401378c3afb05f5f.

Tony

 
> > 
> > Commit: 73b65cde9647508313b3d686dff0f3d1d92482d1
> > 
> > PatchWorks
> > http://patchwork.kernel.org/patch/10718/
> > 
> > Git
> > http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=73b65cde9647508313b3d686dff0f3d1d92482d1
> > 
> > 
> > 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index f945156..2f828cb 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -43,9 +43,18 @@  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. A pointer to a data structure
+		 * describing the boot process can be stored there,
+		 * cf. OMAP34xx TRM, Initialization / Software Booting
+		 * Configuration. */
+		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
+	} else
 		WARN_ON(1);
 
 	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);