From patchwork Tue Mar 12 17:08:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 15295 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 20B8223E3E for ; Tue, 12 Mar 2013 17:09:25 +0000 (UTC) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by fiordland.canonical.com (Postfix) with ESMTP id B82F3A19ACD for ; Tue, 12 Mar 2013 17:09:24 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id cz11so60482veb.31 for ; Tue, 12 Mar 2013 10:09:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=o1Cy9/E9cZd05hM59ECIqClbx+yxL8zP8djWZyWTNbo=; b=O9RDomqEH2quYf/sNgjKQfePJLcbCqAtERACBzKcfzyluv7LQclz5LFoCTHY7gGqL+ eyW71+B8A/+rI6kknj6LasZ85cwb0hLgfYGxhlRq1vAQdhA1x0XfxC7H5d4LxIuKI9rY rXPnvwe/Gix23sZmLl65wAbYMEy5MwOojBRtdP0bixM/xg5KgVeKb7bq47lC9ePcEY4B Zp8mY5Y+r4VLosCXzdIDiGm3fwacgZlRb4x/8fAzCczksQGE28DHB9ahcYUCgR3pW8fD xYoDxTs9ZRKPTkoNtn3u+AMen3l8KrN0UzNaZxXYugmy36UBeF0k5w2Sr8Euo1w4/eQd udHg== X-Received: by 10.220.201.132 with SMTP id fa4mr2718738vcb.14.1363108164150; Tue, 12 Mar 2013 10:09:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp138393veb; Tue, 12 Mar 2013 10:09:23 -0700 (PDT) X-Received: by 10.42.215.196 with SMTP id hf4mr12899792icb.23.1363108163182; Tue, 12 Mar 2013 10:09:23 -0700 (PDT) Received: from mail-ia0-x233.google.com (mail-ia0-x233.google.com [2607:f8b0:4001:c02::233]) by mx.google.com with ESMTPS id id8si25416404icc.47.2013.03.12.10.09.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 10:09:23 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::233 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=2607:f8b0:4001:c02::233; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c02::233 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) smtp.mail=haojian.zhuang@linaro.org Received: by mail-ia0-f179.google.com with SMTP id x24so60733iak.38 for ; Tue, 12 Mar 2013 10:09:22 -0700 (PDT) X-Received: by 10.42.155.136 with SMTP id u8mr13184815icw.26.1363108162766; Tue, 12 Mar 2013 10:09:22 -0700 (PDT) Received: from localhost.localdomain ([140.206.155.72]) by mx.google.com with ESMTPS id xc3sm20593825igb.10.2013.03.12.10.09.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 10:09:22 -0700 (PDT) From: Haojian Zhuang To: linux@arm.linux.org.uk, linus.walleij@linaro.org, arnd@arndb.de, olof@lixom.net, rob.herring@calxeda.com, linux-arm-kernel@lists.infradead.org, pawel.moll@arm.com, swarren@nvidia.com, john.stultz@linaro.org, tglx@linutronix.de, mturquette@linaro.org Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v2 06/14] ARM: vexpress: use clocksource_of_init for sp804 Date: Wed, 13 Mar 2013 01:08:35 +0800 Message-Id: <1363108124-17484-7-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363108124-17484-1-git-send-email-haojian.zhuang@linaro.org> References: <1363108124-17484-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQkRqmnvbl4mxmA37AZrgriNZOkXE0e3kxccHVw6HtB7eUJ3j/NPwCh7u4euMiWa88d617gK Remove all code to parse sp804. Use clocksource_of_init() instead since all these code are implemented in sp804 driver already. Signed-off-by: Haojian Zhuang --- arch/arm/boot/dts/vexpress-v2m-rs1.dtsi | 2 ++ arch/arm/boot/dts/vexpress-v2m.dtsi | 2 ++ arch/arm/boot/dts/vexpress-v2p-ca9.dts | 2 ++ arch/arm/mach-vexpress/Kconfig | 1 + arch/arm/mach-vexpress/v2m.c | 13 ++----------- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi index ac870fb..3fa798f 100644 --- a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi +++ b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi @@ -183,6 +183,8 @@ interrupts = <2>; clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&smbclk>; clock-names = "timclken1", "timclken2", "apb_pclk"; + arm,sp804-clocksource = <0x20>; + arm,sp804-clockevent = <0>; }; v2m_timer23: timer@120000 { diff --git a/arch/arm/boot/dts/vexpress-v2m.dtsi b/arch/arm/boot/dts/vexpress-v2m.dtsi index f142036..86e4046 100644 --- a/arch/arm/boot/dts/vexpress-v2m.dtsi +++ b/arch/arm/boot/dts/vexpress-v2m.dtsi @@ -182,6 +182,8 @@ interrupts = <2>; clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&smbclk>; clock-names = "timclken1", "timclken2", "apb_pclk"; + arm,sp804-clocksource = <0x20>; + arm,sp804-clockevent = <0>; }; v2m_timer23: timer@12000 { diff --git a/arch/arm/boot/dts/vexpress-v2p-ca9.dts b/arch/arm/boot/dts/vexpress-v2p-ca9.dts index 1420bb1..a2eba95 100644 --- a/arch/arm/boot/dts/vexpress-v2p-ca9.dts +++ b/arch/arm/boot/dts/vexpress-v2p-ca9.dts @@ -98,6 +98,8 @@ <0 49 4>; clocks = <&oscclk2>, <&oscclk2>; clock-names = "timclk", "apb_pclk"; + arm,sp804-clocksource = <0x20>; + arm,sp804-clockevent = <0>; }; watchdog@100e5000 { diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 52d315b..ff78c15 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig @@ -5,6 +5,7 @@ config ARCH_VEXPRESS select ARM_GIC select ARM_TIMER_SP804 select CLKDEV_LOOKUP + select CLKSRC_OF select COMMON_CLK select COMMON_CLK_VERSATILE select CPU_V7 diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 51e8701..bb599d3 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -431,19 +432,9 @@ void __init v2m_dt_init_early(void) static void __init v2m_dt_timer_init(void) { - struct device_node *node = NULL; - vexpress_clk_of_init(); - do { - node = of_find_compatible_node(node, NULL, "arm,sp804"); - } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB); - if (node) { - pr_info("Using SP804 '%s' as a clock & events source\n", - node->full_name); - v2m_sp804_init(of_iomap(node, 0), - irq_of_parse_and_map(node, 0)); - } + clocksource_of_init(); if (arch_timer_of_register() != 0) twd_local_timer_of_register();