From patchwork Thu Nov 13 09:32:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 40714 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 903EB24493 for ; Thu, 13 Nov 2014 09:42:23 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e51sf9143881eek.10 for ; Thu, 13 Nov 2014 01:42:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=cwjpxjHfV3Q47hK/SYdoul2+/RtH/doGJ+h1TqKrf00=; b=kQum7VYaSEXerXFC96O068hUQmvSM620u0ef536w9oqoXo0Uak39GEc1/+GLkXjt9o 3neBKZ6lcLRQuzoPsVjr9XHDCU9kQw+C8MQ7UhcbVRl6XC+BbQWuJ5rY/iHpg3aQ5+S4 wPY0EtEd7y3BVntXniqSTKRGNiEB5afC5tC38fCz2/C+KhEYTAlI0GWXmNwm2t6meEEY El978rA/1sJ29A9yuH/gdhL68er2e8JTFA78i1IN6EbixEi2qQhSpsxNqKctv5qA4uej osq9K8NYE1+13iqBlKHsm3bedSpU60Vyu/FikwmGWC6AqbW2jI4QAKJG08R30uNZFY69 yIZQ== X-Gm-Message-State: ALoCoQnpMZEGZXUFPiFsyoSTX8Q7A8WQGQphORLRvqlPFAWezexw1xbPj3n+vSYFIDXZywQ8cdm1 X-Received: by 10.180.8.9 with SMTP id n9mr725892wia.6.1415871742872; Thu, 13 Nov 2014 01:42:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.9 with SMTP id p9ls821895lag.80.gmail; Thu, 13 Nov 2014 01:42:22 -0800 (PST) X-Received: by 10.152.5.100 with SMTP id r4mr1368544lar.26.1415871742710; Thu, 13 Nov 2014 01:42:22 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id vr4si37654801lbb.110.2014.11.13.01.42.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 01:42:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id gd6so12610075lab.6 for ; Thu, 13 Nov 2014 01:42:22 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr1296698lbr.74.1415871742593; Thu, 13 Nov 2014 01:42:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp562271lbc; Thu, 13 Nov 2014 01:42:21 -0800 (PST) X-Received: by 10.68.88.225 with SMTP id bj1mr1480139pbb.118.1415871740839; Thu, 13 Nov 2014 01:42:20 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id pd10si25284012pac.16.2014.11.13.01.42.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 01:42:20 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XoqtK-0000bR-W8; Thu, 13 Nov 2014 09:40:39 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoqmU-00078b-36 for linux-arm-kernel@lists.infradead.org; Thu, 13 Nov 2014 09:33:35 +0000 Received: by mail-wi0-f179.google.com with SMTP id ex7so303507wid.0 for ; Thu, 13 Nov 2014 01:33:11 -0800 (PST) X-Received: by 10.180.21.166 with SMTP id w6mr1929140wie.43.1415871191645; Thu, 13 Nov 2014 01:33:11 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id s8sm34780905wjx.9.2014.11.13.01.33.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 01:33:10 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] ARM: integrator: move restart to the device tree Date: Thu, 13 Nov 2014 10:32:53 +0100 Message-Id: <1415871176-11368-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141113_013334_312258_E9D703AC X-CRM114-Status: GOOD ( 15.05 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.179 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.179 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Using the augmented reset driver for the Versatile family, we can move the reset handling for the Integrator out of the machine. We add a "syscon" attribute to the core module, and access the syscon registers using this handle. We need to select SYSCON, POWER, POWER_RESET and POWER_RESET_VERSATILE in order for the restart functionality to always be available on all systems (it should not be optional). Signed-off-by: Linus Walleij --- arch/arm/boot/dts/integrator.dtsi | 2 +- arch/arm/mach-integrator/Kconfig | 4 ++++ arch/arm/mach-integrator/cm.h | 1 - arch/arm/mach-integrator/common.h | 1 - arch/arm/mach-integrator/core.c | 8 -------- arch/arm/mach-integrator/integrator_ap.c | 1 - arch/arm/mach-integrator/integrator_cp.c | 1 - 7 files changed, 5 insertions(+), 13 deletions(-) diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi index 88e3d477bf16..5546630c4fd2 100644 --- a/arch/arm/boot/dts/integrator.dtsi +++ b/arch/arm/boot/dts/integrator.dtsi @@ -6,7 +6,7 @@ / { core-module@10000000 { - compatible = "arm,core-module-integrator"; + compatible = "arm,core-module-integrator", "syscon"; reg = <0x10000000 0x200>; }; diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index aa7eb272e602..62e6db4bd533 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig @@ -8,8 +8,12 @@ config ARCH_INTEGRATOR select GENERIC_CLOCKEVENTS select HAVE_TCM select ICST + select MFD_SYSCON select MULTI_IRQ_HANDLER select PLAT_VERSATILE + select POWER_RESET + select POWER_RESET_VERSATILE + select POWER_SUPPLY select SPARSE_IRQ select USE_OF select VERSATILE_FPGA_IRQ diff --git a/arch/arm/mach-integrator/cm.h b/arch/arm/mach-integrator/cm.h index 4ecff7bff482..5b8ba8247f45 100644 --- a/arch/arm/mach-integrator/cm.h +++ b/arch/arm/mach-integrator/cm.h @@ -11,7 +11,6 @@ void cm_clear_irqs(void); #define CM_CTRL_LED (1 << 0) #define CM_CTRL_nMBDET (1 << 1) #define CM_CTRL_REMAP (1 << 2) -#define CM_CTRL_RESET (1 << 3) /* * Integrator/AP,PP2 specific diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h index ad0ac5547b2c..27a627aa1e8f 100644 --- a/arch/arm/mach-integrator/common.h +++ b/arch/arm/mach-integrator/common.h @@ -4,5 +4,4 @@ extern struct amba_pl010_data ap_uart_data; void integrator_init_early(void); int integrator_init(bool is_cp); void integrator_reserve(void); -void integrator_restart(enum reboot_mode, const char *); void integrator_init_sysfs(struct device *parent, u32 id); diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index e3f3aca43efb..b06fd9f99a46 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -140,14 +140,6 @@ void __init integrator_reserve(void) memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); } -/* - * To reset, we hit the on-board reset register in the system FPGA - */ -void integrator_restart(enum reboot_mode mode, const char *cmd) -{ - cm_control(CM_CTRL_RESET, CM_CTRL_RESET); -} - static u32 integrator_id; static ssize_t intcp_get_manf(struct device *dev, diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 8a879b654fde..e6854c3f854e 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -365,6 +365,5 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)") .init_early = ap_init_early, .init_irq = ap_init_irq_of, .init_machine = ap_init_of, - .restart = integrator_restart, .dt_compat = ap_dt_board_compat, MACHINE_END diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index cca02eb75eb5..fa8475b4872d 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -324,6 +324,5 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") .init_early = intcp_init_early, .init_irq = intcp_init_irq_of, .init_machine = intcp_init_of, - .restart = integrator_restart, .dt_compat = intcp_dt_board_compat, MACHINE_END