From patchwork Fri Jun 24 09:41:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102101 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp854739qgy; Fri, 24 Jun 2016 02:40:53 -0700 (PDT) X-Received: by 10.66.132.45 with SMTP id or13mr5717783pab.79.1466761253164; Fri, 24 Jun 2016 02:40:53 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 204si5899420pfc.127.2016.06.24.02.40.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:40:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNae-0004l6-Bt; Fri, 24 Jun 2016 09:39:56 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNaa-0004bj-Tr for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:54 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MF3Up-1bAXdK3p6J-00GJrv; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 1/7] ARM: ux500: move l2x0 init to .init_irq Date: Fri, 24 Jun 2016 11:41:26 +0200 Message-Id: <20160624094132.1852086-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:vjCYFJ81fl8mbpTjvhBZdKrQtofVbdpbhZREtCdOD/pevw2m4V8 5E448wJ276/ABza4tzuan3O9DFhJve+uQSC6z/pCT3rTxfxfl0co5ZBqZEQbhA5yEAobvsE z1KBlvJMnZeY0Mzdoup1RMMm767fJQynl7FmkRR/VjR7V9heJIvbZvj1gjo2BlREwmf2CS1 gbRFf5zsuLQb/dEa5oVsw== X-UI-Out-Filterresults: notjunk:1; V01:K0:SneqntN/CIQ=:vkRQneEVdH9iJSOov1VMdJ BSvMyJHe+3XERro8EPHey5yr/aEWLq/uF9Dyuzzlr1DvIf9etYR4P3SgH13haUWAtOde3uLtv YcH6oStQtYaorq3+eZRXujZytvNaD+5+olFZx4FMTXkg5JBiwEMi4TSWXMYe1V2VKf/gYNRgT rqRNYRy+33M2GB6DPuhyEh5e7zf0B0q2mJUv/VEb402mz9mw4YoVmGbeUoZE6yfPnsECFlBPn IDAvlNAA4BY+GuYZPqs41DJCNSXh8vIw4oc5FOWRxdh8XyQGTNZpYuNjhmjT9NfnmumMunrwR RiQiz5I4Mq9UEvRMPslTa1AlfqAxb8dUAM2yXqBv0WNUoowoHjHDogWP19sf3E+UOTh4Kx8UP +/ir4gOAXU8OAlNnozTxys1TQXLvR60YSovL1o+rsm9su2Dd0SFEaPRJZTtkPqjAx2wXtiT15 qdWJ9F72mqm6QeblYkz+I5Quq9HSGS/CBhNLj25rbSoT53n9pWrv25NlVXccVvtHTCZlNuYSI iMG8U523Wqy8umKBI9T6igwydaheuRbAZnnkuoE8THDZxbxsCMJ1eGSpTULooh6vm4kcBup+R 4e7G8vyLI372IMF9uuMSpiiARK9LisajDsUoW8oBz/TWoqCmGjMAQrtle/6kwbkpvKcl4decl GL8HBocN4TOmceq4uZfyy6UdQEPDeGM4yFVa4nkzp6H992bEjb++X2XJScv4wc5i6LIs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023953_317037_5C881E0B X-CRM114-Status: GOOD ( 13.75 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.24 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.24 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The generic IRQ init function also enables the l2 cache implicitly when the machine descriptor sets an .l2c_aux_mask. Let's use that on ux500 and remove the ux500_l2x0_init() along with the cpu_is_u8500_family checks. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/cache-l2x0.c | 8 +------- arch/arm/mach-ux500/cpu-db8500.c | 3 ++- arch/arm/mach-ux500/cpu.c | 1 + arch/arm/mach-ux500/setup.h | 3 +++ 4 files changed, 7 insertions(+), 8 deletions(-) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c index 780bd13cd7e3..d7abc1187769 100644 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ b/arch/arm/mach-ux500/cache-l2x0.c @@ -51,17 +51,11 @@ static void ux500_l2c310_write_sec(unsigned long val, unsigned reg) */ } -static int __init ux500_l2x0_init(void) +void __init ux500_l2x0_init(void) { - /* Multiplatform guard */ - if (!((cpu_is_u8500_family() || cpu_is_ux540_family()))) - return -ENODEV; - /* Unlock before init */ ux500_l2x0_unlock(); outer_cache.write_sec = ux500_l2c310_write_sec; - l2x0_of_init(0, ~0); return 0; } -early_initcall(ux500_l2x0_init); diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index bbd1b4b8d441..3874e9c236e9 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -141,10 +141,11 @@ static const char * stericsson_dt_platform_compat[] = { }; DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") + .l2c_aux_val = 0, + .l2c_aux_mask = ~0, .map_io = u8500_map_io, .init_irq = ux500_init_irq, .init_machine = u8500_init_machine, - .init_late = NULL, .dt_compat = stericsson_dt_platform_compat, .restart = ux500_restart, MACHINE_END diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 82156cbc22ce..f8c2d6f2fb7e 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -65,6 +65,7 @@ void __init ux500_init_irq(void) } prcmu_early_init(r.start, r.end-r.start); ux500_pm_init(r.start, r.end-r.start); + ux500_l2x0_init(); /* * Init clocks here so that they are available for system timer diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index e606847c8b58..8b44b646b191 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -14,6 +14,9 @@ #include #include + +void ux500_l2x0_init(void); + void ux500_restart(enum reboot_mode mode, const char *cmd); void __init ux500_setup_id(void); From patchwork Fri Jun 24 09:41:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102096 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855262qgy; Fri, 24 Jun 2016 02:42:15 -0700 (PDT) X-Received: by 10.66.89.34 with SMTP id bl2mr5971258pab.80.1466761335410; Fri, 24 Jun 2016 02:42:15 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ab14si5904152pac.110.2016.06.24.02.42.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:42:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNbj-0006gF-UK; Fri, 24 Jun 2016 09:41:03 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004bz-Pm for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:58 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Ls9Oh-1bMRkj0Z9r-013s59; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 2/7] ARM: ux500: use CLK_OF_DECLARE() Date: Fri, 24 Jun 2016 11:41:27 +0200 Message-Id: <20160624094132.1852086-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:ziVLpl8yJ/o4xDpdf40P+1qYJ4zHMCZ9bYdY/2+YcNzIyFljfgT KX2Z5r3ui0hAWXyQBeFVQVC04QkNtL658hEtXu1FKOOSxhZry6i7LmSH+uDExfxXusPwuUB RfxvzbT7eTycROBPjQHRL6k7kX6tdYD0Y6hDfcfjrWj5WcENjZAeIKyNpCZqz22ddquOK3R Lr6ENtDgh9pQnJr+6f4HA== X-UI-Out-Filterresults: notjunk:1; V01:K0:1l13Sq4/DOA=:jVTfeCVxJ7TRYrBPWGfgS3 MqJkV6P+90Tsh7myZlhSTjgAa0JmQmDLZw5cvJ6+1Id0d3xFSBMdkOoqH0pzeCRB76AaMJmX5 wleS4cujckKnW3RVbCNQSxTHfZtJcSSeUNDzli/Qxu0NRS0qMwwwpM34HJy8LUI0yPiBSuP9j VVCMByVpAach6i1QNwpZbZvCsOIfoRsWfe3RxpEBFAFMcrkkVCUzn6hYm9pnZaFPp/P/WtO01 Kzfj8w0M9qmO0pfOyxSqHBUZiYwX8uVJj4JStHvPhhtGDyJh6s0xkAdGbslpZKiXup0MgDlXG UutLRcpOk1pdUSzia1EBsSVWhJUuzW1h9Gg1ASdP+cxkIfVONIST9Dn8zc+I2YyeTUL2GHS4j ikmHnXgpPE73c/fXk1ISsCAcVnUv7rbJAyOanxueGuZqlhoERMgNe73YvYxedv8/oqbp+T7C/ vKrC8bs9dxWUPxeq045AiVEmQWFe+YItUW+Zc+mUkKvcdscjwdkD/iraLSi0zi742JX2z5xNP BXwrp2T4/oMXLYhq4Ao8PXXC6BFnaZkqXAn4VT54zxr7QSp4vhC51/U4DgrFemWUcir/0+mUa xY50QCSrVfoIB0OpQTT6G7OWfpZp9K+gRcax2ThgStv1nDYyIpKKQI0THVng76Fy2qJCkpLDe 6BNybj1AOMbBliRjXg8Exynl1skhNuf5XqZf1H9/He6YTyM4TCGBzDXAM0hkrJAkFXt8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_292329_40C5E1D4 X-CRM114-Status: GOOD ( 17.11 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.10 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The ux500 DT support predates the CLK_OF_DECLARE macro and calls directly into the clk driver from platform code. Converting this to CLK_OF_DECLARE makes the code much nicer and similar to how modern platforms do it today. It also removes the last user of cpu_is_u8500_family() etc. Signed-off-by: Arnd Bergmann --- MAINTAINERS | 1 - arch/arm/mach-ux500/cpu.c | 12 ------------ drivers/clk/ux500/u8500_of_clk.c | 16 ++-------------- drivers/clk/ux500/u8540_clk.c | 16 ++-------------- drivers/clk/ux500/u9540_clk.c | 4 ++-- include/linux/platform_data/clk-ux500.h | 17 ----------------- 6 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 include/linux/platform_data/clk-ux500.h -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/MAINTAINERS b/MAINTAINERS index eff103763782..e78251a18255 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1842,7 +1842,6 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) T: git git://git.linaro.org/people/ulfh/clk.git S: Maintained F: drivers/clk/ux500/ -F: include/linux/platform_data/clk-ux500.h ARM/VERSATILE EXPRESS PLATFORM M: Liviu Dudau diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index f8c2d6f2fb7e..63853e76a4e1 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -66,17 +65,6 @@ void __init ux500_init_irq(void) prcmu_early_init(r.start, r.end-r.start); ux500_pm_init(r.start, r.end-r.start); ux500_l2x0_init(); - - /* - * Init clocks here so that they are available for system timer - * initialization. - */ - if (cpu_is_u8500_family()) - u8500_clk_init(); - else if (cpu_is_u9540()) - u9540_clk_init(); - else if (cpu_is_u8540()) - u8540_clk_init(); } static const char * __init ux500_get_machine(void) diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c index 9a736d939806..e960d686d9db 100644 --- a/drivers/clk/ux500/u8500_of_clk.c +++ b/drivers/clk/ux500/u8500_of_clk.c @@ -11,7 +11,6 @@ #include #include #include -#include #include "clk.h" #define PRCC_NUM_PERIPH_CLUSTERS 6 @@ -48,11 +47,6 @@ static struct clk *ux500_twocell_get(struct of_phandle_args *clkspec, return PRCC_SHOW(clk_data, base, bit); } -static const struct of_device_id u8500_clk_of_match[] = { - { .compatible = "stericsson,u8500-clks", }, - { }, -}; - /* CLKRST4 is missing making it hard to index things */ enum clkrst_index { CLKRST1_INDEX = 0, @@ -63,22 +57,15 @@ enum clkrst_index { CLKRST_MAX, }; -void u8500_clk_init(void) +static void u8500_clk_init(struct device_node *np) { struct prcmu_fw_version *fw_version; - struct device_node *np = NULL; struct device_node *child = NULL; const char *sgaclk_parent = NULL; struct clk *clk, *rtc_clk, *twd_clk; u32 bases[CLKRST_MAX]; int i; - if (of_have_populated_dt()) - np = of_find_matching_node(NULL, u8500_clk_of_match); - if (!np) { - pr_err("Either DT or U8500 Clock node not found\n"); - return; - } for (i = 0; i < ARRAY_SIZE(bases); i++) { struct resource r; @@ -573,3 +560,4 @@ void u8500_clk_init(void) of_clk_add_provider(child, of_clk_src_simple_get, twd_clk); } } +CLK_OF_DECLARE(u8500_clks, "stericsson,u8500-clks", u8500_clk_init); diff --git a/drivers/clk/ux500/u8540_clk.c b/drivers/clk/ux500/u8540_clk.c index 86549e59fb42..133859f0e2bf 100644 --- a/drivers/clk/ux500/u8540_clk.c +++ b/drivers/clk/ux500/u8540_clk.c @@ -12,14 +12,8 @@ #include #include #include -#include #include "clk.h" -static const struct of_device_id u8540_clk_of_match[] = { - { .compatible = "stericsson,u8540-clks", }, - { } -}; - /* CLKRST4 is missing making it hard to index things */ enum clkrst_index { CLKRST1_INDEX = 0, @@ -30,19 +24,12 @@ enum clkrst_index { CLKRST_MAX, }; -void u8540_clk_init(void) +static void u8540_clk_init(struct device_node *np) { struct clk *clk; - struct device_node *np = NULL; u32 bases[CLKRST_MAX]; int i; - if (of_have_populated_dt()) - np = of_find_matching_node(NULL, u8540_clk_of_match); - if (!np) { - pr_err("Either DT or U8540 Clock node not found\n"); - return; - } for (i = 0; i < ARRAY_SIZE(bases); i++) { struct resource r; @@ -607,3 +594,4 @@ void u8540_clk_init(void) bases[CLKRST6_INDEX], BIT(0), CLK_SET_RATE_GATE); clk_register_clkdev(clk, NULL, "rng"); } +CLK_OF_DECLARE(u8540_clks, "stericsson,u8540-clks", u8540_clk_init); diff --git a/drivers/clk/ux500/u9540_clk.c b/drivers/clk/ux500/u9540_clk.c index 2138a4c8cbca..7b6bca49ce42 100644 --- a/drivers/clk/ux500/u9540_clk.c +++ b/drivers/clk/ux500/u9540_clk.c @@ -9,10 +9,10 @@ #include #include -#include #include "clk.h" -void u9540_clk_init(void) +static void u9540_clk_init(struct device_node *np) { /* register clocks here */ } +CLK_OF_DECLARE(u9540_clks, "stericsson,u9540-clks", u9540_clk_init); diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h deleted file mode 100644 index 3af0da1f3be5..000000000000 --- a/include/linux/platform_data/clk-ux500.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Clock definitions for ux500 platforms - * - * Copyright (C) 2012 ST-Ericsson SA - * Author: Ulf Hansson - * - * License terms: GNU General Public License (GPL) version 2 - */ - -#ifndef __CLK_UX500_H -#define __CLK_UX500_H - -void u8500_clk_init(void); -void u9540_clk_init(void); -void u8540_clk_init(void); - -#endif /* __CLK_UX500_H */ From patchwork Fri Jun 24 09:41:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102094 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855339qgy; Fri, 24 Jun 2016 02:42:27 -0700 (PDT) X-Received: by 10.98.101.198 with SMTP id z189mr5479792pfb.53.1466761347730; Fri, 24 Jun 2016 02:42:27 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hf8si5931991pac.23.2016.06.24.02.42.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:42:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNcA-00078l-R7; Fri, 24 Jun 2016 09:41:30 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004by-Po for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:57 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Lp7GG-1bsiXO1VTQ-00exeO; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 3/7] ARM: ux500: remove cpu_is_u* helpers Date: Fri, 24 Jun 2016 11:41:28 +0200 Message-Id: <20160624094132.1852086-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:KXQytD5Ao8/slwaUoJvBd/Bi+dM41hTnCaWzBY9ImkCx0VsMI6x ++zTITEFVftpm8BPJhNzx905wrz1L0U+F9o81fDDsGOfpge+4pSa7zD2t4ylDXRX/+E9iXl ZPQWyKjxHwAcQBP9sAnu1XpmDFhMnEu4DhG/+iaMS0seJLSnG04PAm2nqlOo37Q4VQRqeEA Inop7DpFlt/qWXq92WNLw== X-UI-Out-Filterresults: notjunk:1; V01:K0:iARxttvfa6w=:OObeUMGAq79k3W+ndhKyP4 Mm4ANbsFJGOCxXkFSQ9ORrx+iNjwu9Y6pbJkCEDVMSWAOBFEleTFONeHhnZ7Eb6tXNGctNTtS lHxx4Qaf3JHHcPhnuOn0xKnB5pD9TSTLWZXf6enChO/ztGY8hU1b/y7yjcx240vqqCbACzDrm ba16hFRoZM7jZaUJ7iAFW49dhVkm12GDtIGSfFvVmFs1zaQ1y1WmdzM2CRrg9Asc6J/Z+U4Ip xHrc6jTV+b+Qeu3UHKuzQD652n+QBBrycF+DKW9Vskww98GNRdSCnNKpq7EEOIGLKgqRtidp7 yl5SqJ75M4CPmzSJj2CxJCsK0iq7ucaK9S8GG5rnMk229cp+u1RrVArMlXdt7z359GkCj1FdC 92QwREoczZUmMVciNVdgMF28ziKRh8Mn+Qh7s1XgV+pXzUyvVEkwFfnHGGyh8udf985n33dG0 FpMCuyfGNHBgklKlL3yeKwcVxmK5QqNgDyubHwoWkepBDgSOqkLcHOSXaPv04f6DpniWrGPgO iWeKj1l1UiArmqJCH1hJ+ZrzUKo3vGSedKqx6j4TExPLkrXqcahW9s3Knv4fNS2CDtVPnb5/D Vi0zotGeVxSCe5fG05nX4hRFTskm1S2j27lYatCrFXSYT5lSGTCz3hyISqR4x/XuASaG1UQbZ j3cvzUyBJ61Z0x48nx5NV1iA5mzMIsXPPWt7apByiwtFz3ByYiYiTNVdYYy1lfBtwxi4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_335646_C0E782B5 X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.10 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org These functions are all unused now and can be removed. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/id.h | 107 ----------------------------------------------- 1 file changed, 107 deletions(-) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/id.h b/arch/arm/mach-ux500/id.h index bcc58a8cccbc..929f78ecf3df 100644 --- a/arch/arm/mach-ux500/id.h +++ b/arch/arm/mach-ux500/id.h @@ -32,113 +32,6 @@ static inline unsigned int __attribute_const__ dbx500_revision(void) return dbx500_id.revision; } -/* - * SOCs - */ - -static inline bool __attribute_const__ cpu_is_u8500(void) -{ - return dbx500_partnumber() == 0x8500; -} - -static inline bool __attribute_const__ cpu_is_u8520(void) -{ - return dbx500_partnumber() == 0x8520; -} - -static inline bool cpu_is_u8500_family(void) -{ - return cpu_is_u8500() || cpu_is_u8520(); -} - -static inline bool __attribute_const__ cpu_is_u9540(void) -{ - return dbx500_partnumber() == 0x9540; -} - -static inline bool __attribute_const__ cpu_is_u8540(void) -{ - return dbx500_partnumber() == 0x8540; -} - -static inline bool __attribute_const__ cpu_is_u8580(void) -{ - return dbx500_partnumber() == 0x8580; -} - -static inline bool cpu_is_ux540_family(void) -{ - return cpu_is_u9540() || cpu_is_u8540() || cpu_is_u8580(); -} - -/* - * 8500 revisions - */ - -static inline bool __attribute_const__ cpu_is_u8500ed(void) -{ - return cpu_is_u8500() && dbx500_revision() == 0x00; -} - -static inline bool __attribute_const__ cpu_is_u8500v1(void) -{ - return cpu_is_u8500() && (dbx500_revision() & 0xf0) == 0xA0; -} - -static inline bool __attribute_const__ cpu_is_u8500v10(void) -{ - return cpu_is_u8500() && dbx500_revision() == 0xA0; -} - -static inline bool __attribute_const__ cpu_is_u8500v11(void) -{ - return cpu_is_u8500() && dbx500_revision() == 0xA1; -} - -static inline bool __attribute_const__ cpu_is_u8500v2(void) -{ - return cpu_is_u8500() && ((dbx500_revision() & 0xf0) == 0xB0); -} - -static inline bool cpu_is_u8500v20(void) -{ - return cpu_is_u8500() && (dbx500_revision() == 0xB0); -} - -static inline bool cpu_is_u8500v21(void) -{ - return cpu_is_u8500() && (dbx500_revision() == 0xB1); -} - -static inline bool cpu_is_u8500v22(void) -{ - return cpu_is_u8500() && (dbx500_revision() == 0xB2); -} - -static inline bool cpu_is_u8500v20_or_later(void) -{ - return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); -} - -/* - * 8540 revisions - */ - -static inline bool __attribute_const__ cpu_is_u8540v10(void) -{ - return cpu_is_u8540() && dbx500_revision() == 0xA0; -} - -static inline bool __attribute_const__ cpu_is_u8580v10(void) -{ - return cpu_is_u8580() && dbx500_revision() == 0xA0; -} - -static inline bool ux500_is_svp(void) -{ - return false; -} - #define ux500_unknown_soc() BUG() #endif From patchwork Fri Jun 24 09:41:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102099 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp854930qgy; Fri, 24 Jun 2016 02:41:21 -0700 (PDT) X-Received: by 10.66.253.70 with SMTP id zy6mr5682060pac.55.1466761281690; Fri, 24 Jun 2016 02:41:21 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id z73si5891643pfi.134.2016.06.24.02.41.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:41:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNb1-00062n-FX; Fri, 24 Jun 2016 09:40:19 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNaa-0004bt-Tt for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:54 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LzJrN-1bTast2OuH-014Qa1; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 4/7] ARM: ux500: consolidate soc_device code in id.c Date: Fri, 24 Jun 2016 11:41:29 +0200 Message-Id: <20160624094132.1852086-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:ZsC9+yOLpP3f5Ukrt4TalZ6z7lwncsm9ti9hImK/zInL5Dww7Wo CvEZ/xlw4Lc2DjuW5aDS2E6IANKV++B2eBa3jEKZyBRoUerGklHZtdCc4m/wpi+jCAqY84+ DF5JrvXr2zUdzdgDeCYTbEKS+o6Qrq4HgqxyRqupSqa9JytwfM/z3mF2MEis1O8capb+sT5 WwQ8DDT61BLnv87dwTu8w== X-UI-Out-Filterresults: notjunk:1; V01:K0:cM+VMbxwtlU=:3vBELuah8BdZ8Svj4X+ntM TuR3+5aaMvwmqh7z8Z/i0jrvUbyYRr/bXDgoauMLl2BGgezJdWM77pJv7xHkmIFARksM4vKGq mH2gT3pLa5uME5sr9qQ84BMtEEujuGrXH2tvEg2eXoP5XEJlW1z5Pjj8Sy8NCCqNYr2ihWCBi hK3lAvQTh5Sn1dCrKFX2YP3bVqX2jZp+VlkaQNQvdYGVyNTElyFKXVfXl2I0az9Iu/3WSCjcT r1kzJ3xiJ3o0TpL1+tQap2nSAuc5+oiTEBF12fOR7coUoUs4oK4GZbXRcHYkkF7D7npfFcnZp 9tDSRB7VRNBXE80e1FGqxNgqXYRPKIhkGVauSHrrCIKYMtTPpdq1LkVKyw/vqFaN0KV2BXfxP sQk6it2X2UR48U94cufPwfmLP5SBdrjPmwt9mS4Jh6jIVAADOs6nZDKFPPLmwj0MPatTeGHWP xsavgygmB1Og91fxvqFD2V+kWE38QI+rYODl8FX5FicPuGpCpZ2toUx5MnQx5vhD/lxBqaWgm 9+v2OCLCIL9WsxKZ4BlkUHvGYYdBZ20leiNUDUIofu24AzW1ttkQNg6Kz82H3SUKg9FwnkzgE X6HdBuENWc5/ZHSVNSH1+rKUYRTuuGgOwGTKIYwAT1rXTkoXqfQpoUVuaHB6ukk8fe5vmvd2v l7TelDW0ByCdAGjAcUyUL6K+CBjjm/vbJcNmg65/JHyse7mRF09k5aLFY21mwVko/q0k= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023953_294093_79DF6987 X-CRM114-Status: GOOD ( 19.75 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.24 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.24 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Nothing else uses the global dbx500_asic_id structure, so we can merge the two small files that reference it into one. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/cache-l2x0.c | 1 - arch/arm/mach-ux500/cpu-db8500.c | 28 +--------- arch/arm/mach-ux500/cpu.c | 70 ------------------------- arch/arm/mach-ux500/id.c | 110 +++++++++++++++++++++++++++++++++++++-- arch/arm/mach-ux500/id.h | 37 ------------- arch/arm/mach-ux500/platsmp.c | 1 - arch/arm/mach-ux500/setup.h | 4 +- 7 files changed, 107 insertions(+), 144 deletions(-) delete mode 100644 arch/arm/mach-ux500/id.h -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c index d7abc1187769..adec59cc2e1d 100644 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ b/arch/arm/mach-ux500/cache-l2x0.c @@ -12,7 +12,6 @@ #include #include "db8500-regs.h" -#include "id.h" static int __init ux500_l2x0_unlock(void) { diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 3874e9c236e9..e7eba473d3bd 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -20,7 +20,6 @@ #include #include #include -#include #include @@ -60,31 +59,6 @@ static struct arm_pmu_platdata db8500_pmu_platdata = { .handle_irq = db8500_pmu_handler, }; -static const char *db8500_read_soc_id(void) -{ - void __iomem *uid; - const char *retstr; - - uid = ioremap(U8500_BB_UID_BASE, 0x20); - if (!uid) - return NULL; - /* Throw these device-specific numbers into the entropy pool */ - add_device_randomness(uid, 0x14); - retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", - readl((u32 *)uid+0), - readl((u32 *)uid+1), readl((u32 *)uid+2), - readl((u32 *)uid+3), readl((u32 *)uid+4)); - iounmap(uid); - return retstr; -} - -static struct device * __init db8500_soc_device_init(void) -{ - const char *soc_id = db8500_read_soc_id(); - - return ux500_soc_device_init(soc_id); -} - static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { /* Requires call-back bindings. */ OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), @@ -121,7 +95,7 @@ static const struct of_device_id u8500_local_bus_nodes[] = { static void __init u8500_init_machine(void) { - struct device *parent = db8500_soc_device_init(); + struct device *parent = ux500_soc_device_init(); /* automatically probe child nodes of dbx5x0 devices */ if (of_machine_is_compatible("st-ericsson,u8540")) diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 63853e76a4e1..a34af283ee23 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -27,7 +27,6 @@ #include "board-mop500.h" #include "db8500-regs.h" -#include "id.h" void ux500_restart(enum reboot_mode mode, const char *cmd) { @@ -66,72 +65,3 @@ void __init ux500_init_irq(void) ux500_pm_init(r.start, r.end-r.start); ux500_l2x0_init(); } - -static const char * __init ux500_get_machine(void) -{ - return kasprintf(GFP_KERNEL, "DB%4x", dbx500_partnumber()); -} - -static const char * __init ux500_get_family(void) -{ - return kasprintf(GFP_KERNEL, "ux500"); -} - -static const char * __init ux500_get_revision(void) -{ - unsigned int rev = dbx500_revision(); - - if (rev == 0x01) - return kasprintf(GFP_KERNEL, "%s", "ED"); - else if (rev >= 0xA0) - return kasprintf(GFP_KERNEL, "%d.%d", - (rev >> 4) - 0xA + 1, rev & 0xf); - - return kasprintf(GFP_KERNEL, "%s", "Unknown"); -} - -static ssize_t ux500_get_process(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - if (dbx500_id.process == 0x00) - return sprintf(buf, "Standard\n"); - - return sprintf(buf, "%02xnm\n", dbx500_id.process); -} - -static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr, - const char *soc_id) -{ - soc_dev_attr->soc_id = soc_id; - soc_dev_attr->machine = ux500_get_machine(); - soc_dev_attr->family = ux500_get_family(); - soc_dev_attr->revision = ux500_get_revision(); -} - -static const struct device_attribute ux500_soc_attr = - __ATTR(process, S_IRUGO, ux500_get_process, NULL); - -struct device * __init ux500_soc_device_init(const char *soc_id) -{ - struct device *parent; - struct soc_device *soc_dev; - struct soc_device_attribute *soc_dev_attr; - - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); - if (!soc_dev_attr) - return ERR_PTR(-ENOMEM); - - soc_info_populate(soc_dev_attr, soc_id); - - soc_dev = soc_device_register(soc_dev_attr); - if (IS_ERR(soc_dev)) { - kfree(soc_dev_attr); - return NULL; - } - - parent = soc_device_to_device(soc_dev); - device_create_file(parent, &ux500_soc_attr); - - return parent; -} diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c index 1e81e990044b..17f80ef44c58 100644 --- a/arch/arm/mach-ux500/id.c +++ b/arch/arm/mach-ux500/id.c @@ -8,6 +8,9 @@ #include #include #include +#include +#include +#include #include #include @@ -17,9 +20,20 @@ #include "setup.h" #include "db8500-regs.h" -#include "id.h" -struct dbx500_asic_id dbx500_id; +/** + * struct dbx500_asic_id - fields of the ASIC ID + * @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard" + * @partnumber: hithereto 0x8500 for DB8500 + * @revision: version code in the series + */ +struct dbx500_asic_id { + u16 partnumber; + u8 revision; + u8 process; +}; + +static struct dbx500_asic_id dbx500_id; static unsigned int __init ux500_read_asicid(phys_addr_t addr) { @@ -42,9 +56,9 @@ static unsigned int __init ux500_read_asicid(phys_addr_t addr) static void ux500_print_soc_info(unsigned int asicid) { - unsigned int rev = dbx500_revision(); + unsigned int rev = dbx500_id.revision; - pr_info("DB%4x ", dbx500_partnumber()); + pr_info("DB%4x ", dbx500_id.partnumber); if (rev == 0x01) pr_cont("Early Drop"); @@ -105,7 +119,7 @@ void __init ux500_setup_id(void) if (!asicid) { pr_err("Unable to identify SoC\n"); - ux500_unknown_soc(); + BUG(); } dbx500_id.process = asicid >> 24; @@ -114,3 +128,89 @@ void __init ux500_setup_id(void) ux500_print_soc_info(asicid); } + +static const char * __init ux500_get_machine(void) +{ + return kasprintf(GFP_KERNEL, "DB%4x", dbx500_id.partnumber); +} + +static const char * __init ux500_get_family(void) +{ + return kasprintf(GFP_KERNEL, "ux500"); +} + +static const char * __init ux500_get_revision(void) +{ + unsigned int rev = dbx500_id.revision; + + if (rev == 0x01) + return kasprintf(GFP_KERNEL, "%s", "ED"); + else if (rev >= 0xA0) + return kasprintf(GFP_KERNEL, "%d.%d", + (rev >> 4) - 0xA + 1, rev & 0xf); + + return kasprintf(GFP_KERNEL, "%s", "Unknown"); +} + +static ssize_t ux500_get_process(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + if (dbx500_id.process == 0x00) + return sprintf(buf, "Standard\n"); + + return sprintf(buf, "%02xnm\n", dbx500_id.process); +} + +static const char *db8500_read_soc_id(void) +{ + void __iomem *uid; + const char *retstr; + + uid = ioremap(U8500_BB_UID_BASE, 0x20); + if (!uid) + return NULL; + /* Throw these device-specific numbers into the entropy pool */ + add_device_randomness(uid, 0x14); + retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", + readl((u32 *)uid+0), + readl((u32 *)uid+1), readl((u32 *)uid+2), + readl((u32 *)uid+3), readl((u32 *)uid+4)); + iounmap(uid); + return retstr; +} + +static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr) +{ + soc_dev_attr->soc_id = db8500_read_soc_id(); + soc_dev_attr->machine = ux500_get_machine(); + soc_dev_attr->family = ux500_get_family(); + soc_dev_attr->revision = ux500_get_revision(); +} + +static const struct device_attribute ux500_soc_attr = + __ATTR(process, S_IRUGO, ux500_get_process, NULL); + +struct device * __init ux500_soc_device_init(void) +{ + struct device *parent; + struct soc_device *soc_dev; + struct soc_device_attribute *soc_dev_attr; + + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + if (!soc_dev_attr) + return ERR_PTR(-ENOMEM); + + soc_info_populate(soc_dev_attr); + + soc_dev = soc_device_register(soc_dev_attr); + if (IS_ERR(soc_dev)) { + kfree(soc_dev_attr); + return NULL; + } + + parent = soc_device_to_device(soc_dev); + device_create_file(parent, &ux500_soc_attr); + + return parent; +} diff --git a/arch/arm/mach-ux500/id.h b/arch/arm/mach-ux500/id.h deleted file mode 100644 index 929f78ecf3df..000000000000 --- a/arch/arm/mach-ux500/id.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2010 - * - * Author: Rabin Vincent for ST-Ericsson - * License terms: GNU General Public License (GPL) version 2 - */ - -#ifndef __MACH_UX500_ID -#define __MACH_UX500_ID - -/** - * struct dbx500_asic_id - fields of the ASIC ID - * @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard" - * @partnumber: hithereto 0x8500 for DB8500 - * @revision: version code in the series - */ -struct dbx500_asic_id { - u16 partnumber; - u8 revision; - u8 process; -}; - -extern struct dbx500_asic_id dbx500_id; - -static inline unsigned int __attribute_const__ dbx500_partnumber(void) -{ - return dbx500_id.partnumber; -} - -static inline unsigned int __attribute_const__ dbx500_revision(void) -{ - return dbx500_id.revision; -} - -#define ux500_unknown_soc() BUG() - -#endif diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 88b8ab4f300c..8f2f615ff958 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c @@ -26,7 +26,6 @@ #include "setup.h" #include "db8500-regs.h" -#include "id.h" /* Magic triggers in backup RAM */ #define UX500_CPU1_JUMPADDR_OFFSET 0x1FF4 diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index 8b44b646b191..1e9e7c55df75 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -19,11 +19,9 @@ void ux500_l2x0_init(void); void ux500_restart(enum reboot_mode mode, const char *cmd); -void __init ux500_setup_id(void); - extern void __init ux500_init_irq(void); -extern struct device *ux500_soc_device_init(const char *soc_id); +extern struct device *ux500_soc_device_init(void); extern void ux500_cpu_die(unsigned int cpu); From patchwork Fri Jun 24 09:41:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102095 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855311qgy; Fri, 24 Jun 2016 02:42:23 -0700 (PDT) X-Received: by 10.66.161.73 with SMTP id xq9mr5804772pab.6.1466761343364; Fri, 24 Jun 2016 02:42:23 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id z125si5919077pfz.64.2016.06.24.02.42.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:42:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNbz-0006ws-Ht; Fri, 24 Jun 2016 09:41:19 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004cA-Jv for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:55 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MGiBd-1bCCah3N7x-00DYyf; Fri, 24 Jun 2016 11:39:30 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 5/7] ARM: ux500: call ux500_setup_id later Date: Fri, 24 Jun 2016 11:41:30 +0200 Message-Id: <20160624094132.1852086-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:0kQenrjRKFyrCLqBb8fMxCdBb5omP+UnPMaL1GP1UrlXBVskrjj lc+YBfJ0AMgi2WrIsAVXhCxHT7WG94P/jkLnJk0dsjFgIz22xJ8RU7dFdODSOmpkeP2qaRO LJyCmi3OFh6DLBjdnnCUvMIjRRjUb5A70AJya/Z+6I/ZCLmMNnrL8pH4kNThtgjdsNc43jP IM9N0L8IqLXCx8Yg5IKqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:yXUQRJcPYzE=:GCvfB58NYLt3xlmK9NzGw/ iIuhA2fAv8Fny0IaZwqeXOZ4c1r+pOZ5uB8kpCwUApVTsZMhqfyKIH311ehB3NHNlncGIronp iaeYp0OFyNRDK7T4DgZSOa+FMNWKSGmKJCyqzpJZiPU7RCw65Kf6BKRwRK/slMsnXYyDklbZf kMQwLpWk2KDdxRVHk7BlcPRPfiodH7DU6QNCmYusNPUJqLoyO2cbTX9v8SrhMsqk5JwklB6d8 ASqxtk1sHk31pAGuEfmkGJzwbie6VlPV3QWPDqAsF1t1JrkK75+FNjUHpAI/4yli1Vjxy16sM q1VXR74xHavSt5b5jmawoZ7wkIf7Ziqv+5N1qFFLX7lenCfkspfOr/nAQT9UMjDR7ltwUjvZV 35sfBeOsdGZl/rHLb4soeH0PJoh5bpPlvyavNp5jvumywG4D5N2GkHfBn1PeJkhp3hT3AlM5X eEZxPE7r0jf6/HAG+x/2lDARnx95XLMnTM3xuMzr7ji5L01kLANLYi0YBPKWpdI3y1jutUBst tZktYfgmQM9krdBq+os1lX2afGF8tDa83+WXWfIvSt0GR2+Js6+CSvHwHT+CBT4954kJKvXY9 SsEA0yZuB5LHvxxoLSfUT6p228glpqX3us8QwCZSmSlFdwvVwkNUtfQqeHvf6dXnBQ5H5N0t2 qTDhPVngBeU8/cCdTdOlW29FND4eJnZcCWO9ykPesrSjShbwJjnO4Y7q6lyhzRgiGFoM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_061329_F1A4ED6A X-CRM114-Status: GOOD ( 16.46 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.73 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org ux500_setup_id is currently called from u8500_map_io(), which is really early, but nothing relies on the ID any more, other than a printk message that is not really all that important to have early during boot. If we move the call to ux500_setup_id() into ux500_soc_device_init(), that file becomes usuable almost entirely standalone, and we can kill off the u8500_map_io() callback as it just does the default debug_ll_io_init() now. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/cpu-db8500.c | 8 -------- arch/arm/mach-ux500/id.c | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 21 deletions(-) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index e7eba473d3bd..881cafbc4d97 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -27,13 +27,6 @@ #include "board-mop500.h" #include "db8500-regs.h" -#include "id.h" - -static void __init u8500_map_io(void) -{ - debug_ll_io_init(); - ux500_setup_id(); -} /* * The PMU IRQ lines of two cores are wired together into a single interrupt. @@ -117,7 +110,6 @@ static const char * stericsson_dt_platform_compat[] = { DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") .l2c_aux_val = 0, .l2c_aux_mask = ~0, - .map_io = u8500_map_io, .init_irq = ux500_init_irq, .init_machine = u8500_init_machine, .dt_compat = stericsson_dt_platform_compat, diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c index 17f80ef44c58..983004d0fef2 100644 --- a/arch/arm/mach-ux500/id.c +++ b/arch/arm/mach-ux500/id.c @@ -37,21 +37,16 @@ static struct dbx500_asic_id dbx500_id; static unsigned int __init ux500_read_asicid(phys_addr_t addr) { - phys_addr_t base = addr & ~0xfff; - struct map_desc desc = { - .virtual = (unsigned long)UX500_VIRT_ROM, - .pfn = __phys_to_pfn(base), - .length = SZ_16K, - .type = MT_DEVICE, - }; + void __iomem *virt = ioremap(addr, 4); + unsigned int asicid; - iotable_init(&desc, 1); + if (!virt) + return 0; - /* As in devicemaps_init() */ - local_flush_tlb_all(); - flush_cache_all(); + asicid = readl(virt); + iounmap(virt); - return readl(UX500_VIRT_ROM + (addr & 0xfff)); + return asicid; } static void ux500_print_soc_info(unsigned int asicid) @@ -86,7 +81,7 @@ static unsigned int partnumber(unsigned int asicid) * DB9540 0x413fc090 0xFFFFDBF4 0x009540xx */ -void __init ux500_setup_id(void) +static void __init ux500_setup_id(void) { unsigned int cpuid = read_cpuid_id(); unsigned int asicid = 0; @@ -197,6 +192,8 @@ struct device * __init ux500_soc_device_init(void) struct soc_device *soc_dev; struct soc_device_attribute *soc_dev_attr; + ux500_setup_id(); + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return ERR_PTR(-ENOMEM); From patchwork Fri Jun 24 09:41:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102097 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855130qgy; Fri, 24 Jun 2016 02:41:51 -0700 (PDT) X-Received: by 10.98.70.11 with SMTP id t11mr5693691pfa.16.1466761311841; Fri, 24 Jun 2016 02:41:51 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id o90si5902899pfj.121.2016.06.24.02.41.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:41:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNbV-0006Sc-Kb; Fri, 24 Jun 2016 09:40:49 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004cC-JC for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:58 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MJTL9-1bEzbk09Wd-0038ah; Fri, 24 Jun 2016 11:39:31 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 6/7] ARM: ux500: move soc_id driver to drivers/soc Date: Fri, 24 Jun 2016 11:41:31 +0200 Message-Id: <20160624094132.1852086-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:t1CiX6WDP/HttfILM92s3QJiqzHOlUhGYVOfruaxbbHMGS+RivK hl8sCe3kdyFXXYv2NuAu5ZkVYLSVOQq5SC++UdphvadS2BaOySH7idOnp/9jBBjH4CrhRJT gevd67+dvA18xu4cO8ARTWpFvu6W2+rww3/sY6ipryIhDaJ9WZJqpM57pR4rllMltTk3LPM YZAycXQyWlB6UgyWWN8Vg== X-UI-Out-Filterresults: notjunk:1; V01:K0:lwxC6wdcOsU=:xoM+yMz4hMsjNrGBwWn39I CRA9E425LXUFIa4+sAtssEkQB7x7qOJDV1Mgyf9oZ5x5p92dPDHQPpF61wjESH6n4H1oI0tZu XV0zz1gA/Gijl/lZkqYH7kfaPr/yY66sBkYJThAV3ggBjCvfQkzdMZ7ajwEKZt3VMu+Ed6ta1 Da75MRsfauuN6uOLE2ldNPy+S1GxMGk6Ydm5ahsmPa8XWZxyQPzue0c6rYDmR2FCBk1kEEwNq 53twv6vx2zTK4xNG6yjyqbIhRMGlt5k7/uYuyL20sBEVsMcRTq9gafWNsIBuSEnFcNXXv1/Mx ehY2lIpybXJEK/ETgRlzvS6fC7yTnuW6/f9xdd47sFzetB0ikA1RurE2j7bS1fzfSkHXPSrsq X0N6XXTXclCKg+PXVMMSuW3XWsXCv9rvFMGHa1KVgcFsizCVliaESYPPlWsakdnYjpcELqLgv j4VPqdOPIRw7Qrb8JIN3vJQ9W0pAuC+PoCezIbvn7PqSnZc3XIZbeERdqXNUnwX/xHWRb05Nt kjp/eRsCb7QPpqtyK/ZuVPwiUvVNZ9ib0vsUPVekuJJQmo33mel6CbXzIsZ1mSRnE+AkiCQ6o T8p2VxdfP93/CoMlRcsC4VsBRsCOBuC3FO/RaYQ1XBLagEA2g64TYHfAbjqIsiUorH0C6YC9M wVeOl4jZcqhgo7INjsNGBhzoMj9Tsf6ix4ZSjjwqRE6TE/2+IcuZSmTwMoHjyzeICVOs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_020153_7B084373 X-CRM114-Status: GOOD ( 25.76 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.73 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org As the ux500 id code is basically a standalone driver, we can move it out of the arch code into drivers/soc/ux500. This is a user-visible change, as it moves all the devices in sysfs from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a separate device. Originally the idea was to put all on-chip devices under the soc node, and ux500 was the first platform to have this device, but later platforms almost all didn't follow that pattern, so this makes the platform do the same thing as everyone else. Since the platform is really obsolete now, I am optimistic that nothing will break after moving the devices around. As the SoC driver no longer has access to the private header files, I'm changing the code to instead look up the address of the backupram from devicetree, which is a good idea anyway. Finally, having a separate Kconfig symbol means the driver is now optional and could even be a loadable module rather than always being built-in if we allowed that for soc_device. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/Makefile | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 6 ++-- arch/arm/mach-ux500/setup.h | 2 -- drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/ux500/Kconfig | 7 ++++ .../id.c => drivers/soc/ux500/ux500-soc-id.c | 39 +++++++++++++--------- 7 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 drivers/soc/ux500/Kconfig rename arch/arm/mach-ux500/id.c => drivers/soc/ux500/ux500-soc-id.c (86%) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index ea8893fd128f..753d3eed1985 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel, U8500 machine. # -obj-y := cpu.o id.o pm.o +obj-y := cpu.o pm.o obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 881cafbc4d97..c9c9832f79e9 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -88,15 +88,13 @@ static const struct of_device_id u8500_local_bus_nodes[] = { static void __init u8500_init_machine(void) { - struct device *parent = ux500_soc_device_init(); - /* automatically probe child nodes of dbx5x0 devices */ if (of_machine_is_compatible("st-ericsson,u8540")) of_platform_populate(NULL, u8500_local_bus_nodes, - u8540_auxdata_lookup, parent); + u8540_auxdata_lookup, NULL); else of_platform_populate(NULL, u8500_local_bus_nodes, - u8500_auxdata_lookup, parent); + u8500_auxdata_lookup, NULL); } static const char * stericsson_dt_platform_compat[] = { diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index 1e9e7c55df75..85b7819a40ab 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -21,8 +21,6 @@ void ux500_restart(enum reboot_mode mode, const char *cmd); extern void __init ux500_init_irq(void); -extern struct device *ux500_soc_device_init(void); - extern void ux500_cpu_die(unsigned int cpu); #endif /* __ASM_ARCH_SETUP_H */ diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index 58547f48ebcd..f31bceb69c0d 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -9,6 +9,7 @@ source "drivers/soc/samsung/Kconfig" source "drivers/soc/sunxi/Kconfig" source "drivers/soc/tegra/Kconfig" source "drivers/soc/ti/Kconfig" +source "drivers/soc/ux500/Kconfig" source "drivers/soc/versatile/Kconfig" endmenu diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index b75e3bd0a01e..50c23d0bd457 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -14,4 +14,5 @@ obj-$(CONFIG_SOC_SAMSUNG) += samsung/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_SOC_TI) += ti/ +obj-$(CONFIG_ARCH_U8500) += ux500/ obj-$(CONFIG_PLAT_VERSATILE) += versatile/ diff --git a/drivers/soc/ux500/Kconfig b/drivers/soc/ux500/Kconfig new file mode 100644 index 000000000000..025a44aef5db --- /dev/null +++ b/drivers/soc/ux500/Kconfig @@ -0,0 +1,7 @@ +config UX500_SOC_ID + bool "SoC bus for ST-Ericsson ux500" + depends on ARCH_U8500 || COMPILE_TEST + default ARCH_U8500 + help + Include support for the SoC bus on the ARM RealView platforms + providing some sysfs information about the ASIC variant. diff --git a/arch/arm/mach-ux500/id.c b/drivers/soc/ux500/ux500-soc-id.c similarity index 86% rename from arch/arm/mach-ux500/id.c rename to drivers/soc/ux500/ux500-soc-id.c index 983004d0fef2..49a811edce25 100644 --- a/arch/arm/mach-ux500/id.c +++ b/drivers/soc/ux500/ux500-soc-id.c @@ -8,8 +8,11 @@ #include #include #include +#include #include #include +#include +#include #include #include @@ -17,10 +20,6 @@ #include #include -#include "setup.h" - -#include "db8500-regs.h" - /** * struct dbx500_asic_id - fields of the ASIC ID * @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard" @@ -157,27 +156,31 @@ static ssize_t ux500_get_process(struct device *dev, return sprintf(buf, "%02xnm\n", dbx500_id.process); } -static const char *db8500_read_soc_id(void) +static const char *db8500_read_soc_id(struct device_node *backupram) { + void __iomem *base; void __iomem *uid; const char *retstr; - uid = ioremap(U8500_BB_UID_BASE, 0x20); - if (!uid) + base = of_iomap(backupram, 0); + if (!base) return NULL; + uid = base + 0xfc0; + /* Throw these device-specific numbers into the entropy pool */ add_device_randomness(uid, 0x14); retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", readl((u32 *)uid+0), readl((u32 *)uid+1), readl((u32 *)uid+2), readl((u32 *)uid+3), readl((u32 *)uid+4)); - iounmap(uid); + iounmap(base); return retstr; } -static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr) +static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr, + struct device_node *backupram) { - soc_dev_attr->soc_id = db8500_read_soc_id(); + soc_dev_attr->soc_id = db8500_read_soc_id(backupram); soc_dev_attr->machine = ux500_get_machine(); soc_dev_attr->family = ux500_get_family(); soc_dev_attr->revision = ux500_get_revision(); @@ -186,28 +189,34 @@ static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr) static const struct device_attribute ux500_soc_attr = __ATTR(process, S_IRUGO, ux500_get_process, NULL); -struct device * __init ux500_soc_device_init(void) +static int __init ux500_soc_device_init(void) { struct device *parent; struct soc_device *soc_dev; struct soc_device_attribute *soc_dev_attr; + struct device_node *backupram; + + backupram = of_find_compatible_node(NULL, NULL, "ste,dbx500-backupram"); + if (!backupram) + return 0; ux500_setup_id(); soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) - return ERR_PTR(-ENOMEM); + return -ENOMEM; - soc_info_populate(soc_dev_attr); + soc_info_populate(soc_dev_attr, backupram); soc_dev = soc_device_register(soc_dev_attr); if (IS_ERR(soc_dev)) { kfree(soc_dev_attr); - return NULL; + return PTR_ERR(soc_dev); } parent = soc_device_to_device(soc_dev); device_create_file(parent, &ux500_soc_attr); - return parent; + return 0; } +subsys_initcall(ux500_soc_device_init); From patchwork Fri Jun 24 09:41:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102098 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp855012qgy; Fri, 24 Jun 2016 02:41:34 -0700 (PDT) X-Received: by 10.98.192.135 with SMTP id g7mr5606043pfk.64.1466761294214; Fri, 24 Jun 2016 02:41:34 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id b66si5923051pfb.21.2016.06.24.02.41.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:41:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNbJ-0006JO-SE; Fri, 24 Jun 2016 09:40:37 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGNac-0004cD-JA for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 09:39:57 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Lvk1k-1bQ0WF12Ka-017Sqy; Fri, 24 Jun 2016 11:39:31 +0200 From: Arnd Bergmann To: Linus Walleij Subject: [PATCH 7/7] ARM: ux500: consolidate base platform files Date: Fri, 24 Jun 2016 11:41:32 +0200 Message-Id: <20160624094132.1852086-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624094132.1852086-1-arnd@arndb.de> References: <20160624094132.1852086-1-arnd@arndb.de> X-Provags-ID: V03:K0:MdV57Ls4jUeqIegCZyZDNaEx6WmRi0IcAcoBbhlxb+p+PUAfMx4 7fHwXEpmE/RqR9c6Bi7CQ7TQV+cLqbKdrQq5E/QVJdeFpqjCcOxCH9EQoxVhHYyQtLvyepp xLDwkcpGYqH86XJFclIBaP0Vm9HtOGNGy/1xtsmY8rX19ZYaSTGoOi0e1CxomForLgYndYE tzZ4ecN3sDBq9d5v+rcJw== X-UI-Out-Filterresults: notjunk:1; V01:K0:w2kxQOic5Kw=:+Fc6AnZiTJN5CZkqjQVZ8k fzxONqfcfg3X0kI3Va9xVuo3+q4iYdc1E3/dWp26DfWp8dpkbFHtThNPqL9pj0hMsed3d0v9X e3BrDf/Wnq32XNgimjtS2K7ftE7qlB22Ad0frkBgqJvOoE0UVAQtgg7a/QAL2hE3HyAMQ8A6I axyncGemTIDV/RirrdCJvtuychZJjFiBtklwL3nD+VwdC0Nm2UNTvI3F0FfLw26/c1rcIo5uh DOqu1s/JdDN5yGlIBIQkHl77QV7Vd46qihIDWrkTQ8AujEvubACfvMoVJAJMjb699oHmPkFM9 BKodf0ghqWpUO+FlPaUceEuUhShPIU1NF7CZGc1RMzzhVYkNE4SsVJ8dl2LmkiJhEo650gvKl HJZM9e78f7VaUCVM661cvz2ln4xbtS+whGdxMOA4aG2LKpBOXaUCISEk9hKkD9R4suuHB7lhb t1i4jOGZFwPZ4nwdtGDRP2PJu5v0mg1X4uo5dSreiekh3ureSJ0+/qIvO5IxsAe4ZVqfX7+jL yt4I1WuvTzbtRTyUYzrmf4NyMWBOEAB93L3X6AOP55nCBzD72kwXdQM3rKCLm464I7AZjzBas YPIT0AyDwtWzOu/pHRp0eck/NmiYDSh1ml8+7/Elc/4R746FNgpQKyG7GUPpMsjUNxt0OrZoC YDJDNU64rcApLO8G1bUw8Hv2S+AGkVNb8vEZ1IxlmWTe9ee+dMVZakHiiGxlg9YIFB3o= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160624_023955_034933_B5B22927 X-CRM114-Status: GOOD ( 23.02 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.73 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The cpu.c and cache-l2x0.c files hold only two or three simple functions each, and they are all called from the machine descriptors, so we can just move them all into the same file for simplicity and consistency. Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/Makefile | 3 +- arch/arm/mach-ux500/cache-l2x0.c | 60 --------------------------- arch/arm/mach-ux500/cpu-db8500.c | 87 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-ux500/cpu.c | 67 ------------------------------- arch/arm/mach-ux500/setup.h | 10 ----- 5 files changed, 88 insertions(+), 139 deletions(-) delete mode 100644 arch/arm/mach-ux500/cache-l2x0.c delete mode 100644 arch/arm/mach-ux500/cpu.c -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index 753d3eed1985..56d0eb6e254e 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile @@ -2,8 +2,7 @@ # Makefile for the linux kernel, U8500 machine. # -obj-y := cpu.o pm.o -obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o +obj-y := pm.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o obj-$(CONFIG_MACH_MOP500) += board-mop500-audio.o obj-$(CONFIG_SMP) += platsmp.o diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c deleted file mode 100644 index adec59cc2e1d..000000000000 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2011 - * - * License terms: GNU General Public License (GPL) version 2 - */ - -#include -#include -#include - -#include -#include - -#include "db8500-regs.h" - -static int __init ux500_l2x0_unlock(void) -{ - int i; - struct device_node *np; - void __iomem *l2x0_base; - - np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache"); - l2x0_base = of_iomap(np, 0); - of_node_put(np); - if (!l2x0_base) - return -ENODEV; - - /* - * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions - * apparently locks both caches before jumping to the kernel. The - * l2x0 core will not touch the unlock registers if the l2x0 is - * already enabled, so we do it right here instead. The PL310 has - * 8 sets of registers, one per possible CPU. - */ - for (i = 0; i < 8; i++) { - writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + - i * L2X0_LOCKDOWN_STRIDE); - writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE + - i * L2X0_LOCKDOWN_STRIDE); - } - iounmap(l2x0_base); - return 0; -} - -static void ux500_l2c310_write_sec(unsigned long val, unsigned reg) -{ - /* - * We can't write to secure registers as we are in non-secure - * mode, until we have some SMI service available. - */ -} - -void __init ux500_l2x0_init(void) -{ - /* Unlock before init */ - ux500_l2x0_unlock(); - outer_cache.write_sec = ux500_l2c310_write_sec; - - return 0; -} diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index c9c9832f79e9..46b1da1bf5d2 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -12,22 +12,109 @@ #include #include #include +#include #include #include +#include +#include +#include +#include #include #include #include +#include #include #include #include +#include +#include #include +#include #include "setup.h" #include "board-mop500.h" #include "db8500-regs.h" +static int __init ux500_l2x0_unlock(void) +{ + int i; + struct device_node *np; + void __iomem *l2x0_base; + + np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache"); + l2x0_base = of_iomap(np, 0); + of_node_put(np); + if (!l2x0_base) + return -ENODEV; + + /* + * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions + * apparently locks both caches before jumping to the kernel. The + * l2x0 core will not touch the unlock registers if the l2x0 is + * already enabled, so we do it right here instead. The PL310 has + * 8 sets of registers, one per possible CPU. + */ + for (i = 0; i < 8; i++) { + writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + + i * L2X0_LOCKDOWN_STRIDE); + writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE + + i * L2X0_LOCKDOWN_STRIDE); + } + iounmap(l2x0_base); + return 0; +} + +static void ux500_l2c310_write_sec(unsigned long val, unsigned reg) +{ + /* + * We can't write to secure registers as we are in non-secure + * mode, until we have some SMI service available. + */ +} + +/* + * FIXME: Should we set up the GPIO domain here? + * + * The problem is that we cannot put the interrupt resources into the platform + * device until the irqdomain has been added. Right now, we set the GIC interrupt + * domain from init_irq(), then load the gpio driver from + * core_initcall(nmk_gpio_init) and add the platform devices from + * arch_initcall(customize_machine). + * + * This feels fragile because it depends on the gpio device getting probed + * _before_ any device uses the gpio interrupts. +*/ +static void __init ux500_init_irq(void) +{ + struct device_node *np; + struct resource r; + + irqchip_init(); + np = of_find_compatible_node(NULL, NULL, "stericsson,db8500-prcmu"); + of_address_to_resource(np, 0, &r); + of_node_put(np); + if (!r.start) { + pr_err("could not find PRCMU base resource\n"); + return; + } + prcmu_early_init(r.start, r.end-r.start); + ux500_pm_init(r.start, r.end-r.start); + + /* Unlock before init */ + ux500_l2x0_unlock(); + outer_cache.write_sec = ux500_l2c310_write_sec; +} + +static void ux500_restart(enum reboot_mode mode, const char *cmd) +{ + local_irq_disable(); + local_fiq_disable(); + + prcmu_system_reset(0); +} + /* * The PMU IRQ lines of two cores are wired together into a single interrupt. * Bounce the interrupt to the other core if it's not ours. diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c deleted file mode 100644 index a34af283ee23..000000000000 --- a/arch/arm/mach-ux500/cpu.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2010 - * - * Author: Rabin Vincent for ST-Ericsson - * Author: Lee Jones for ST-Ericsson - * License terms: GNU General Public License (GPL) version 2 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "setup.h" - -#include "board-mop500.h" -#include "db8500-regs.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? - * - * The problem is that we cannot put the interrupt resources into the platform - * device until the irqdomain has been added. Right now, we set the GIC interrupt - * domain from init_irq(), then load the gpio driver from - * core_initcall(nmk_gpio_init) and add the platform devices from - * arch_initcall(customize_machine). - * - * This feels fragile because it depends on the gpio device getting probed - * _before_ any device uses the gpio interrupts. -*/ -void __init ux500_init_irq(void) -{ - struct device_node *np; - struct resource r; - - irqchip_init(); - np = of_find_compatible_node(NULL, NULL, "stericsson,db8500-prcmu"); - of_address_to_resource(np, 0, &r); - of_node_put(np); - if (!r.start) { - pr_err("could not find PRCMU base resource\n"); - return; - } - prcmu_early_init(r.start, r.end-r.start); - ux500_pm_init(r.start, r.end-r.start); - ux500_l2x0_init(); -} diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index 85b7819a40ab..988e7c77068d 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -11,16 +11,6 @@ #ifndef __ASM_ARCH_SETUP_H #define __ASM_ARCH_SETUP_H -#include -#include - - -void ux500_l2x0_init(void); - -void ux500_restart(enum reboot_mode mode, const char *cmd); - -extern void __init ux500_init_irq(void); - extern void ux500_cpu_die(unsigned int cpu); #endif /* __ASM_ARCH_SETUP_H */