History log of /arch/arm/mach-at91/at91rm9200_time.c
Revision Date Author Comments
ac11a1d46cf06a8b5b3535f0ce12b6c1cb48ddab 14-Nov-2013 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> ARM: at91: don't use <mach/timex.h>

The platform specific <mach/timex.h> will be removed in a later patch.
So move its only still used symbol to a different header specific for
the only machine still using it. Also add a few explicit includes of
<mach/hardware.h> that are implicitly available through <mach/timex.h>.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
1c283531115bda77a9b559271311c1983fbcffaa 08-Oct-2013 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> ARM: at91: rm9200: switch back to clockevents_config_and_register

The timer code for at91rm9200 was already converted some time ago by
Shawn Guo in commit 838a2ae (ARM: use clockevents_config_and_register()
where possible) but because of a rounding issue in the timer core this
resulted in an easily reproducible oops. So it was reverted (commit
b7a8ca5 (ARM: at91: rm9200 fix time support)) which stopped the oops
from happening because min_delta_ns is increased by one in arch code
which stopped from problem from happening.

Now that the timer core problem is fixed (commit a4578ea (clockevents:
Sanitize ticks to nsec conversion)), we can switch back to the
clockevents_config_and_register helper.

Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
9ceb389dddbcdb87830f01fcf84d94b2da581dae 04-Sep-2013 Michael Opdenacker <michael.opdenacker@free-electrons.com> ARM: at91: remove IRQF_DISABLED

This flag is a NOOP since 2.6.36 and can be removed.

This is an update for 3.11 of a patch already sent for 3.10

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
b7a8ca5173ef9aa55fa039d7c216426ff0b25a12 15-May-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> ARM: at91: rm9200 fix time support

since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
Author: Shawn Guo <shawn.guo@linaro.org>
Date: Sat Jan 12 11:50:05 2013 +0000

ARM: use clockevents_config_and_register() where possible

The timer is wrongly configured and result in a nice crash
so revert it on rm9200 timer.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: stable <stable@vger.kernel.org> # 3.8+
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
838a2ae80a6ab52139fb1bf0a93ea8c5eff94488 12-Jan-2013 Shawn Guo <shawn.guo@linaro.org> ARM: use clockevents_config_and_register() where possible

The clockevent core is able to figure out the best mult and shift,
calculate min_delta_ns and max_delta_ns, with the necessary info passed
into clockevents_config_and_register(). Use this combined configure
and register function where possible to make the codes less error prone
and gain some positive diff stat.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Tested-by: Roland Stigge <stigge@antcom.de>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: David Brown <davidb@codeaurora.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Barry Song <baohua.song@csr.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
6bb27d7349db51b50c40534710fe164ca0d58902 08-Nov-2012 Stephen Warren <swarren@nvidia.com> ARM: delete struct sys_timer

Now that the only field in struct sys_timer is .init, delete the struct,
and replace the machine descriptor .timer field with the initialization
function itself.

This will enable moving timer drivers into drivers/clocksource without
having to place a public prototype of each struct sys_timer object into
include/linux; the intent is to create a single of_clocksource_init()
function that determines which timer driver to initialize by scanning
the device dtree, much like the proposed irqchip_init() at:
http://www.spinics.net/lists/arm-kernel/msg203686.html

Includes mach-omap2 fixes from Igor Grinberg.

Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
454c46df83945602f1cbc86efcfd063c6945d869 28-Oct-2012 Joachim Eastwood <manabian@gmail.com> ARM: AT91: Add DT support to AT91RM9200 System Timer

Based on AT91 PIT DT patch from Jean-Christophe PLAGNIOL-VILLARD.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
85ebea12f59e3341049a9c17edcb73fcf21043db 14-Aug-2012 Ludovic Desroches <ludovic.desroches@atmel.com> ARM: at91: fix system timer irq issue due to sparse irq support

AT91_ID_SYS as virq is incorrect because of spare irq support which
introduces NR_IRQS_LEGACY offset.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Tested-by: Joachim Eastwood <joachim.eastwood@jotron.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9fce85c7e4357a93457c8fd2534a1cc1c3055bf5 04-Apr-2012 Joachim Eastwood <manabian@gmail.com> ARM: at91: Export at91_st_base

After commit 5e9cf5e (ARM: at91: make ST (System Timer) soc independent)
building at91rm9200_wdt as a module fails with following message
ERROR: "at91_st_base" [drivers/watchdog/at91rm9200_wdt.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Export symbol to allow wdt driver to be built as a module again.

Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com>
[nicolas.ferre@atmel.com: use EXPORT_SYMBOL_GPL()]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9e1c0b2ee8ae69dd4b35187ffbfb749272db3e00 20-Feb-2012 Nicolas Ferre <nicolas.ferre@atmel.com> ARM: at91/ST: remove not needed casts

Remove the unnecessary (void) cast on at91_st_read()
return value.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Ryan Mallon <rmallon@gmail.com>
5e9cf5e18d4bed39467cc020dcd3e66e8a8cd231 20-Feb-2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> ARM: at91: make ST (System Timer) soc independent

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
2f5893cf42ca10a1eb73bc527e2198847f4d0a79 16-Oct-2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> ARM: at91: define CLOCK_TICK_RATE to bogus value except A91X40

We have a clocksource which renders CLOCK_TICK_RATE useless. Define
it to a bogus value to get rid of some ifdeffery.

use local LATCH for at91rm9200 timer

but keep it for A91X40 as we do not use a clocksource

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
132b16325fae0742a02075894af16197e83febe8 13-Dec-2010 Russell King <rmk+kernel@arm.linux.org.uk> ARM: AT91: update clock source registration

In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.

Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
501d70383aa9ffc78b41aa7e74f6b0254c7c731c 21-Sep-2009 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> arm/at91: Don't disable irqs in set_next_event and set_mode callbacks

on AT91 the timer irq is shared, so the handler might be entered without
irqs being disabled. Though this should not happen as the timer irq is
registered early, there have been some reports on the mailing list.

To make debugging that problem easier next time it pops up a
WARN_ON_ONCE is added to the handler if irqs are not off.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
8e19608e8b5c001e4a66ce482edc474f05fb7355 21-Apr-2009 Magnus Damm <damm@igel.co.jp> clocksource: pass clocksource to read() callback

Pass clocksource pointer to the read() callback for clocksources. This
allows us to share the callback between multiple instances.

[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
320ab2b0b1e08e3805a3e1084a2f0eb1938d5d67 13-Dec-2008 Rusty Russell <rusty@rustcorp.com.au> cpumask: convert struct clock_event_device to cpumask pointers.

Impact: change calling convention of existing clock_event APIs

struct clock_event_timer's cpumask field gets changed to take pointer,
as does the ->broadcast function.

Another single-patch change. For safety, we BUG_ON() in
clockevents_register_device() if it's not set.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
c4edfced662fa64deeed89c7d8c9f96d86130c19 20-Nov-2008 Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> at91: warn if irqs are enabled in set_next_event

Thomas claims that irqs are disabled when set_next_event is called. But
David and Remy claim they saw irqs being enabled here. As both sides
don't seem to have time to investigate here, start with a warning that
might trigger if the problem still exists.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-By: David Brownell <dbrownell@users.sourceforge.net>
Cc: Bill Gatliff <bgat@billgatliff.com>
Acked-By: Remy Bohmer <linux@bohmer.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
a09e64fbc0094e3073dbb09c3b4bfe4ab669244b 05-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach

This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
5e802dfab7bbbee1e63607a3e6d1ceb78ec4ceeb 31-Jul-2007 David Brownell <david-b@pacbell.net> [ARM] 4539/1: clocksource and clockevents for at91rm9200

GENERIC_TIME and GENERIC_CLOCKEVENTS support for the at91rm9200.

- Oneshot mode (used for NO_HZ and high res timers) uses the
alarm to emulate a real oneshot timer; the trickiest bit is
how to avoid some lowlevel races. Thanks to Remy Bohmer for
various fixes to this code.

- Tighten up periodic mode support using the PIT.

- Streamline reads of the 32KHz counter. Thanks to Marc Pignat
for some testing results: the CRTR register has *very* odd
behavior. The reread appears to work around stranger glitches
than just getting an old clock value (which would quickly
self-correct).

- Remove the rounding-up of tick_usec to 10.009 msec (32KiHz/100),
since that no longer acts correct (time increases too fast).

Note that the at91sam9 and at91x40 chips need other solutions,
since they don't have the same system timer module.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Bill Gatliff <bgat@billgatliff.com>
Acked-by:Remy Bohmer <linux@bohmer.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
b30fabadae2b3c1a65e3662be98f105d5718db70 08-May-2007 Bernhard Walle <bwalle@suse.de> Add IRQF_IRQPOLL flag on arm

Add IRQF_IRQPOLL for each timer interrupt.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9d0412680e6c7b685ee466842047bcfb924d6dc5 05-Feb-2007 Andrew Victor <andrew@sanpeople.com> [ARM] 4124/1: Rename mach-at91rm9200 and arch-at91rm9200 directories

Now that Linux includes support for the Atmel AT91SAM9260 and
AT91SAM9261 processors in addition to the original Atmel AT91RM9200
(with support for more AT91 processors pending), the "mach-at91rm9200"
and "arch-at91rm9200" directories should be renamed to indicate their
more generic nature.

The following git commands should be run BEFORE applying this patch:
git-mv arch/arm/mach-at91rm9200 arch/arm/mach-at91
git-mv include/asm-arm/arch-at91rm9200 include/asm-arm/arch-at91

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>