ARM: smp_twd: add runtime registration support

Add support for the new registration interface to smp_twd.
Platforms can populate a struct twd_local_timer with MMIO
and IRQ resources, and then call twd_local_timer_register()
to have the timer registered with the core.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
Marc Zyngier
2012-01-10 19:39:26 +00:00
parent 0ef330e10d
commit 81e46f7b6d
2 changed files with 65 additions and 4 deletions

View File

@@ -18,10 +18,26 @@
#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
#include <linux/ioport.h>
struct clock_event_device;
extern void __iomem *twd_base;
void twd_timer_setup(struct clock_event_device *);
int twd_timer_setup(struct clock_event_device *);
struct twd_local_timer {
struct resource res[2];
};
#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 *);
#endif