From patchwork Sun Jul 15 07:19:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zumeng Chen X-Patchwork-Id: 1198501 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B1878E007A for ; Sun, 15 Jul 2012 07:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523Ab2GOHTx (ORCPT ); Sun, 15 Jul 2012 03:19:53 -0400 Received: from mail.windriver.com ([147.11.1.11]:61758 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123Ab2GOHTv (ORCPT ); Sun, 15 Jul 2012 03:19:51 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.5/8.14.3) with ESMTP id q6F7Jl6F000055 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 15 Jul 2012 00:19:47 -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; Sun, 15 Jul 2012 00:19:46 -0700 From: Zumeng Chen To: , , , CC: , , , Subject: [PATCH v3 3/3] Watchdog: Omap: get the bootstatus for OMAP34xx Date: Sun, 15 Jul 2012 15:19:32 +0800 Message-ID: <1342336772-29020-4-git-send-email-zumeng.chen@windriver.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1342336772-29020-1-git-send-email-zumeng.chen@windriver.com> References: <1342336772-29020-1-git-send-email-zumeng.chen@windriver.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 480f40a..3ca8aa7 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c @@ -48,9 +48,14 @@ 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; + + /* XXX This presumably needs modification for AM33XX when ready. */ + 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;