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);