From patchwork Wed Feb 24 17:46:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylvain Lemieux X-Patchwork-Id: 8410441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76588C0553 for ; Wed, 24 Feb 2016 17:50:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0EC620225 for ; Wed, 24 Feb 2016 17:50:20 +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 C137920222 for ; Wed, 24 Feb 2016 17:50:19 +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 1aYdYL-0002g2-PS; Wed, 24 Feb 2016 17:48:45 +0000 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYdXF-0001mt-F3 for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2016 17:47:40 +0000 Received: by mail-io0-x244.google.com with SMTP id l127so3214103iof.1 for ; Wed, 24 Feb 2016 09:47:17 -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=lpQZxmfUpQ0yOypbqZAuhLAV1kRv1INliY3vM551Jig=; b=ee3pPIMWPRIctyeIJJOZScMFBzMmpHJ71GenlCBNnlZD/nPsGDAhmmNDQHnqWmwii5 og1USs2iX711DxtBo9F0bqYrGoJGqpk78/hO15zyOyybF0XCpm9q+vU3GQu1wiETNq/K 3IoeARhTAFipPQ9lcejxta4OPDlhKvCd40U6tni47UPPzx9ejmzSw6TWe+jGCzs6KeG8 4BtOJyOVYpfFu9boCjdbFzSY0Ipu0m6FbaJP7zARER9A6nlrR3TQgURbLzZWQTYdmVqs L/UXQh6lQddD1ItKzBFLmtR9sniytsxIBR+TKaPFdTQTgvrXQkvusfLA44uRHk0WfVW2 +V1Q== 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=lpQZxmfUpQ0yOypbqZAuhLAV1kRv1INliY3vM551Jig=; b=Gm2so6++7Ap8RyYdrF1KL0QdIg/nLSiK7DhZU9PSDi7FNio25sa65Irwjaj9jIRBZm t2yDfFfV7W8FCtFuHRVooQzkhNVolGV6AycP5f6DlHHeMOv4WWAY0vlJ0xs8E5pRScSN uYa8gqL8be7wz+WH+a3rMd+l+ZJtoP/xLV6GIOsmuDGhynV5+f80d3d3VWJMUOGSfUDl FgVTr8MYIecImTRLuNRojJ9lLN2Vr3/+YzXmzjI6rPG0vXkOT0lKwOtEeD6rtcac0zuR 6YB9F5mI2CE8794cfm5CVhvBO4HUNl0yyRqfyFF4F51dU9RJfX8NFebP60VSQYVW6pad kZ0w== X-Gm-Message-State: AG10YOTggDDJuLZB/9m7yj2n9i4WVFlU2U9ZMBnti0FT5fo8pLI9IQUF1QDZuKiSfsHbcg== X-Received: by 10.107.62.195 with SMTP id l186mr40011017ioa.180.1456336036852; Wed, 24 Feb 2016 09:47:16 -0800 (PST) Received: from CABRO3AP00510.americas.tsp.ad ([74.51.240.241]) by smtp.gmail.com with ESMTPSA id pk7sm13494524igb.17.2016.02.24.09.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 09:47:15 -0800 (PST) From: Sylvain Lemieux To: linux-arm-kernel@lists.infradead.org, wim@iguana.be, manabian@gmail.com Subject: [PATCH v3 3/6] watchdog: pnx4008: add support for soft reset Date: Wed, 24 Feb 2016 12:46:55 -0500 Message-Id: <1456336018-6620-4-git-send-email-slemieux.tyco@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1456336018-6620-1-git-send-email-slemieux.tyco@gmail.com> References: <1456336018-6620-1-git-send-email-slemieux.tyco@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_094737_832290_833D7B43 X-CRM114-Status: GOOD ( 14.01 ) 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=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 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 v2 to v3: - no logical change; updated to work with new revision of patch #2. 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 80ee4af..fbf027e 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c @@ -130,9 +130,16 @@ static int pnx4008_wdt_set_timeout(struct watchdog_device *wdd, static int pnx4008_restart_handler(struct notifier_block *this, unsigned long mode, void *cmd) { - /* 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 == (unsigned long)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);