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: 19331 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8BEDD2469E for ; Mon, 19 Aug 2013 19:28:20 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf5977651vcb.0 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=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bMRJRuesIWFUY4Wm0ilkZv/igSGo86df53qiCopnGdk=; b=nDULVVQhvpBQbZgGJWpeskKvFCrIVbUaSMtPr/uhjPRtbLpKHaNNsm3nDuKN5JO/Ie yogNWbctj+WEXim8bs7LTaoaAfC4lu4VWRMUvkOYaVl+CU3CpdIaTSGbF+Y6KiXfjA2E M6T7iylDTiDIBp8A9QFG/h3H91SGTnk3c8IvaJILADQi+h2oR5AUZg25zBQTDOxRWUGw fcFuH3KoOy+TSDvIbAACWwMHVuJ88aIPNKxX7cs0kFtsE/tdF3Pc1avNIrbExAk+Bmdr DfldSu6l4JmF2jpeCI6JEVbewqblDwEYohF2sLVHKUHW2ICODYXVA5uz1IrEFzwzhx3Y DWqw== X-Received: by 10.236.145.196 with SMTP id p44mr4577683yhj.24.1376940500236; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.130 with SMTP id g2ls1246125qek.42.gmail; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) X-Received: by 10.52.0.238 with SMTP id 14mr11972105vdh.3.1376940500132; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id oz2si2700152veb.122.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 12:28:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so3419265vbf.24 for ; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) X-Gm-Message-State: ALoCoQnduks4LyxLzUYuwPdGTJgk4rWV8SBUBbPyn2WUsHwHiANwNE/iVK+YHFWdxCiehYJAWoP1 X-Received: by 10.220.181.136 with SMTP id by8mr2284737vcb.11.1376940500042; Mon, 19 Aug 2013 12:28:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp113329vcz; Mon, 19 Aug 2013 12:28:19 -0700 (PDT) X-Received: by 10.152.2.130 with SMTP id 2mr3006670lau.35.1376940498596; Mon, 19 Aug 2013 12:28:18 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx.google.com with ESMTPS id h8si5862266lah.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 12:28:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.181 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id o10so3376300lbi.12 for ; Mon, 19 Aug 2013 12:28:18 -0700 (PDT) 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 Cc: Fabio Baltieri , Linus Walleij 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);