From patchwork Thu Oct 31 06:27:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 3118851 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 816E99F3E3 for ; Thu, 31 Oct 2013 06:31:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9EA2203E6 for ; Thu, 31 Oct 2013 06:31:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78DA32018B for ; Thu, 31 Oct 2013 06:31:50 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vblmc-0004sB-Ru; Thu, 31 Oct 2013 06:31:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VblmS-0008Hm-SU; Thu, 31 Oct 2013 06:30:56 +0000 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vbllz-0008Bq-5n for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2013 06:30:31 +0000 Received: by mail-ea0-f174.google.com with SMTP id z15so1141955ead.33 for ; Wed, 30 Oct 2013 23:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=wNIb66wiq87Eb+pXsXpJ+5K8vPf7ohdg+VyrOgyLyVA=; b=EjLKkHGvfzTwKoq6P2SD0L7wC2W3pVcXVAsFj80xLRrKu9KcyjY4jff1Tf1OxW4T6m P91rabDcxq8sdekbTwAVrPFNGZI7/CacckF+BqFeFQTaOc+uMyJA8m/DcotTKjWc0ZuI UumOH323Ek/bJ+pubphzd9LMSyW5WsdgAaOK3tzAq09WVQoCd+oztACg/o2feb2IsOAn 0FfwRgj1Oqd2p/ESdXh3odIU3ZKstphHkG8fhEk5bjIvFpSbMDU4cGhfvBVw47J47fGc amQ8mb3n5PM1B2CyGhX0aFPrad5/VphubPwBRP7fuSda1SUkY0flLA3iDH7Ing4+cngd FikQ== X-Received: by 10.14.219.4 with SMTP id l4mr1390534eep.37.1383201005269; Wed, 30 Oct 2013 23:30:05 -0700 (PDT) Received: from shock.dandreoli.com (j115181.upc-j.chello.nl. [24.132.115.181]) by mx.google.com with ESMTPSA id b42sm4432224eem.9.2013.10.30.23.30.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2013 23:30:04 -0700 (PDT) Received: by shock.dandreoli.com (Postfix, from userid 1000) id 6B347340273; Thu, 31 Oct 2013 07:29:59 +0100 (CET) Message-Id: <20131031062959.169063871@linux.com> User-Agent: quilt/0.60-1 Date: Thu, 31 Oct 2013 07:27:12 +0100 From: Domenico Andreoli To: linux-arch@vger.kernel.org Subject: [PATCH 04/11] MIPS: use the common machine reset handling References: <20131031062708.520968323@linux.com> Content-Disposition: inline; filename=mips-machine-reset.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131031_023027_346030_1229BA1D X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: -1.9 (-) Cc: Russell King , Arnd Bergmann , Ralf Baechle , Domenico Andreoli , linux-mips@lvger.kernel.org, Olof Johansson , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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: Domenico Andreoli Proof of concept: MIPS as a consumer of the machine reset hooks. Cc: Ralf Baechle Cc: linux-arch@vger.kernel.org Cc: linux-mips@vger.kernel.org Signed-off-by: Domenico Andreoli --- arch/mips/kernel/reset.c | 7 +++++++ kernel/power/Kconfig | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) Index: b/arch/mips/kernel/reset.c =================================================================== --- a/arch/mips/kernel/reset.c +++ b/arch/mips/kernel/reset.c @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -29,16 +30,22 @@ void machine_restart(char *command) { if (_machine_restart) _machine_restart(command); + else + default_restart(reboot_mode, command); } void machine_halt(void) { if (_machine_halt) _machine_halt(); + else + default_halt(); } void machine_power_off(void) { if (pm_power_off) pm_power_off(); + else + default_power_off(); } Index: b/kernel/power/Kconfig =================================================================== --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -297,4 +297,4 @@ config CPU_PM config MACHINE_RESET bool default n - depends on ARM || ARM64 + depends on ARM || ARM64 || MIPS