diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-08 12:10:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 13:04:52 -0400 |
commit | d6e15d78537d2483bff05f0ee5b5cec6c4678fd5 (patch) | |
tree | c2300cafb150461f7f5035008c708a37b4e83279 /arch/arm | |
parent | c5039f52329ff796d7fea9024e5615abee02dbfb (diff) |
clocksource: convert SPEAr platforms 16-bit up counting clocksource
Convert SPEAr platforms 16-bit up counting clocksource, which requires
a 16-bit register access read rather than 32-bit.
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/plat-spear/time.c | 16 |
2 files changed, 3 insertions, 14 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bab25a0ba107..cbc27fb1256f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -884,6 +884,7 @@ config PLAT_SPEAR | |||
884 | select ARM_AMBA | 884 | select ARM_AMBA |
885 | select ARCH_REQUIRE_GPIOLIB | 885 | select ARCH_REQUIRE_GPIOLIB |
886 | select CLKDEV_LOOKUP | 886 | select CLKDEV_LOOKUP |
887 | select CLKSRC_MMIO | ||
887 | select GENERIC_CLOCKEVENTS | 888 | select GENERIC_CLOCKEVENTS |
888 | select HAVE_CLK | 889 | select HAVE_CLK |
889 | help | 890 | help |
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index dbb6e4fff79d..0c77e4298675 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c | |||
@@ -70,19 +70,6 @@ static void clockevent_set_mode(enum clock_event_mode mode, | |||
70 | static int clockevent_next_event(unsigned long evt, | 70 | static int clockevent_next_event(unsigned long evt, |
71 | struct clock_event_device *clk_event_dev); | 71 | struct clock_event_device *clk_event_dev); |
72 | 72 | ||
73 | static cycle_t clocksource_read_cycles(struct clocksource *cs) | ||
74 | { | ||
75 | return (cycle_t) readw(gpt_base + COUNT(CLKSRC)); | ||
76 | } | ||
77 | |||
78 | static struct clocksource clksrc = { | ||
79 | .name = "tmr1", | ||
80 | .rating = 200, /* its a pretty decent clock */ | ||
81 | .read = clocksource_read_cycles, | ||
82 | .mask = 0xFFFF, /* 16 bits */ | ||
83 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
84 | }; | ||
85 | |||
86 | static void spear_clocksource_init(void) | 73 | static void spear_clocksource_init(void) |
87 | { | 74 | { |
88 | u32 tick_rate; | 75 | u32 tick_rate; |
@@ -103,7 +90,8 @@ static void spear_clocksource_init(void) | |||
103 | writew(val, gpt_base + CR(CLKSRC)); | 90 | writew(val, gpt_base + CR(CLKSRC)); |
104 | 91 | ||
105 | /* register the clocksource */ | 92 | /* register the clocksource */ |
106 | clocksource_register_hz(&clksrc, tick_rate); | 93 | clocksource_mmio_init(gpt_base + COUNT(CLKSRC), "tmr1", tick_rate, |
94 | 200, 16, clocksource_mmio_readw_up); | ||
107 | } | 95 | } |
108 | 96 | ||
109 | static struct clock_event_device clkevt = { | 97 | static struct clock_event_device clkevt = { |