Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide implementation of sched_clock() #51

Merged
merged 2 commits into from
Jul 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ config MIPS
select GENERIC_SMP_IDLE_THREAD
select BUILDTIME_EXTABLE_SORT
select GENERIC_CLOCKEVENTS
select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
select GENERIC_CMOS_UPDATE
select HAVE_MOD_ARCH_SPECIFIC
select VIRT_TO_BUS
Expand Down
7 changes: 7 additions & 0 deletions drivers/clocksource/jz4780-tcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/clocksource.h>
#include <linux/err.h>
#include <linux/sched_clock.h>

#include "jz47xx-tcu.h"

Expand Down Expand Up @@ -51,6 +52,11 @@ static cycle_t jz4780_tcu_clocksource_read(struct clocksource *cs)
return jz47xx_tcu_read_channel_count(jz4780_tcu_clocksource.channel);
}

static u64 notrace jz4780_tcu_sched_read(void)
{
return jz47xx_tcu_read_channel_count(jz4780_tcu_clocksource.channel);
}

static void __init jz4780_tcu_init(struct device_node *np)
{
struct jz47xx_tcu *tcu;
Expand All @@ -72,6 +78,7 @@ static void __init jz4780_tcu_init(struct device_node *np)

err = clocksource_register_hz(&jz4780_tcu_clocksource.cs, rate);
BUG_ON(err);
sched_clock_register(jz4780_tcu_sched_read, 64, rate);

/* For local clock events */
err = jz47xx_tcu_setup_cevt(tcu, 5);
Expand Down