From patchwork Mon Aug 19 19:28:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2846682 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8A5F8BF546 for ; Mon, 19 Aug 2013 19:28:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9533B200D5 for ; Mon, 19 Aug 2013 19:28:55 +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 7CD35201D3 for ; Mon, 19 Aug 2013 19:28:54 +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 1VBV8C-0003PB-8U; Mon, 19 Aug 2013 19:28:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBV89-0007o1-Ue; Mon, 19 Aug 2013 19:28:45 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBV87-0007nN-05 for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2013 19:28:43 +0000 Received: by mail-la0-f50.google.com with SMTP id ek20so3736187lab.9 for ; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bMRJRuesIWFUY4Wm0ilkZv/igSGo86df53qiCopnGdk=; b=EerSn5rgF26ImFf1tGYBi5vI0AyZQBejaW8p/c/fyUB8FaJOwkkKzMHMw4k+1bX584 EtuyrINFsX/qWb1ka5TaioxQZwTk0FARrzOBZps921ut7HKtR6BHIjqmvSNkj//BcuFv dSh6O7HD8vkmqZV+gFTWcIT4U93kbnt2M7TOtc8akHblEOx6x3UFb6YEsY90ZJpQLrzv PtmaHYsMwXercice8wTyDTfq9Pvkt9P0/1TasA7QB2G9ebFCC9aenbVDEp2hMRlpBJU0 29UJkKP+eVaxsl+17YHDZX0LlV5yDKBB9UFrbqqvxyuYXd0Ab9FMC4s0CqUNGyiwH++G TH0w== X-Gm-Message-State: ALoCoQn5SGUC5O5R03YkZ5JlAmUSekvDnATXmodH6sX3AEhpnXl4sxnAmQ4TvrUgluBymI9HoEkt X-Received: by 10.112.35.52 with SMTP id e20mr12783421lbj.11.1376940497899; Mon, 19 Aug 2013 12:28:17 -0700 (PDT) Received: from localhost.localdomain (c83-249-209-251.bredband.comhem.se. [83.249.209.251]) by mx.google.com with ESMTPSA id pw4sm5283684lbb.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 19 Aug 2013 12:28:16 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] ARM: ux500: add restart support via prcmu Date: Mon, 19 Aug 2013 21:28:10 +0200 Message-Id: <1376940490-13277-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130819_152843_167584_3E4FBF82 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -2.6 (--) Cc: Fabio Baltieri , Linus Walleij 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=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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: Fabio Baltieri Add necessary code to restart ux500 based machines using prcmu_system_reset(). Signed-off-by: Fabio Baltieri Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased to use the new signature of the restart hook taking an enum rather than a char. --- arch/arm/mach-ux500/board-mop500.c | 5 ++++- arch/arm/mach-ux500/cpu-db8500.c | 2 +- arch/arm/mach-ux500/cpu.c | 8 ++++++++ arch/arm/mach-ux500/setup.h | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index df5d27a..4e7ab3a 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -42,7 +42,6 @@ #include #include -#include #include "setup.h" #include "devices.h" @@ -686,6 +685,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") .init_time = ux500_timer_init, .init_machine = mop500_init_machine, .init_late = ux500_init_late, + .restart = ux500_restart, MACHINE_END MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520") @@ -695,6 +695,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520") .init_time = ux500_timer_init, .init_machine = mop500_init_machine, .init_late = ux500_init_late, + .restart = ux500_restart, MACHINE_END MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") @@ -705,6 +706,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") .init_time = ux500_timer_init, .init_machine = hrefv60_init_machine, .init_late = ux500_init_late, + .restart = ux500_restart, MACHINE_END MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") @@ -716,4 +718,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") .init_time = ux500_timer_init, .init_machine = snowball_init_machine, .init_late = NULL, + .restart = ux500_restart, MACHINE_END diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 12eee81..03ec8a2 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -26,7 +26,6 @@ #include #include -#include #include "setup.h" #include "devices.h" @@ -325,6 +324,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") .init_machine = u8500_init_machine, .init_late = NULL, .dt_compat = stericsson_dt_platform_compat, + .restart = ux500_restart, MACHINE_END #endif diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index e6fb023..5d7eebc 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -31,6 +31,14 @@ #include "db8500-regs.h" #include "id.h" +void ux500_restart(enum reboot_mode mode, const char *cmd) +{ + local_irq_disable(); + local_fiq_disable(); + + prcmu_system_reset(0); +} + /* * FIXME: Should we set up the GPIO domain here? * diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index cad3ca8..656324a 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -11,10 +11,13 @@ #ifndef __ASM_ARCH_SETUP_H #define __ASM_ARCH_SETUP_H +#include #include #include #include +void ux500_restart(enum reboot_mode mode, const char *cmd); + void __init ux500_map_io(void); extern void __init u8500_map_io(void);