From patchwork Mon Jul 9 07:35:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zumeng Chen X-Patchwork-Id: 1171451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 31ADF3FC2A for ; Mon, 9 Jul 2012 07:46:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1So8Ys-0007JK-LU; Mon, 09 Jul 2012 07:39:16 +0000 Received: from mail.windriver.com ([147.11.1.11]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1So8Vl-0006c7-Dt for linux-arm-kernel@lists.infradead.org; Mon, 09 Jul 2012 07:36:05 +0000 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id q697Zg5H026029 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 9 Jul 2012 00:35:42 -0700 (PDT) Received: from pek-yocto-build2.corp.ad.wrs.com (128.224.162.103) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Mon, 9 Jul 2012 00:35:41 -0700 From: Zumeng Chen To: , , Subject: [PATCH v2 3/3] Watchdog: Omap: get the bootstatus for OMAP2Plus Date: Mon, 9 Jul 2012 15:35:28 +0800 Message-ID: <1341819328-3514-4-git-send-email-zumeng.chen@windriver.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1341819328-3514-1-git-send-email-zumeng.chen@windriver.com> References: <1341819328-3514-1-git-send-email-zumeng.chen@windriver.com> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [147.11.1.11 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: tony@atomide.com, paul.gortmaker@windriver.com, linux-omap@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The offset of WKUP_MOD is not right for the PRM_RSTST of OMAP3. So here put the right one to match to the actual physical addr 0x48307258, which defined in PRCM Registers section named as Global_Reg_PRM. And there is a MPU_WD_RST bit in PRM_RSTST(0x48307258) holding the signal from omap-wdt reboot, so that we can return WDIOF_CARDRESET if the board wakes up from omap-wdt reboot for WDIOC_GETBOOTSTATUS ioctl. Signed-off-by: Zumeng Chen --- arch/arm/mach-omap2/prcm.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 480f40a..4dcc706 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c @@ -49,8 +49,11 @@ void __iomem *prcm_mpu_base; u32 omap_prcm_get_reset_sources(void) { /* XXX This presumably needs modification for 34XX */ - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (cpu_is_omap24xx()) return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f; + if (cpu_is_omap34xx()) + return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP2_RM_RSTST) & + 0x7f; if (cpu_is_omap44xx()) return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;