Commit Graph
17 Commits
Author SHA1 Message Date
Marc Zyngier bd0493eaaf ARM: 7413/1: move read_{boot,persistent}_clock to the architecture level
At the moment, read_persistent_clock is implemented at the
platform level, which makes it impossible to compile these
platforms in a single kernel.

Implement these two functions at the architecture level, and
provide a thin registration interface for both read_boot_clock
and read_persistent_clock. The two affected platforms (OMAP and
Tegra) are converted at the same time.

Reported-by: Jeff Ohlstein <[email protected]>
Tested-by: Stephen Warren <[email protected]>
Tested-by: Tony Lindgren <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Signed-off-by: Russell King <[email protected]>
2012-05-06 11:09:21 +01:00
Marc Zyngier 1fcf3a6edd ARM: tegra: convert to twd_local_timer_register() interface
Add support for the new smp_twd runtime registration interface
to the tegra platforms, and remove the old compile-time support.
Tested on Harmony.

Acked-by: Stephen Warren <[email protected]>
Cc: Colin Cross <[email protected]>
Cc: Olof Johansson <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
2012-03-13 13:30:30 +00:00
Arnd Bergmann 23c4c1c7b0 Merge branch 'depends/rmk/for-linus' into next/soc
Conflicts:
	arch/arm/mach-tegra/board-dt-tegra20.c
	arch/arm/mach-tegra/common.c
2012-01-07 20:53:13 +00:00
Marc Zyngier 2f0778afac ARM: 7205/2: sched_clock: allow sched_clock to be selected at runtime
sched_clock() is yet another blocker on the road to the single
image. This patch implements an idea by Russell King:

http://www.spinics.net/lists/linux-omap/msg49561.html

Instead of asking the platform to implement both sched_clock()
itself and the rollover callback, simply register a read()
function, and let the ARM code care about sched_clock() itself,
the conversion to ns and the rollover. sched_clock() uses
this read() function as an indirection to the platform code.
If the platform doesn't provide a read(), the code falls back
to the jiffy counter (just like the default sched_clock).

This allow some simplifications and possibly some footprint gain
when multiple platforms are compiled in. Among the drawbacks,
the removal of the *_fixed_sched_clock optimization which could
negatively impact some platforms (sa1100, tegra, versatile
and omap).

Tested on 11MPCore, OMAP4 and Tegra.

Cc: Imre Kaloz <[email protected]>
Cc: Eric Miao <[email protected]>
Cc: Colin Cross <[email protected]>
Cc: Erik Gilling <[email protected]>
Cc: Olof Johansson <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Alessandro Rubini <[email protected]>
Cc: STEricsson <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Ben Dooks <[email protected]>
Tested-by: Jamie Iles <[email protected]>
Tested-by: Tony Lindgren <[email protected]>
Tested-by: Kyungmin Park <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
Acked-by: Krzysztof Halasa <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Signed-off-by: Russell King <[email protected]>
2011-12-18 23:00:26 +00:00
Peter De Schrijver 8e4fab2c39 arm/tegra: don't export clk_measure_input_freq
don't export clk_measure_input_freq as its functionality is also available
using clk_get_rate().

Signed-off-by: Peter De Schrijver <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Acked-by: Colin Cross <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
2011-12-17 20:15:08 -08:00
Peter De Schrijver 2d85b5d8e1 arm/tegra: clk_get should not be fatal
The timer and rtc-timer clocks aren't gated by default, so there is no reason
to crash the system if the dummy enable call failed.

Signed-off-by: Peter De Schrijver <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
2011-12-17 20:06:18 -08:00
Olof Johansson b28fba2a4e ARM: tegra: tegra_rtc_read_ms should be static
Not exported and not used externally.

Signed-off-by: Olof Johansson <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
2011-10-13 14:08:28 -07:00
Olof Johansson 75d711662f ARM: tegra: timer: don't cast __iomem pointers
Fixes a lot of:

arch/arm/mach-tegra/timer.c:75:2: warning: cast removes address space of expression
arch/arm/mach-tegra/timer.c:75:2: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-tegra/timer.c:75:2:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-tegra/timer.c:75:2:    got unsigned int
arch/arm/mach-tegra/timer.c:75:2: warning: cast removes address space of expression

Signed-off-by: Olof Johansson <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
2011-10-13 14:08:25 -07:00
Russell King 234b6ceddb clocksource: convert ARM 32-bit up counting clocksources
Convert ixp4xx, lpc32xx, mxc, netx, pxa, sa1100, tcc8k, tegra and u300
to use the generic mmio clocksource recently introduced.

Cc: Imre Kaloz <[email protected]>
Cc: Krzysztof Halasa <[email protected]>
Acked-by: Eric Miao <[email protected]>
Acked-by: "Hans J. Koch" <[email protected]>
Acked-by: Colin Cross <[email protected]>
Cc: Erik Gilling <[email protected]>
Cc: Olof Johansson <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Russell King <[email protected]>
2011-05-23 18:04:51 +01:00
Colin Cross 62248ae826 ARM: tegra: timer: Enable timer and rtc clocks
Enable the timer and rtc clocks to prevent them being
turned off by the bootloader clock disabling code.

Signed-off-by: Colin Cross <[email protected]>
Acked-by: Olof Johansson <[email protected]>
2011-02-22 14:48:27 -08:00
Colin Cross 093617851c ARM: tegra: timer: Add idle and suspend support to timers
Implement read_persistent_clock by reading the Tegra RTC
registers that stay running during suspend.

Save and restore the timer configuration register in
suspend.

Signed-off-by: Colin Cross <[email protected]>
2011-02-09 22:17:38 -08:00
Colin Cross 2ea67fd145 ARM: tegra: Add prototypes for subsystem suspend functions
Signed-off-by: Colin Cross <[email protected]>
2011-02-09 21:57:01 -08:00
Russell King e3f4c0ab91 ARM: tegra: convert sched_clock() to use new infrastructure
Convert tegra to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.

Tested-by: Olof Johansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
2010-12-22 22:44:47 +00:00
Russell King 5e06b6492e ARM: ensure all sched_clock() implementations are notrace marked
ftrace requires sched_clock() to be notrace.  Ensure that all
implementations are so marked.  Also make sure that they include
linux/sched.h

Also ensure OMAP clocksource read functions are marked notrace as
they're used for sched_clock() too.

Tested-by: Santosh Shilimkar <[email protected]>
Tested-by: Will Deacon <[email protected]>
Tested-by: Mikael Pettersson <[email protected]>
Tested-by: Eric Miao <[email protected]>
Tested-by: Olof Johansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
2010-12-22 22:44:42 +00:00
Colin Cross 684e94cbcb ARM: tegra: timer: Separate clocksource and sched_clock
tegra_clocksource_read should not use cnt32_to_63, wrapping is
already handled in the clocksource code.  Move the cnt32_to_63
into the sched_clock function, and replace the use of clocksource
mult and shift with a multiplication by 1000 to convert us to ns.

Acked-by: John Stultz <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Tested-by: Olof Johansson <[email protected]>
Signed-off-by: Colin Cross <[email protected]>
Signed-off-by: Russell King <[email protected]>
2010-12-22 22:44:42 +00:00
Zimny Lech 61d8e11e51 Remove duplicate includes from many files
Signed-off-by: Zimny Lech <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-10-27 18:03:18 -07:00
Colin Cross 2d5cd9a38b [ARM] tegra: Add timer support
v2: fixes from Russell King:
	- include linux/io.h instead of asm/io.h
    fixes from Gary King:
	- remove extra (and incorrect) irq definitions
	- use timer 3 instead of timer 1 for compatibility with other drivers
	- fix typo that disabled oneshot mode
v3:
	- Implement sched_clock
	- Fix checkpatch issues
    fixes from Gary King:
    	- Fix incorrect cycles calculation
	- Fix min_delta_ns assignment
    fixes from Linus Walleij:
	- use calc_mult_shift() instead of hard coding values

Signed-off-by: Colin Cross <[email protected]>
2010-08-05 14:57:02 -07:00