Skip to contentSkip to conversation

OMAP: Store reboot mode in scratchpad on OMAP34xx

PATCH In review Juha Yrjola 4 participants 5 messages Mar 9, 2009 – Mar 10, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 OMAP: Store reboot mode in scratchpad on OMAP34xx

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.

---
 arch/arm/mach-omap2/prcm.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/prcm.c +11 -2
index f945156..2f828cb 100644
@@ -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);
Signature · 1 line
1.6.1.3
Acked-by on v2 1/1
#1 lore raw
Quoted 6 lines · 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.

Quoted 36 lines
---
 arch/arm/mach-omap2/prcm.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/prcm.c +11 -2
index f945156..2f828cb 100644
@@ -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);
Signature · 6 lines
1.6.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 2 lines · Tony Lindgren

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

Quoted 11 lines

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

maintainer
#4 lore raw
Quoted 11 lines · David Brownell
Quoted 2 lines · Tony Lindgren

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

Quoted 12 lines
Quoted 11 lines

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