From patchwork Tue Mar 12 17:08:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 2257431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 67075DF23A for ; Tue, 12 Mar 2013 17:14:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFSjC-0005Xk-Oy; Tue, 12 Mar 2013 17:11:06 +0000 Received: from mail-ia0-x22a.google.com ([2607:f8b0:4001:c02::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFShU-0004yM-Dm for linux-arm-kernel@lists.infradead.org; Tue, 12 Mar 2013 17:09:22 +0000 Received: by mail-ia0-f170.google.com with SMTP id h8so64159iaa.29 for ; Tue, 12 Mar 2013 10:09:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=nr1hD0evakrs/aZ4eZcc/4pkLzyDjL+xtE5DR3W3zmo=; b=Ti3Qq9L84lnFCidzwCcXPaEMQJ5lvTs1kZHdPFaEzixd6PbVIeZ9BdQHI3OIgwbg0f IpkYaxfztxjSoGN6/IiBRgN1HYEg31OZJyG6ndQIXB/AjBnXZWh2yWXVmc3WVYJ2hv2Y qMWoBJbWdP++NfNX0VWW/LywQrpDzRxzVssq8mqesKnNmx8++iSN/FWEhd5a4ZSLCXGm T2dPWCc+gU9TcX8wujnVmzObODjXf68HwCNXVm5HsyNdLoQY7XvKzH6FJU9HEJnagHvf rFzLozCVb4Jr6DKw9QSCcAngVbTa2sMZ5avLkNYPy3OScWota3Tx2qQU0jxjX6wExEyr QhuQ== X-Received: by 10.50.236.100 with SMTP id ut4mr11872822igc.86.1363108157998; Tue, 12 Mar 2013 10:09:17 -0700 (PDT) Received: from localhost.localdomain ([140.206.155.72]) by mx.google.com with ESMTPS id xc3sm20593825igb.10.2013.03.12.10.09.13 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 10:09:17 -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 Subject: [PATCH v2 05/14] ARM: integrator: use clocksource_of_init for sp804 Date: Wed, 13 Mar 2013 01:08:34 +0800 Message-Id: <1363108124-17484-6-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: ALoCoQmgOpP9fiQ99OcPP9bt2uLCJbpQRHk6o2O0GtfFeETx6JUxzWepV9Ofe28EEvl2k/uNWEsO X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130312_130920_683178_62C6693B X-CRM114-Status: GOOD ( 13.69 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Remove all code to parse sp804 in integrator platform driver. Use clocksource_of_init() instead since these code are implemented in sp804 driver already. Signed-off-by: Haojian Zhuang --- arch/arm/boot/dts/integrator.dtsi | 3 +++ arch/arm/boot/dts/integratorap.dts | 15 +++++------ arch/arm/boot/dts/integratorcp.dts | 9 +++---- arch/arm/mach-integrator/Kconfig | 3 +++ arch/arm/mach-integrator/integrator_ap.c | 41 +----------------------------- arch/arm/mach-integrator/integrator_cp.c | 35 ++----------------------- 6 files changed, 20 insertions(+), 86 deletions(-) diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi index 813b91d..749ac21 100644 --- a/arch/arm/boot/dts/integrator.dtsi +++ b/arch/arm/boot/dts/integrator.dtsi @@ -9,18 +9,21 @@ reg = <0x13000000 0x100>; interrupt-parent = <&pic>; interrupts = <5>; + status = "disabled"; }; timer@13000100 { reg = <0x13000100 0x100>; interrupt-parent = <&pic>; interrupts = <6>; + status = "disabled"; }; timer@13000200 { reg = <0x13000200 0x100>; interrupt-parent = <&pic>; interrupts = <7>; + status = "disabled"; }; pic@14000000 { diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts index c9c3fa3..70e321c 100644 --- a/arch/arm/boot/dts/integratorap.dts +++ b/arch/arm/boot/dts/integratorap.dts @@ -9,11 +9,6 @@ model = "ARM Integrator/AP"; compatible = "arm,integrator-ap"; - aliases { - arm,timer-primary = &timer2; - arm,timer-secondary = &timer1; - }; - chosen { bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; }; @@ -24,15 +19,19 @@ }; timer0: timer@13000000 { - compatible = "arm,integrator-timer"; + compatible = "arm,sp804", "arm,primecell"; }; timer1: timer@13000100 { - compatible = "arm,integrator-timer"; + compatible = "arm,sp804", "arm,primecell"; + arm,sp804-clockevent = <0>; + status = "ok"; }; timer2: timer@13000200 { - compatible = "arm,integrator-timer"; + compatible = "arm,sp804", "arm,primecell"; + arm,sp804-clocksource = <0>; + status = "ok"; }; pic: pic@14000000 { diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts index 8b11939..19b2e3e 100644 --- a/arch/arm/boot/dts/integratorcp.dts +++ b/arch/arm/boot/dts/integratorcp.dts @@ -9,11 +9,6 @@ model = "ARM Integrator/CP"; compatible = "arm,integrator-cp"; - aliases { - arm,timer-primary = &timer2; - arm,timer-secondary = &timer1; - }; - chosen { bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; }; @@ -29,10 +24,14 @@ timer1: timer@13000100 { compatible = "arm,sp804", "arm,primecell"; + arm,sp804-clockevent = <0>; + status = "ok"; }; timer2: timer@13000200 { compatible = "arm,sp804", "arm,primecell"; + arm,sp804-clocksource = <0>; + status = "ok"; }; pic: pic@14000000 { diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index abeff25..031f43a 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig @@ -5,6 +5,7 @@ menu "Integrator Options" config ARCH_INTEGRATOR_AP bool "Support Integrator/AP and Integrator/PP2 platforms" select CLKSRC_MMIO + select CLKSRC_OF select MIGHT_HAVE_PCI select SERIAL_AMBA_PL010 select SERIAL_AMBA_PL010_CONSOLE @@ -15,6 +16,8 @@ config ARCH_INTEGRATOR_AP config ARCH_INTEGRATOR_CP bool "Support Integrator/CP platform" + select CLKSRC_MMIO + select CLKSRC_OF select ARCH_CINTEGRATOR select ARM_TIMER_SP804 select PLAT_VERSATILE_CLCD diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index c2112ff..2266944 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -425,45 +425,6 @@ void __init ap_init_early(void) #ifdef CONFIG_OF -static void __init ap_of_timer_init(void) -{ - struct device_node *node; - const char *path; - void __iomem *base; - int err; - int irq; - struct clk *clk; - unsigned long rate; - - clk = clk_get_sys("ap_timer", NULL); - BUG_ON(IS_ERR(clk)); - clk_prepare_enable(clk); - rate = clk_get_rate(clk); - - err = of_property_read_string(of_aliases, - "arm,timer-primary", &path); - if (WARN_ON(err)) - return; - node = of_find_node_by_path(path); - base = of_iomap(node, 0); - if (WARN_ON(!base)) - return; - writel(0, base + TIMER_CTRL); - integrator_clocksource_init(rate, base); - - err = of_property_read_string(of_aliases, - "arm,timer-secondary", &path); - if (WARN_ON(err)) - return; - node = of_find_node_by_path(path); - base = of_iomap(node, 0); - if (WARN_ON(!base)) - return; - irq = irq_of_parse_and_map(node, 0); - writel(0, base + TIMER_CTRL); - integrator_clockevent_init(rate, base, irq); -} - static const struct of_device_id fpga_irq_of_match[] __initconst = { { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, { /* Sentinel */ } @@ -582,7 +543,7 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)") .init_early = ap_init_early, .init_irq = ap_init_irq_of, .handle_irq = fpga_handle_irq, - .init_time = ap_of_timer_init, + .init_time = clocksource_of_init, .init_machine = ap_init_of, .restart = integrator_restart, .dt_compat = ap_dt_board_compat, diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 40373ec..6e1c340 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -251,38 +252,6 @@ static void __init intcp_init_early(void) #ifdef CONFIG_OF -static void __init cp_of_timer_init(void) -{ - struct device_node *node; - const char *path; - void __iomem *base; - int err; - int irq; - - err = of_property_read_string(of_aliases, - "arm,timer-primary", &path); - if (WARN_ON(err)) - return; - node = of_find_node_by_path(path); - base = of_iomap(node, 0); - if (WARN_ON(!base)) - return; - writel(0, base + TIMER_CTRL); - sp804_clocksource_init(base, node->name); - - err = of_property_read_string(of_aliases, - "arm,timer-secondary", &path); - if (WARN_ON(err)) - return; - node = of_find_node_by_path(path); - base = of_iomap(node, 0); - if (WARN_ON(!base)) - return; - irq = irq_of_parse_and_map(node, 0); - writel(0, base + TIMER_CTRL); - sp804_clockevents_init(base, irq, node->name); -} - static const struct of_device_id fpga_irq_of_match[] __initconst = { { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, { /* Sentinel */ } @@ -386,7 +355,7 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") .init_early = intcp_init_early, .init_irq = intcp_init_irq_of, .handle_irq = fpga_handle_irq, - .init_time = cp_of_timer_init, + .init_time = clocksource_of_init, .init_machine = intcp_init_of, .restart = integrator_restart, .dt_compat = intcp_dt_board_compat,