From patchwork Fri Jun 14 13:22:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 17928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 18F0D25E08 for ; Fri, 14 Jun 2013 13:23:03 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf523016ghb.10 for ; Fri, 14 Jun 2013 06:23:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=zxyiJeWxUSudyCFUZhJ01NNuhfZpqYTdbhElK3uwojQ=; b=Yyyfz/crZ15G3o8OhqM06oanCSV7DvoZS6vGV/UtYnr/43VndsIBqw9619nXFYeVRd Kgl8gq5MFDs8BpaNlgvXdmtY2YfVO69pqndqgi5yGHGGIvwqGl3EMPnvxZMDbcj3Mzcz 0G8l7aTVEZfdgnxsKdFUvH5zeMvDCQDlw13R+O4Q7ymTD0+D/Zk8taAXr13+SQLxmWAZ SFJZNxHEVIq1jbg9zeHUqQ5iR0G+Iu2O0/DsGOR3NWoJATp6qpwIqr0NPki87OXII00r 99nAl300svLUK/I0TnGzo8ziOjyW1SGMlkjpau9Zg0mu+tc7AQDufpfw/Am3Kjy4Uk/2 w/fg== X-Received: by 10.224.86.200 with SMTP id t8mr1137862qal.0.1371216182422; Fri, 14 Jun 2013 06:23:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.143 with SMTP id y15ls198779qeb.82.gmail; Fri, 14 Jun 2013 06:23:02 -0700 (PDT) X-Received: by 10.220.123.131 with SMTP id p3mr928829vcr.69.1371216182097; Fri, 14 Jun 2013 06:23:02 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id ra6si936238vec.8.2013.06.14.06.23.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 06:23:02 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id da11so454658veb.20 for ; Fri, 14 Jun 2013 06:23:02 -0700 (PDT) X-Received: by 10.52.170.148 with SMTP id am20mr783253vdc.75.1371216181987; Fri, 14 Jun 2013 06:23:01 -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.58.191.99 with SMTP id gx3csp62842vec; Fri, 14 Jun 2013 06:22:59 -0700 (PDT) X-Received: by 10.180.182.228 with SMTP id eh4mr1332411wic.42.1371216178719; Fri, 14 Jun 2013 06:22:58 -0700 (PDT) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [2a00:1450:400c:c00::232]) by mx.google.com with ESMTPS id q8si837954wjr.112.2013.06.14.06.22.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 06:22:58 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::232 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:400c:c00::232; Received: by mail-wg0-f50.google.com with SMTP id k14so509228wgh.5 for ; Fri, 14 Jun 2013 06:22:58 -0700 (PDT) X-Received: by 10.194.249.231 with SMTP id yx7mr1456720wjc.13.1371216177985; Fri, 14 Jun 2013 06:22:57 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e74:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPSA id fb2sm3205850wic.4.2013.06.14.06.22.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Jun 2013 06:22:56 -0700 (PDT) From: Fabio Baltieri To: Linus Walleij Cc: Lee Jones , Srinidhi Kasagar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Fabio Baltieri Subject: [PATCH] ARM: ux500: add restart support via prcmu Date: Fri, 14 Jun 2013 15:22:40 +0200 Message-Id: <1371216160-2595-1-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.2 X-Gm-Message-State: ALoCoQl/ZqqV0T0bSJEXRdNLD6sbaf7VGQ7ElmtWxg9RcClg6K25wYZs7Vf095hDMoKgwBK+UtaY X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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: , Add necessary code to restart ux500 based machines using prcmu_system_reset(). Signed-off-by: Fabio Baltieri --- Hi Linus, this is something I had in my tree for some time. This adds basic soft-reboot support for all ux500 machines using prcmu (the actual reboot code was already there) and may also be useful as a base to add the remaining "reboot reason" code if necessary. This is based on your current ste-next branch. Thanks, Fabio arch/arm/mach-ux500/board-mop500.c | 4 ++++ arch/arm/mach-ux500/cpu-db8500.c | 1 + arch/arm/mach-ux500/cpu.c | 8 ++++++++ arch/arm/mach-ux500/setup.h | 2 ++ 4 files changed, 15 insertions(+) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 2d70e2b..bb569bf 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -697,6 +697,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") @@ -706,6 +707,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+") @@ -716,6 +718,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") @@ -727,4 +730,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 27e5566..caded58 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -326,6 +326,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 b6145ea..7490224 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(char 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..e8be021 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -15,6 +15,8 @@ #include #include +void ux500_restart(char mode, const char *cmd); + void __init ux500_map_io(void); extern void __init u8500_map_io(void);