From patchwork Fri Jun 13 07:26:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 4347421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8EABB9F314 for ; Fri, 13 Jun 2014 07:29:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA5AA20219 for ; Fri, 13 Jun 2014 07:29:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EA6C2020F for ; Fri, 13 Jun 2014 07:29:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvLt8-0003ot-9h; Fri, 13 Jun 2014 07:27:02 +0000 Received: from smtp39.i.mail.ru ([94.100.177.99]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvLt1-0003Ss-DU for linux-arm-kernel@lists.infradead.org; Fri, 13 Jun 2014 07:26:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=F5K8vzh9gtJYGBbz21fvXUsojyUgArFEDMxALkgtoNc=; b=B8KhroUkYvQ9sUQncl4lqbxWd9n5Wmu0vVlHDm3QMtsEDmaSHvt+bTb9qra0tP9IFFOVD5D9pC26ulOLxW0YTzsmANy/BJwzldkYxxPwU+Fv7/C5RtWaCP2aNNoj+4A3z2Qma1t59Se314L00DhL1n6DPWMJ+YcCs5V5i9+B6w8=; Received: from [5.18.98.7] (port=62461 helo=shc.zet) by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1WvLsd-0006UV-Dp; Fri, 13 Jun 2014 11:26:31 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] ARM: i.MX system: Add a reset fallback if base address of watchdog is not set Date: Fri, 13 Jun 2014 11:26:13 +0400 Message-Id: <1402644373-8408-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1402644373-8408-1-git-send-email-shc_work@mail.ru> References: <1402644373-8408-1-git-send-email-shc_work@mail.ru> X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140613_002656_130050_70E394F0 X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -0.1 (/) Cc: Alexander Shiyan , Sascha Hauer , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a reset fallback if base address of watchdog is not set. This is intended for a targets not compatible with imx-21 watchdog, i.MX1 for example. Signed-off-by: Alexander Shiyan --- arch/arm/mach-imx/system.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index ae521f3..3b9259b 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c @@ -42,6 +42,9 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) { unsigned int wcr_enable; + if (!wdog_base) + goto reset_fallback; + if (!IS_ERR_OR_NULL(wdog_clk)) clk_enable(wdog_clk); @@ -70,6 +73,7 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) /* delay to allow the serial port to show the message */ mdelay(50); +reset_fallback: /* we'll take a jump through zero as a poor second */ soft_restart(0); }