From patchwork Wed Mar 13 05:05:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 15315 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 3B0FA23E2E for ; Wed, 13 Mar 2013 05:07:23 +0000 (UTC) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by fiordland.canonical.com (Postfix) with ESMTP id EEFC8A192C3 for ; Wed, 13 Mar 2013 05:07:22 +0000 (UTC) Received: by mail-ve0-f170.google.com with SMTP id 14so439611vea.15 for ; Tue, 12 Mar 2013 22:07:22 -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=WaL8R1Idn5U4u+Kyod21pCgk3ItuORjnwi3m2JJi8hw=; b=TLcyjjfE5NeUa4dQfdLtROE9nBjUTc2XEjezsWopV7D+JjNr8+Po2EQfFNeQ6fzCuj oGdYJoOMAoHfnTGtnDoTg53FY3ujQKM1zdte+xZc26DDG6N/7qiObtvPCALlmd6mCaOK Mrj2mLFAQ8xWIlIb2AJAQVoE1B6tFuQeObBYydKqqkkWb0fh9MWJ3TIlS+uiKC4KXLc4 JKdCxNEropK1rPAd9Tbj6kUJJ2TF3OFluZPtYYv2sYvnZfRt22SnyadoClqfytxnXMgv qi0gIuL3U6cs9jWIViUajkiz9Kt3HqckEEGRtPb7fvUB+TmQTs/kJHsQ7Orl7iDwHwOP pLag== X-Received: by 10.220.214.6 with SMTP id gy6mr4360906vcb.8.1363151242448; Tue, 12 Mar 2013 22:07:22 -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 nf2csp1630veb; Tue, 12 Mar 2013 22:07:21 -0700 (PDT) X-Received: by 10.68.233.229 with SMTP id tz5mr35037553pbc.172.1363151241540; Tue, 12 Mar 2013 22:07:21 -0700 (PDT) Received: from mail-da0-x22b.google.com (mail-da0-x22b.google.com [2607:f8b0:400e:c00::22b]) by mx.google.com with ESMTPS id si3si33535564pbc.251.2013.03.12.22.07.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 22:07:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::22b is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=2607:f8b0:400e:c00::22b; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400e:c00::22b 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-da0-f43.google.com with SMTP id u36so247905dak.16 for ; Tue, 12 Mar 2013 22:07:20 -0700 (PDT) X-Received: by 10.68.25.138 with SMTP id c10mr43050137pbg.133.1363151240465; Tue, 12 Mar 2013 22:07:20 -0700 (PDT) Received: from localhost.localdomain ([67.198.145.34]) by mx.google.com with ESMTPS id ab1sm27947630pbd.37.2013.03.12.22.07.15 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 22:07:19 -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 05/11] ARM: highbank: use clocksource_of_init for sp804 Date: Wed, 13 Mar 2013 13:05:36 +0800 Message-Id: <1363151142-32162-6-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: ALoCoQlZIGk2L0jiJAw3+sPRxK/HSkz2nm4n4c/FtDOsKP1IHzkIT0UBV22K67gpppIN8RGsziZ0 Since sp804 hardware information could be stored in DTS file, remove those ioremap operations. Use clocksource_of_init() instead. Signed-off-by: Haojian Zhuang --- arch/arm/boot/dts/ecx-common.dtsi | 4 +++- arch/arm/mach-highbank/highbank.c | 19 +------------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/arch/arm/boot/dts/ecx-common.dtsi b/arch/arm/boot/dts/ecx-common.dtsi index d61b535..7ae5b2d 100644 --- a/arch/arm/boot/dts/ecx-common.dtsi +++ b/arch/arm/boot/dts/ecx-common.dtsi @@ -105,8 +105,10 @@ compatible = "arm,sp804", "arm,primecell"; reg = <0xfff34000 0x1000>; interrupts = <0 18 4>; - clocks = <&pclk>; + clocks = <&pclk &pclk>; clock-names = "apb_pclk"; + arm,sp804-clocksource = <0x20>; + arm,sp804-clockevent = <0>; }; rtc@fff35000 { diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index cfd843b..7829c2d 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -91,33 +91,16 @@ static void __init highbank_init_irq(void) #endif } -static struct clk_lookup lookup = { - .dev_id = "sp804", - .con_id = NULL, -}; - static void __init highbank_timer_init(void) { - int irq; struct device_node *np; - void __iomem *timer_base; /* Map system registers */ np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); sregs_base = of_iomap(np, 0); WARN_ON(!sregs_base); - np = of_find_compatible_node(NULL, NULL, "arm,sp804"); - timer_base = of_iomap(np, 0); - WARN_ON(!timer_base); - irq = irq_of_parse_and_map(np, 0); - - of_clk_init(NULL); - lookup.clk = of_clk_get(np, 0); - clkdev_add(&lookup); - - sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1"); - sp804_clockevents_init(timer_base, irq, "timer0"); + clocksource_of_init(); twd_local_timer_of_register();