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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>