From patchwork Fri Jul 31 13:14:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 51770 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 027B922D9C for ; Fri, 31 Jul 2015 13:14:51 +0000 (UTC) Received: by wibdx1 with SMTP id dx1sf6257993wib.2 for ; Fri, 31 Jul 2015 06:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=FXStY6cLrP46LvmXKgJ1AyDevwh6GiexA/p9yKGJTh0=; b=RBvLX47+OPM5vYK8Cy9P+bokjjzKXIHLMH79L++WTa4MJT7KsbvD/6ux8lbk8+wf2H OlXfQED2c9o5bzkDNZ9IiCAENMCiqeubIHVMMG6Cyayu2s629ZDc24npheoTPJy+csDX cKi06JW0qJACoiPWNHxuzQjZM564ciryZWPlywXqmm2sTmup1KII3aciVw1LZPM9uJBA xFpmuOqAGXF/lHE5UoCCehsd/HcRzWd3NcwjjQWMv9ajTjjl3H7LA01zxieMuaI/XIXX 6gSafWik+DSYyk3ZwG/9otGHgyT2ELAJdpvaFipVlkOwsHFwuAX1Uf5aalYU5OrnN5XQ sDfw== X-Gm-Message-State: ALoCoQn8fqSVWynw7oa+SkFSc/MNwhQTY2IQh/FZiAg7+blAKkz3g5DXnyESw/8JcuUUOwQCytzq X-Received: by 10.112.26.5 with SMTP id h5mr938522lbg.4.1438348490262; Fri, 31 Jul 2015 06:14:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.40 with SMTP id kz8ls314082lab.24.gmail; Fri, 31 Jul 2015 06:14:50 -0700 (PDT) X-Received: by 10.112.234.163 with SMTP id uf3mr98262lbc.37.1438348490011; Fri, 31 Jul 2015 06:14:50 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id ba18si3652663lab.100.2015.07.31.06.14.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 06:14:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lblf12 with SMTP id f12so46180566lbl.2 for ; Fri, 31 Jul 2015 06:14:49 -0700 (PDT) X-Received: by 10.112.120.134 with SMTP id lc6mr2802679lbb.86.1438348489643; Fri, 31 Jul 2015 06:14:49 -0700 (PDT) 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.7.198 with SMTP id l6csp383778lba; Fri, 31 Jul 2015 06:14:48 -0700 (PDT) X-Received: by 10.182.102.100 with SMTP id fn4mr2799699obb.71.1438348488493; Fri, 31 Jul 2015 06:14:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si10238725pdg.219.2015.07.31.06.14.47; Fri, 31 Jul 2015 06:14:48 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751837AbbGaNOq (ORCPT + 28 others); Fri, 31 Jul 2015 09:14:46 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:35868 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751642AbbGaNOo (ORCPT ); Fri, 31 Jul 2015 09:14:44 -0400 Received: by lbbud7 with SMTP id ud7so42081438lbb.3 for ; Fri, 31 Jul 2015 06:14:42 -0700 (PDT) X-Received: by 10.112.91.196 with SMTP id cg4mr2837312lbb.10.1438348482649; Fri, 31 Jul 2015 06:14:42 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id x4sm904850lae.19.2015.07.31.06.14.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 06:14:41 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, Daniel Lezcano , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH] ARM/clocksource: use automatic DT probing Date: Fri, 31 Jul 2015 15:14:30 +0200 Message-Id: <1438348470-6656-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.217.171 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Signed-off-by: Linus Walleij Acked-by: Daniel Lezcano --- Clocksource maintainers: please ACK this so I can take it through ARM SoC with a bunch of other cleanups. --- 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 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 ba708ce08616..59675d809080 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 b316e18a76aa..9c49922414c2 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 ff28d8ad1ed7..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_of_init(); -} 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