From patchwork Thu Feb 18 21:35:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylvain Lemieux X-Patchwork-Id: 8354741 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 D14359FC55 for ; Thu, 18 Feb 2016 21:37:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36903203B6 for ; Thu, 18 Feb 2016 21:37:52 +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 96C0B203A0 for ; Thu, 18 Feb 2016 21:37:51 +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 1aWWFG-0008Ko-Io; Thu, 18 Feb 2016 21:36:18 +0000 Received: from mail-io0-x242.google.com ([2607:f8b0:4001:c06::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWWF0-0008G7-0l for linux-arm-kernel@lists.infradead.org; Thu, 18 Feb 2016 21:36:03 +0000 Received: by mail-io0-x242.google.com with SMTP id b188so4414081iof.3 for ; Thu, 18 Feb 2016 13:35:41 -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=ao3J3OpFrndSEJPM4tT9cl7faNSMo30XEsjHxV+pMKs=; b=PzaNJ/JMatj4Z6EsYt8qfVyjGEAA3yAPgKYSRAQmZBF8B/qQ1DTrlYHbt7WXBemWwT Pdy9TDbqYLj1zcyjfdBD2OTkB6RABGniy/8ob1wlVLhF9qbmmZ5Xs/zw3ohASbWXv3Ta 9Tdxx8BkQxVC+NMIoXR1U13onlABXzLltQ4Ls/XG/Tb4844VJbT+twCvUKnWNq8QoG++ KGxyOe/8N924sZmVK35a5yzqdpKRHTKzif6B2JRqiELzy3QCPOnwFZYJU85BAPdkGW8m 9QWLQlXNlYHqAbKJwPapayf5C80GDyjtKDzlVB81JQFen+Y2R+AMKSIEECiT4jpx66jJ Ivaw== 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=ao3J3OpFrndSEJPM4tT9cl7faNSMo30XEsjHxV+pMKs=; b=LxYhv6FoAjQH8l7OsCqqwh+PxvKOlDDqFe2IL06wKJdv8OqXNRPhWXC7rdDW+msKgW +mGzit6dRkDDa8TunQcUSeoJjdJLD7jA2UDQkigvPnRBJu0sFMwFy9Vu3BJSjX8nxnYS 44fK/e/V7PVerD30R2liLnjoaks1tcG6x4CrMIaLTyB5lemTaTm3Hm+K1ypsGvzgVoF3 mcESgA0x8vd99T5MGELMNduwEI7GvZIpT6/KvHNWB6/vEWNOz+q7FQ1Z4Msz6tK5iiXT 6PPCvilPDk+sLWnhPZQ47DfQlQYFGbHSYGoVCFfU3wQ6LpFLXp5grn6gDXNnRGc8y7nz 1YLA== X-Gm-Message-State: AG10YOT78NuEQLAu2r2BW3j5JPXXTMlNWXm7Gv7cSmm8gWg/ca3ET5BS3/H8WQF0cz+kxw== X-Received: by 10.107.40.11 with SMTP id o11mr10556803ioo.183.1455831340780; Thu, 18 Feb 2016 13:35:40 -0800 (PST) Received: from CABRO3AP00510.americas.tsp.ad ([74.51.240.241]) by smtp.gmail.com with ESMTPSA id mu8sm2239783igb.16.2016.02.18.13.35.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 13:35:39 -0800 (PST) From: slemieux.tyco@gmail.com To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] arm: lpc32xx: restart: add support for soft reset Date: Thu, 18 Feb 2016 16:35:23 -0500 Message-Id: <1455831324-8909-2-git-send-email-slemieux.tyco@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1455831324-8909-1-git-send-email-slemieux.tyco@gmail.com> References: <1455831324-8909-1-git-send-email-slemieux.tyco@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160218_133602_140210_815C8598 X-CRM114-Status: GOOD ( 12.64 ) 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, 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 specified the default reboot type in the board specific file "DT_MACHINE_START" definition using the "reboot_mode" parameter. Signed-off-by: Sylvain Lemieux --- arch/arm/mach-lpc32xx/common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index 716e83e..9eb9f22 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -200,9 +200,16 @@ void lpc23xx_restart(enum reboot_mode mode, const char *cmd) __raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN, LPC32XX_CLKPWR_TIMER_CLK_CTRL); - /* Instant assert of RESETOUT_N with pulse length 1mS */ - __raw_writel(13000, io_p2v(LPC32XX_WDTIM_BASE + 0x18)); - __raw_writel(0x70, io_p2v(LPC32XX_WDTIM_BASE + 0xC)); + if (mode == REBOOT_SOFT) { + /* Force match output active */ + __raw_writel(0x01, io_p2v(LPC32XX_WDTIM_BASE + 0x14)); + /* Enable internal reset on match output (RESOUT_N not asserted) */ + __raw_writel(0x08, io_p2v(LPC32XX_WDTIM_BASE + 0xC)); + } else { + /* Instant assert of RESETOUT_N with pulse length 1mS */ + __raw_writel(13000, io_p2v(LPC32XX_WDTIM_BASE + 0x18)); + __raw_writel(0x70, io_p2v(LPC32XX_WDTIM_BASE + 0xC)); + } /* Wait for watchdog to reset system */ while (1)