From patchwork Tue Dec 1 14:00:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 57491 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2193536lbb; Tue, 1 Dec 2015 06:06:26 -0800 (PST) X-Received: by 10.98.74.26 with SMTP id x26mr78906038pfa.15.1448978786276; Tue, 01 Dec 2015 06:06:26 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tw2si1393716pab.238.2015.12.01.06.06.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 06:06:26 -0800 (PST) Received-SPF: pass (google.com: 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: 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com 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 1a3lXv-00025F-Vq; Tue, 01 Dec 2015 14:04:44 +0000 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3lUG-0006X2-96 for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2015 14:01:10 +0000 Received: by lfs39 with SMTP id 39so8661435lfs.3 for ; Tue, 01 Dec 2015 06:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=nZkov62k4GY+S7aPtS1YTkprzv4Ze2BnjCFJ/asl99g=; b=ZCF/SKwK620ZoDzRkxihyWQfVmTA+kFHoWxVm7GneTo/eA6ZfcC8S2MAqZBXMfzWLm tg1Wm2HFP9Xlcgc1R/7NLD62zdTX8yauBFnFozM9vUQvlPX0ZLR5wfbhiIUD9G88/bDR iFdOxXl3F2STxFox8gNiBZsXINPRSWys+9Azi+zIBA9o60azx14CGRjmnuuy6JgHnS51 1EXeJhuhBKFR6tu1ZARRZk1/MySd1VoziF9/lHvzJrs9D/CE3htoR4uX0Ntaw5jiqZnD bQEHqrNtihkTVI/8EJccivlDK8B9LgUSnk4Odwlp0KEzcGZeQXaVxz5w0hqw6DJ+jwDn hngw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nZkov62k4GY+S7aPtS1YTkprzv4Ze2BnjCFJ/asl99g=; b=g7tqfmlxvQfyFLuZUc/yq/gcB3ZP3TpWBL7j95wfH0ZEod/8WuGwI8l04cXTzNPx6h oasfGW5LT+S+CTUE1ievkezLI0zE4RamJaSYjQkUMpVVSwcMiq8Z4WoXah12/SF5LUPT SDJjiWmh4wqiJMxPfRYwxKJsv8gycRY8V1jD0uR1LaAiiRYj/2X/skZMMti+GKMml3VR O4Ye3rWLXLUOwKl1nNb6zEktycX3nhRd8WSC8e/Ag9+lvoMY8hkSW2x149ek/CfVGsls Anwx/q1onaNDpB3+cy2geYoSK1stkfiLNL8p6SOtSGTCa8hjLfQjXiIBjl7FuYyVZBHe Qhpg== X-Gm-Message-State: ALoCoQnz9g0cJEXSwRZSwm68o+P5GeTmcgx/Aa3oo1WAapc85yNxXXxjrDBBhNMZJlNjB/j1Q3LJ X-Received: by 10.112.134.66 with SMTP id pi2mr23012985lbb.83.1448978431858; Tue, 01 Dec 2015 06:00:31 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g7sm6625248lbs.34.2015.12.01.06.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 06:00:30 -0800 (PST) From: Linus Walleij To: arm@kernel.org Subject: [PATCH] ARM/clocksource: use automatic DT probing for ux500 PRCMU Date: Tue, 1 Dec 2015 15:00:24 +0100 Message-Id: <1448978424-9756-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151201_060057_244196_4E4CD63F X-CRM114-Status: GOOD ( 19.96 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Linus Walleij , 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 ARM core kernel already calls clocksource_of_init() so why go to all the trouble of locating and probing this node in the machine. CLOCKSOURCE_OF_DECLARE() will take care of it in the clocksource driver, and thus we can also get rid of the dangling header file Suggested-by: Arnd Bergmann Acked-by: Thomas Gleixner Acked-by: Daniel Lezcano Signed-off-by: Linus Walleij --- ARM SoC folks: I have only this Ux500 patch queued for v4.5. Can you please apply it directly to the proper place in ARM SoC? --- arch/arm/mach-ux500/Makefile | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 2 -- arch/arm/mach-ux500/cpu.c | 1 - arch/arm/mach-ux500/setup.h | 3 -- arch/arm/mach-ux500/timer.c | 48 ------------------------------- drivers/clocksource/clksrc-dbx500-prcmu.c | 9 ++++-- include/linux/clksrc-dbx500-prcmu.h | 20 ------------- 7 files changed, 7 insertions(+), 78 deletions(-) delete mode 100644 arch/arm/mach-ux500/timer.c delete mode 100644 include/linux/clksrc-dbx500-prcmu.h -- 2.4.3 _______________________________________________ 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 c8643ac5db71..edfff1ae1f8d 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 timer.o pm.o +obj-y := cpu.o id.o pm.o obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o obj-$(CONFIG_MACH_MOP500) += board-mop500-regulators.o \ diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index f80560318c58..a0ffaad1fb61 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -156,8 +156,6 @@ static const char * stericsson_dt_platform_compat[] = { DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") .map_io = u8500_map_io, .init_irq = ux500_init_irq, - /* we re-use nomadik timer here */ - .init_time = ux500_timer_init, .init_machine = u8500_init_machine, .init_late = NULL, .dt_compat = stericsson_dt_platform_compat, diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 41b81c4fbe63..82156cbc22ce 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h index 65876eac0761..c704254ab67c 100644 --- a/arch/arm/mach-ux500/setup.h +++ b/arch/arm/mach-ux500/setup.h @@ -12,7 +12,6 @@ #define __ASM_ARCH_SETUP_H #include -#include #include #include @@ -24,8 +23,6 @@ extern void __init ux500_init_irq(void); extern struct device *ux500_soc_device_init(const char *soc_id); -extern void ux500_timer_init(void); - extern void ux500_cpu_die(unsigned int cpu); #endif /* __ASM_ARCH_SETUP_H */ diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c deleted file mode 100644 index 8d2d233f8e6c..000000000000 --- a/arch/arm/mach-ux500/timer.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2011 - * - * License Terms: GNU General Public License v2 - * Author: Mattias Wallin for ST-Ericsson - */ -#include -#include -#include -#include -#include -#include - -#include "setup.h" - -#include "db8500-regs.h" -#include "id.h" - -static const struct of_device_id prcmu_timer_of_match[] __initconst = { - { .compatible = "stericsson,db8500-prcmu-timer-4", }, - { }, -}; - -void __init ux500_timer_init(void) -{ - void __iomem *prcmu_timer_base; - void __iomem *tmp_base; - struct device_node *np; - - if (cpu_is_u8500_family() || cpu_is_ux540_family()) - prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); - else - ux500_unknown_soc(); - - np = of_find_matching_node(NULL, prcmu_timer_of_match); - if (!np) - goto dt_fail; - - tmp_base = of_iomap(np, 0); - if (!tmp_base) - goto dt_fail; - - prcmu_timer_base = tmp_base; - -dt_fail: - clksrc_dbx500_prcmu_init(prcmu_timer_base); - clocksource_probe(); -} diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c b/drivers/clocksource/clksrc-dbx500-prcmu.c index b375106844d8..dfad6eb99662 100644 --- a/drivers/clocksource/clksrc-dbx500-prcmu.c +++ b/drivers/clocksource/clksrc-dbx500-prcmu.c @@ -12,8 +12,9 @@ * power domain. We use the Timer 4 for our always-on clock * source on DB8500. */ +#include +#include #include -#include #include #define RATE_32K 32768 @@ -63,9 +64,9 @@ static u64 notrace dbx500_prcmu_sched_clock_read(void) #endif -void __init clksrc_dbx500_prcmu_init(void __iomem *base) +static void __init clksrc_dbx500_prcmu_init(struct device_node *node) { - clksrc_dbx500_timer_base = base; + clksrc_dbx500_timer_base = of_iomap(node, 0); /* * The A9 sub system expects the timer to be configured as @@ -85,3 +86,5 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base) #endif clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K); } +CLOCKSOURCE_OF_DECLARE(dbx500_prcmu, "stericsson,db8500-prcmu-timer-4", + clksrc_dbx500_prcmu_init); diff --git a/include/linux/clksrc-dbx500-prcmu.h b/include/linux/clksrc-dbx500-prcmu.h deleted file mode 100644 index 4fb8119c49e4..000000000000 --- a/include/linux/clksrc-dbx500-prcmu.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2011 - * - * License Terms: GNU General Public License v2 - * Author: Mattias Wallin - * - */ -#ifndef __CLKSRC_DBX500_PRCMU_H -#define __CLKSRC_DBX500_PRCMU_H - -#include -#include - -#ifdef CONFIG_CLKSRC_DBX500_PRCMU -void __init clksrc_dbx500_prcmu_init(void __iomem *base); -#else -static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {} -#endif - -#endif