From patchwork Mon Jun 27 19:11:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 922112 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5RJBPK0030131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Jun 2011 19:11:46 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbHDH-0002Ng-U3; Mon, 27 Jun 2011 19:11:16 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QbHDH-00041s-JZ; Mon, 27 Jun 2011 19:11:15 +0000 Received: from mho-04-ewr.mailhop.org ([204.13.248.74] helo=mho-02-ewr.mailhop.org) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbHDE-00041a-T2 for linux-arm-kernel@lists.infradead.org; Mon, 27 Jun 2011 19:11:13 +0000 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1QbHD7-00037d-Gv; Mon, 27 Jun 2011 19:11:05 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+S+FU2QYiAWfxJnRE0EhqD Date: Mon, 27 Jun 2011 12:11:02 -0700 From: Tony Lindgren To: Russell King - ARM Linux Subject: Re: [PATCH] Use MMIO clocksource for 32kHz counter Message-ID: <20110627191102.GV23145@atomide.com> References: <20110627123315.GB1777@n2100.arm.linux.org.uk> <20110627123754.GQ23145@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110627123754.GQ23145@atomide.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110627_151113_000016_626D20CE X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [204.13.248.74 listed in list.dnswl.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Cc: Kevin Hilman , Thomas Gleixner , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 27 Jun 2011 19:11:46 +0000 (UTC) * Tony Lindgren [110627 05:33]: > * Russell King - ARM Linux [110627 05:28]: > > --- a/arch/arm/plat-omap/counter_32k.c > > +++ b/arch/arm/plat-omap/counter_32k.c > > +#ifdef CONFIG_ARCH_OMAP16XX > > + else if (cpu_is_omap16xx()) > > + base = OMAP2_L4_IO_ADDRESS(OMAP16XX_TIMER_32K_SYNCHRONIZED); BTW, the above should have been OMAP1_IO_ADDRESS instead.. > You should be able to replace the above with just ioremap as we now > have the static mappings. ..here's a patch to use ioremap with comment added about the static mapping requirements. Thanks for getting rid of hopefully the last remaining omap_readl for omap2+ BTW :) Tony --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c @@ -106,34 +106,30 @@ int __init omap_init_clocksource_32k(void) "%s: can't register clocksource!\n"; if (cpu_is_omap16xx() || cpu_class_is_omap2()) { + u32 pbase; + unsigned long size = SZ_4K; void __iomem *base; struct clk *sync_32k_ick; - if (0) - base = NULL; -#ifdef CONFIG_ARCH_OMAP16XX - else if (cpu_is_omap16xx()) - base = OMAP2_L4_IO_ADDRESS(OMAP16XX_TIMER_32K_SYNCHRONIZED); -#endif -#ifdef CONFIG_SOC_OMAP2420 - else if (cpu_is_omap2420()) - base = OMAP2_L4_IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x10); -#endif -#ifdef CONFIG_SOC_OMAP2430 + if (cpu_is_omap16xx()) { + pbase = OMAP16XX_TIMER_32K_SYNCHRONIZED; + size = SZ_1K; + } else if (cpu_is_omap2420()) + pbase = OMAP2420_32KSYNCT_BASE + 0x10; else if (cpu_is_omap2430()) - base = OMAP2_L4_IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x10); -#endif -#ifdef CONFIG_ARCH_OMAP3 + pbase = OMAP2430_32KSYNCT_BASE + 0x10; else if (cpu_is_omap34xx()) - base = OMAP2_L4_IO_ADDRESS(OMAP3430_32KSYNCT_BASE + 0x10); -#endif -#ifdef CONFIG_ARCH_OMAP4 + pbase = OMAP3430_32KSYNCT_BASE + 0x10; else if (cpu_is_omap44xx()) - base = OMAP2_L4_IO_ADDRESS(OMAP4430_32KSYNCT_BASE + 0x10); -#endif + pbase = OMAP4430_32KSYNCT_BASE + 0x10; else return -ENODEV; + /* For this to work we must have a static mapping in io.c for this area */ + base = ioremap(pbase, size); + if (!base) + return -ENODEV; + sync_32k_ick = clk_get(NULL, "omap_32ksync_ick"); if (!IS_ERR(sync_32k_ick)) clk_enable(sync_32k_ick);