Skip to content

Commit

Permalink
ARM: footbridge: add sched_clock implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Dec 29, 2013
1 parent e68f31f commit 6cefe92
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mach-footbridge/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ extern void footbridge_init_irq(void);

extern void isa_init_irq(unsigned int irq);
extern void footbridge_restart(enum reboot_mode, const char *);

extern void footbridge_sched_clock(void);
17 changes: 17 additions & 0 deletions arch/arm/mach-footbridge/dc21285-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/sched_clock.h>

#include <asm/irq.h>

Expand Down Expand Up @@ -104,3 +105,19 @@ void __init footbridge_timer_init(void)
ce->cpumask = cpumask_of(smp_processor_id());
clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff);
}

static u32 notrace footbridge_read_sched_clock(void)
{
return ~*CSR_TIMER3_VALUE;
}

void __init footbridge_sched_clock(void)
{
unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16);

*CSR_TIMER3_LOAD = 0;
*CSR_TIMER3_CLR = 0;
*CSR_TIMER3_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16;

setup_sched_clock(footbridge_read_sched_clock, 24, rate);
}
1 change: 1 addition & 0 deletions arch/arm/mach-footbridge/ebsa285.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ MACHINE_START(EBSA285, "EBSA285")
.video_start = 0x000a0000,
.video_end = 0x000bffff,
.map_io = footbridge_map_io,
.init_early = footbridge_sched_clock,
.init_irq = footbridge_init_irq,
.init_time = footbridge_timer_init,
.restart = footbridge_restart,
Expand Down

0 comments on commit 6cefe92

Please sign in to comment.