From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Juha Yrjola <juha.yrjola@solidboot.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
linux-omap@vger.kernel.org
Subject: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
Date: Tue, 10 Mar 2009 14:03:33 -0700 [thread overview]
Message-ID: <20090310210333.16425.80205.stgit@localhost> (raw)
In-Reply-To: <20090310205824.16425.97745.stgit@localhost>
From: Juha Yrjola <juha.yrjola@solidboot.com>
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.
Patch updated by Tony to also define the BOODMOD registers.
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/prcm.c | 14 ++++++++++++--
arch/arm/plat-omap/include/mach/control.h | 9 +++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index f945156..12c0e03 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -19,6 +19,7 @@
#include <linux/io.h>
#include <mach/common.h>
+#include <mach/control.h>
#include <mach/prcm.h>
#include "clock.h"
@@ -43,9 +44,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);
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index 269147f..1e1bcff 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -189,6 +189,15 @@
#define OMAP2_PBIASLITEPWRDNZ0 (1 << 1)
#define OMAP2_PBIASLITEVMODE0 (1 << 0)
+/* CONTROL_IVA2_BOOTMOD bits */
+#define OMAP3_IVA2_BOOTMOD_SHIFT 0
+#define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0)
+#define OMAP3_IVA2_BOOTMOD_IDLE (0x1 << 0)
+
+#define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860)
+#define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910)
+#define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C
+
#ifndef __ASSEMBLY__
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
extern void __iomem *omap_ctrl_base_get(void);
next prev parent reply other threads:[~2009-03-10 21:03 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
2009-03-10 21:02 ` [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE Tony Lindgren
2009-03-10 21:03 ` Tony Lindgren [this message]
2009-03-15 15:51 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Russell King - ARM Linux
2009-03-16 16:07 ` Juha Yrjola
2009-03-16 17:10 ` Russell King - ARM Linux
2009-03-16 17:40 ` Juha Yrjola
2009-03-16 22:21 ` Russell King - ARM Linux
2009-03-18 18:28 ` Tony Lindgren
2009-03-18 19:26 ` Russell King - ARM Linux
2009-03-18 20:10 ` Tony Lindgren
2009-03-18 20:15 ` Tony Lindgren
2009-03-19 0:08 ` Russell King - ARM Linux
2009-03-19 15:56 ` Tony Lindgren
2009-03-24 1:11 ` Tony Lindgren
2009-03-10 21:04 ` [PATCH 03/12] ARM: OMAP3: Add more GPIO mux options Tony Lindgren
2009-03-10 21:06 ` [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length Tony Lindgren
2009-03-15 16:00 ` Russell King - ARM Linux
2009-03-16 10:04 ` Adrian Hunter
2009-03-16 10:14 ` Russell King - ARM Linux
2009-03-16 17:42 ` Tony Lindgren
2009-03-16 22:22 ` Russell King - ARM Linux
2009-03-10 21:07 ` [PATCH 05/12] ARM: OMAP3: mmc-twl4030 voltage cleanup Tony Lindgren
2009-03-10 21:08 ` [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back Tony Lindgren
2009-03-15 16:02 ` Russell King - ARM Linux
2009-03-16 17:44 ` Tony Lindgren
2009-03-16 22:22 ` Russell King - ARM Linux
2009-03-10 21:10 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support Tony Lindgren
2009-03-15 16:04 ` Russell King - ARM Linux
2009-03-15 17:27 ` Grazvydas Ignotas
2009-03-15 17:40 ` Russell King - ARM Linux
2009-03-16 17:56 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support, v2 Tony Lindgren
2009-03-10 21:11 ` [PATCH 08/12] ARM: OMAP3: mmc-twl4030 fix for vmmc = 0 Tony Lindgren
2009-03-10 21:12 ` [PATCH 09/12] ARM: OMAP3: mmc-twl4030 add cover switch Tony Lindgren
2009-03-10 21:13 ` [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names Tony Lindgren
2009-03-15 16:08 ` Russell King - ARM Linux
2009-03-16 10:04 ` Adrian Hunter
2009-03-16 10:05 ` Adrian Hunter
2009-03-16 10:16 ` Russell King - ARM Linux
2009-03-16 18:01 ` Tony Lindgren
2009-03-10 21:15 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS Tony Lindgren
2009-03-24 1:37 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2 Tony Lindgren
2009-03-10 21:16 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw Tony Lindgren
2009-03-15 16:14 ` Russell King - ARM Linux
2009-03-15 18:46 ` David Brownell
2009-03-16 22:42 ` [PATCH] ARM: OMAP: Add name for musb clocks Tony Lindgren
2009-05-12 17:40 ` [APPLIED] " Tony Lindgren
2009-03-16 22:37 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw, v2 Tony Lindgren
2009-03-24 2:51 ` [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090310210333.16425.80205.stgit@localhost \
--to=tony@atomide.com \
--cc=juha.yrjola@solidboot.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox