mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 17:43:59 +00:00
clocksource: convert Integrator/AP 16-bit down counting clocksource
Convert the Integrator/AP 16-bit down-counting clocksource to the generic clocksource infrastructure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
6fa5d5f764
commit
c5039f5232
@ -4,6 +4,7 @@ menu "Integrator Options"
|
|||||||
|
|
||||||
config ARCH_INTEGRATOR_AP
|
config ARCH_INTEGRATOR_AP
|
||||||
bool "Support Integrator/AP and Integrator/PP2 platforms"
|
bool "Support Integrator/AP and Integrator/PP2 platforms"
|
||||||
|
select CLKSRC_MMIO
|
||||||
select MIGHT_HAVE_PCI
|
select MIGHT_HAVE_PCI
|
||||||
help
|
help
|
||||||
Include support for the ARM(R) Integrator/AP and
|
Include support for the ARM(R) Integrator/AP and
|
||||||
|
@ -335,25 +335,9 @@ static void __init ap_init(void)
|
|||||||
|
|
||||||
static unsigned long timer_reload;
|
static unsigned long timer_reload;
|
||||||
|
|
||||||
static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE;
|
|
||||||
|
|
||||||
static cycle_t timersp_read(struct clocksource *cs)
|
|
||||||
{
|
|
||||||
return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct clocksource clocksource_timersp = {
|
|
||||||
.name = "timer2",
|
|
||||||
.rating = 200,
|
|
||||||
.read = timersp_read,
|
|
||||||
.mask = CLOCKSOURCE_MASK(16),
|
|
||||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
|
||||||
};
|
|
||||||
|
|
||||||
static void integrator_clocksource_init(u32 khz)
|
static void integrator_clocksource_init(u32 khz)
|
||||||
{
|
{
|
||||||
struct clocksource *cs = &clocksource_timersp;
|
void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
|
||||||
void __iomem *base = clksrc_base;
|
|
||||||
u32 ctrl = TIMER_CTRL_ENABLE;
|
u32 ctrl = TIMER_CTRL_ENABLE;
|
||||||
|
|
||||||
if (khz >= 1500) {
|
if (khz >= 1500) {
|
||||||
@ -364,7 +348,8 @@ static void integrator_clocksource_init(u32 khz)
|
|||||||
writel(ctrl, base + TIMER_CTRL);
|
writel(ctrl, base + TIMER_CTRL);
|
||||||
writel(0xffff, base + TIMER_LOAD);
|
writel(0xffff, base + TIMER_LOAD);
|
||||||
|
|
||||||
clocksource_register_khz(cs, khz);
|
clocksource_mmio_init(base + TIMER_VALUE, "timer2",
|
||||||
|
khz * 1000, 200, 16, clocksource_mmio_readl_down);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
|
static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user