From patchwork Wed Mar 13 05:05:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 15316 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 480A123E2E for ; Wed, 13 Mar 2013 05:07:28 +0000 (UTC) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by fiordland.canonical.com (Postfix) with ESMTP id E26BCA192C3 for ; Wed, 13 Mar 2013 05:07:27 +0000 (UTC) Received: by mail-vc0-f173.google.com with SMTP id fl15so318344vcb.4 for ; Tue, 12 Mar 2013 22:07:27 -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=X/E9zB9ypKJmazaZSXd6t5PE5RQ0cXqKX/8ZMPQ9smaeTPQLaQCUoUqYayei8QJzxX GJ8RX9H87DjMOlNfBtnNfKkkLO0FMpv98XHfqsNEz2SOydNAx/0+/RIYwpZyZL7/qdaI OnvtUwNCOUynCk2Ch8/CR21tN4Ri6OMkrhwd9/O5NRU9d+VInZZiXiyFVKbv124yoHBn Hw3XuyxyjWytWcBIGdc5mvsFOUvPbaAW8JrZsP9grA7nfHN5/0hDeY5bbqHHgvpXm7nH HcrzFRnWFnG7Ymy9BWXb8UZnF3sotTB2iqAa+20IrjPWSMdwze/K1lJODC26AZl35dzl RgHg== X-Received: by 10.221.11.135 with SMTP id pe7mr7388946vcb.41.1363151247410; Tue, 12 Mar 2013 22:07:27 -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 nf2csp1632veb; Tue, 12 Mar 2013 22:07:26 -0700 (PDT) X-Received: by 10.68.226.201 with SMTP id ru9mr15219920pbc.102.1363151246362; Tue, 12 Mar 2013 22:07:26 -0700 (PDT) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id qp8si33564255pbc.123.2013.03.12.22.07.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 22:07:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 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-pb0-f45.google.com with SMTP id ro8so620225pbb.4 for ; Tue, 12 Mar 2013 22:07:25 -0700 (PDT) X-Received: by 10.68.87.129 with SMTP id ay1mr12165162pbb.105.1363151245274; Tue, 12 Mar 2013 22:07:25 -0700 (PDT) Received: from localhost.localdomain ([67.198.145.34]) by mx.google.com with ESMTPS id ab1sm27947630pbd.37.2013.03.12.22.07.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 22:07:24 -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 v3 06/11] ARM: vexpress: use clocksource_of_init for sp804 Date: Wed, 13 Mar 2013 13:05:37 +0800 Message-Id: <1363151142-32162-7-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363151142-32162-1-git-send-email-haojian.zhuang@linaro.org> References: <1363151142-32162-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQlrMFLM9v3SvNUSqHf0yyqfTv3L7GpHzHxTNbdx6x76pJdaaHbqrzt1JF78fcGI+48smvnh 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();