Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 648ab3df authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge branch 'local_timers-for-arm-soc' of...

Merge branch 'local_timers-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into next/timer

* 'local_timers-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms:
  ARM: local timers: make the runtime registration interface mandatory
  ARM: local timers: convert MSM to runtime registration interface
  ARM: local timers: convert exynos to runtime registration interface
  ARM: smp_twd: remove old local timer interface
  ARM: imx6q: convert to twd_local_timer_register() interface
  ARM: highbank: convert to twd_local_timer_register() interface
  ARM: ux500: convert to twd_local_timer_register() interface
  ARM: shmobile: convert to twd_local_timer_register() interface
  ARM: tegra: convert to twd_local_timer_register() interface
  ARM: plat-versatile: convert to twd_local_timer_register() interface
  ARM: OMAP4: convert to twd_local_timer_register() interface
  ARM: smp_twd: add device tree support
  ARM: smp_twd: add runtime registration support
  ARM: local timers: introduce a new registration interface
  ARM: smp_twd: make local_timer_stop a symbol instead of a #define
parents a2821146 d4578592
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
* ARM Timer Watchdog

ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core
Timer-Watchdog (aka TWD), which provides both a per-cpu local timer
and watchdog.

The TWD is usually attached to a GIC to deliver its two per-processor
interrupts.

** Timer node required properties:

- compatible : Should be one of:
	"arm,cortex-a9-twd-timer"
	"arm,cortex-a5-twd-timer"
	"arm,arm11mp-twd-timer"

- interrupts : One interrupt to each core

- reg : Specify the base address and the size of the TWD timer
	register window.

Example:

	twd-timer@2c000600 {
		compatible = "arm,arm11mp-twd-timer"";
		reg = <0x2c000600 0x20>;
		interrupts = <1 13 0xf01>;
	};

** Watchdog node properties:

- compatible : Should be one of:
	"arm,cortex-a9-twd-wdt"
	"arm,cortex-a5-twd-wdt"
	"arm,arm11mp-twd-wdt"

- interrupts : One interrupt to each core

- reg : Specify the base address and the size of the TWD watchdog
	register window.

Example:

	twd-watchdog@2c000620 {
		compatible = "arm,arm11mp-twd-wdt";
		reg = <0x2c000620 0x20>;
		interrupts = <1 14 0xf01>;
	};
+4 −4
Original line number Diff line number Diff line
@@ -72,15 +72,15 @@
		ranges;

		timer@fff10600 {
			compatible = "arm,smp-twd";
			compatible = "arm,cortex-a9-twd-timer";
			reg = <0xfff10600 0x20>;
			interrupts = <1 13 0xf04>;
			interrupts = <1 13 0xf01>;
		};

		watchdog@fff10620 {
			compatible = "arm,cortex-a9-wdt";
			compatible = "arm,cortex-a9-twd-wdt";
			reg = <0xfff10620 0x20>;
			interrupts = <1 14 0xf04>;
			interrupts = <1 14 0xf01>;
		};

		intc: interrupt-controller@fff11000 {
+3 −3
Original line number Diff line number Diff line
@@ -88,9 +88,9 @@
		ranges;

		timer@00a00600 {
			compatible = "arm,smp-twd";
			reg = <0x00a00600 0x100>;
			interrupts = <1 13 0xf4>;
			compatible = "arm,cortex-a9-twd-timer";
			reg = <0x00a00600 0x20>;
			interrupts = <1 13 0xf01>;
		};

		L2: l2-cache@00a02000 {
+7 −30
Original line number Diff line number Diff line
@@ -11,47 +11,24 @@
#define __ASM_ARM_LOCALTIMER_H

#include <linux/errno.h>
#include <linux/interrupt.h>

struct clock_event_device;

/*
 * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
 */
void percpu_timer_setup(void);
struct local_timer_ops {
	int  (*setup)(struct clock_event_device *);
	void (*stop)(struct clock_event_device *);
};

#ifdef CONFIG_LOCAL_TIMERS

#ifdef CONFIG_HAVE_ARM_TWD

#include "smp_twd.h"

#define local_timer_stop(c)	twd_timer_stop((c))

#else

/*
 * Stop the local timer
 */
void local_timer_stop(struct clock_event_device *);

#endif

/*
 * Setup a local timer interrupt for a CPU.
 * Register a local timer driver
 */
int local_timer_setup(struct clock_event_device *);

int local_timer_register(struct local_timer_ops *);
#else

static inline int local_timer_setup(struct clock_event_device *evt)
static inline int local_timer_register(struct local_timer_ops *ops)
{
	return -ENXIO;
}

static inline void local_timer_stop(struct clock_event_device *evt)
{
}
#endif

#endif
+21 −4
Original line number Diff line number Diff line
@@ -18,11 +18,28 @@
#define TWD_TIMER_CONTROL_PERIODIC	(1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE	(1 << 2)

struct clock_event_device;
#include <linux/ioport.h>

extern void __iomem *twd_base;
struct twd_local_timer {
	struct resource	res[2];
};

void twd_timer_setup(struct clock_event_device *);
void twd_timer_stop(struct clock_event_device *);
#define DEFINE_TWD_LOCAL_TIMER(name,base,irq)	\
struct twd_local_timer name __initdata = {	\
	.res	= {				\
		DEFINE_RES_MEM(base, 0x10),	\
		DEFINE_RES_IRQ(irq),		\
	},					\
};

int twd_local_timer_register(struct twd_local_timer *);

#ifdef CONFIG_HAVE_ARM_TWD
void twd_local_timer_of_register(void);
#else
static inline void twd_local_timer_of_register(void)
{
}
#endif

#endif
Loading