From patchwork Mon Feb 22 16:55:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylvain Lemieux X-Patchwork-Id: 8380321 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6435D9F372 for ; Mon, 22 Feb 2016 16:59:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19816204EB for ; Mon, 22 Feb 2016 16:59:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48342204AE for ; Mon, 22 Feb 2016 16:59: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 1aXtnt-0007cx-AP; Mon, 22 Feb 2016 16:57:45 +0000 Received: from mail-ig0-x236.google.com ([2607:f8b0:4001:c05::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXtmk-0006sv-2X for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 16:56:35 +0000 Received: by mail-ig0-x236.google.com with SMTP id hb3so80917958igb.0 for ; Mon, 22 Feb 2016 08:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6s0h2DYYwbPZWFjvezCFkpIMcBKxdedRdKmspQsI9Co=; b=MFenmIOBvCaBwEWC49YbRaL1tsl6pqsjtyMmKdvEgPlYEW8kR+C+ftBCPgs3hwPPo+ 0cxwpShT2cOC0x8JAfuCDWe0YoM9+HHcOWvmz3crO7J6nIY746oVaCbWWiQpRcVuhE9P +v070ZZdVhVtjaqv82wJLJFXzn+s0QaA261lVzc4rATmf479EjSlDJg7xf6jPG1UIoub Wb0vQgn2KylLXAPnuAWE87QhpNmhh4aVvaOc016+TApBY9/JNXwW0+zV2Ya2O5hmvxlu 9m7wO8P8jXuzmtkU+7tJjyFC1HOpRafaycnTijIg1YffEiZcdYorAz7HesBUon8r0g+k q9Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6s0h2DYYwbPZWFjvezCFkpIMcBKxdedRdKmspQsI9Co=; b=A28Z0A6Bukad5r1S3nCPGlnxwdCqbY/rb7h6PWip5fn/UNrIbeaEDE5Vhw0pivtrQy RWiuv9E1FQMS6TkhogprvZq/a8TDOhJe4r4fonJpIEN9CNP5nZAffS5wNXMxVbZOqvxb BQglx8d2c9FNkwx1UKIYGcnkXIYuJAIhat60WVYqKt5b/OFcedLlL6o8wUFCxeYhcFxz mQY0silO56cTtRsAuog+gzXEcqTO7bKLxxEPwPuOTXT7X4Cbv9CZMKZazkLRwNzLldCt CR+eSVxkXGIiMoj6wbNJCy3pcfdVn3vigoBd4R++2lO5pDNOctlif1DXL4cTx+8J8+HI xLTg== X-Gm-Message-State: AG10YOTfp6GDzCUla0eBMhTLhxZ1SVgHcvahcy/cx0uyBnTlRFVe9022cyO5g3st4uM7Tw== X-Received: by 10.50.46.1 with SMTP id r1mr1393483igm.21.1456160173117; Mon, 22 Feb 2016 08:56:13 -0800 (PST) Received: from CABRO3AP00510.americas.tsp.ad ([74.51.240.241]) by smtp.gmail.com with ESMTPSA id x69sm11786084ioi.16.2016.02.22.08.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 08:56:11 -0800 (PST) From: slemieux.tyco@gmail.com To: linux-arm-kernel@lists.infradead.org, wim@iguana.be, manabian@gmail.com Subject: [PATCH v2 3/5] watchdog: pnx4008: add support for soft reset Date: Mon, 22 Feb 2016 11:55:41 -0500 Message-Id: <1456160143-26761-4-git-send-email-slemieux.tyco@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1456160143-26761-1-git-send-email-slemieux.tyco@gmail.com> References: <1456160143-26761-1-git-send-email-slemieux.tyco@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_085634_356649_56720EC0 X-CRM114-Status: GOOD ( 14.47 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stigge@antcom.de, linux-watchdog@vger.kernel.org, linux@roeck-us.net, vz@mleia.com 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=-3.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Sylvain Lemieux Add support for explicit soft reset using the reboot mode. The default reboot mode behavior is unchanged; you can overwrite the default reboot type in the board specific file "DT_MACHINE_START" definition using the "reboot_mode" parameter. Signed-off-by: Sylvain Lemieux --- Changes from v1 to v2: - Rename patch title; was "arm: lpc32xx: restart: add support for soft reset" - Add change to "pnx-4008" driver instead of "mach-lpc32xx". - Use define available in "pnx-4008" when writting to watchdog register. drivers/watchdog/pnx4008_wdt.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 4b01b2b..2275fd4 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c @@ -133,9 +133,16 @@ static void pnx4008_wdt_sys_reset(enum reboot_mode mode, const char *cmd) /* Make sure WDT clocks are enabled */ writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN, LPC32XX_CLKPWR_TIMER_CLK_CTRL); - /* Instant assert of RESETOUT_N with pulse length 1mS */ - writel(13000, WDTIM_PULSE(wdt_base)); - writel(M_RES2 | RESFRC1 | RESFRC2, WDTIM_MCTRL(wdt_base)); + if (mode == REBOOT_SOFT) { + /* Force match output active */ + writel(EXT_MATCH0, WDTIM_EMR(wdt_base)); + /* Internal reset on match output (RESOUT_N not asserted) */ + writel(M_RES1, WDTIM_MCTRL(wdt_base)); + } else { + /* Instant assert of RESETOUT_N with pulse length 1mS */ + writel(13000, WDTIM_PULSE(wdt_base)); + writel(M_RES2 | RESFRC1 | RESFRC2, WDTIM_MCTRL(wdt_base)); + } /* Wait for watchdog to reset system */ mdelay(1000);