From patchwork Fri Jun 24 10:49:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102093 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp880105qgy; Fri, 24 Jun 2016 03:48:54 -0700 (PDT) X-Received: by 10.98.112.196 with SMTP id l187mr2607541pfc.59.1466765334183; Fri, 24 Jun 2016 03:48:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si6222650pfr.155.2016.06.24.03.48.53; Fri, 24 Jun 2016 03:48:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbcFXKsw (ORCPT + 30 others); Fri, 24 Jun 2016 06:48:52 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56206 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbcFXKsu (ORCPT ); Fri, 24 Jun 2016 06:48:50 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M0iAY-1bVR6D2DZm-00ur72; Fri, 24 Jun 2016 12:48:11 +0200 From: Arnd Bergmann To: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org, Sascha Hauer , Fabio Estevam , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 1/6] ARM: imx: remove cpu_is_mx1 check Date: Fri, 24 Jun 2016 12:49:56 +0200 Message-Id: <20160624105001.3166287-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624105001.3166287-1-arnd@arndb.de> References: <20160624105001.3166287-1-arnd@arndb.de> X-Provags-ID: V03:K0:YIpZNbjzRhtX0RbC06qNJTiuRKUJI+QREQNC2DjfY8YBiUTOyex 1/3tUwJ6VfoR22uzqVklTXPwx+VLQPtt0adM6Fdzx5rpV82tEgLwZqc/i18lzsPex75vNMl tn6YAC6SNusB8LpyHIhiJ7dX4bd/ZsGvK6zMElWc1ubphE7NgSo4wYc34xnmJ1+8v5Zvb1p d52+lwfzr156ZEsGrtZkw== X-UI-Out-Filterresults: notjunk:1; V01:K0:iP0vggEP1xU=:JYgUT1GgZHTI64htyKqNeS lHpjrvEbjeLHzW5WjJCaZXJxPuvo8q2TKo/Y7Mi3IVw2fKvveCpneuv76cFIc0mMpAJzla9e4 rVqNtLUbkQIut0K0168YJTLnyF1s7joDA7eiqDdF4ab8DzmV6TLm8jhvGKE4/MWsoi79Ftuuq XiQco4JG9Lrw8xmcfFsRqzfaEOJDwKwgBNHOKWjF3pGScdZajdIGC2yUQvX0NKJ9zqC7s9sXy ARF1LcOpxtuw02+gTNP3TnFaAohNJ6UqcM+QxVU+fi4zfCgZoMyu1KlGCrs/hzrN/sTI/CpPi XUkt0SlZUwmCORfgjpwnzKmv/kpBIkvu/5tZ2DQHeOl6UtAJ8zFlu6mRpa3f1jTFhmOdQ4ylt Ss3U6q0vwTNCMrKK/f3iUVMyJTqWzMYILPktizIMaUzrecnxfsiSMHWEcKLnsonfDoRFk3HFD yDYEhVgR97ZuKMpnUdBrXJ/k3Fi/a24D4+Y7uQrm6I2SeC8iUNCdCKAdUOtCYBnMvcaUafAmb uHQaM9+/UWfTnpbaYr5+9D9u2RPMD2nnn0oICOB6IOhzmm2zfcUUkEi0OB+2qCKdWcjYNSqA+ 0Ec3o3r7VBZQZyvbprUR2JKxTJCq5tklJRb1PipdJfv921KxEaIvwnkzTHeDafpFOreuDdY5/ W+KVd/EnbiRzX1vjYkbKbFUedVYCSewytc3gy4VkUQrvo5q1lSgj+XUYs25jTbpeoClg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is only one call site for this, and it's easily replaced by initializing the reset value at boot time. Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/common.h | 1 + arch/arm/mach-imx/mm-imx1.c | 2 +- arch/arm/mach-imx/system.c | 16 +++++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 60d9ae63f76e..0a1d1f175b7a 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -54,6 +54,7 @@ struct platform_device *mxc_register_gpio(char *name, int id, void mxc_set_cpu_type(unsigned int type); void mxc_restart(enum reboot_mode, const char *); void mxc_arch_reset_init(void __iomem *); +void imx1_reset_init(void __iomem *); void imx_set_aips(void __iomem *); void imx_aips_allow_unprivileged_access(const char *compat); int mxc_device_init(void); diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c index e065fedb3ad4..9a42f19be81e 100644 --- a/arch/arm/mach-imx/mm-imx1.c +++ b/arch/arm/mach-imx/mm-imx1.c @@ -50,7 +50,7 @@ void __init mx1_init_irq(void) void __init imx1_soc_init(void) { - mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); + imx1_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); mxc_device_init(); mxc_register_gpio("imx1-gpio", 0, MX1_GPIO1_BASE_ADDR, SZ_256, diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index e442ed7f7ff5..c06af650e6b1 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c @@ -34,25 +34,19 @@ static void __iomem *wdog_base; static struct clk *wdog_clk; +static int wcr_enable = (1 << 2); /* * Reset the system. It is called by machine_restart(). */ void mxc_restart(enum reboot_mode mode, const char *cmd) { - unsigned int wcr_enable; - if (!wdog_base) goto reset_fallback; if (!IS_ERR(wdog_clk)) clk_enable(wdog_clk); - if (cpu_is_mx1()) - wcr_enable = (1 << 0); - else - wcr_enable = (1 << 2); - /* Assert SRS signal */ imx_writew(wcr_enable, wdog_base); /* @@ -89,6 +83,14 @@ void __init mxc_arch_reset_init(void __iomem *base) clk_prepare(wdog_clk); } +#ifdef CONFIG_SOC_IMX1 +void __init imx1_reset_init(void __iomem *base) +{ + wcr_enable = (1 << 0); + mxc_arch_reset_init(base); +} +#endif + #ifdef CONFIG_CACHE_L2X0 void __init imx_init_l2cache(void) {