From patchwork Mon Mar 9 21:21:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha Yrjola X-Patchwork-Id: 10718 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n29LKnOL023079 for ; Mon, 9 Mar 2009 21:20:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754233AbZCIVUs (ORCPT ); Mon, 9 Mar 2009 17:20:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753773AbZCIVUr (ORCPT ); Mon, 9 Mar 2009 17:20:47 -0400 Received: from smtp.nokia.com ([192.100.105.134]:39122 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753973AbZCIVUq (ORCPT ); Mon, 9 Mar 2009 17:20:46 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n29LK2IT003663; Mon, 9 Mar 2009 16:20:40 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Mar 2009 23:20:17 +0200 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Mar 2009 23:20:16 +0200 Received: from localhost.localdomain (esdhcp03551.research.nokia.com [172.21.35.51]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n29LKFOC000974; Mon, 9 Mar 2009 23:20:15 +0200 From: Juha Yrjola To: linux-omap@vger.kernel.org Cc: Juha Yrjola Subject: [PATCH v2] OMAP: Store reboot mode in scratchpad on OMAP34xx Date: Mon, 9 Mar 2009 23:21:01 +0200 Message-Id: <1236633661-11911-1-git-send-email-juha.yrjola@solidboot.com> X-Mailer: git-send-email 1.6.1.3 X-OriginalArrivalTime: 09 Mar 2009 21:20:16.0376 (UTC) FILETIME=[D7754780:01C9A0FC] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 Acked-by: Kevin Hilman --- 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);