diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-08-27 05:13:29 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-09-03 05:26:52 -0400 |
commit | 4bcd943ec81052db47465762bef6787b30b81978 (patch) | |
tree | 821b2cd193aef76ac56cde3f5c8c7bc380c4067e /arch/microblaze | |
parent | 144f5c19ff954c4b2917f01b763fa2fa51c433a9 (diff) |
microblaze: timer: Use CLKSRC_OF initialization
Simplify timer initialization and prepare the driver
for moving to drivers/clocksource folder.
Also remove system-timer property from binding because
the name is too generic.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/Kconfig | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/setup.c | 6 | ||||
-rw-r--r-- | arch/microblaze/kernel/timer.c | 17 |
3 files changed, 11 insertions, 13 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 4fab52294d98..3f6659cbc969 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -29,6 +29,7 @@ config MICROBLAZE | |||
29 | select GENERIC_IDLE_POLL_SETUP | 29 | select GENERIC_IDLE_POLL_SETUP |
30 | select MODULES_USE_ELF_RELA | 30 | select MODULES_USE_ELF_RELA |
31 | select CLONE_BACKWARDS3 | 31 | select CLONE_BACKWARDS3 |
32 | select CLKSRC_OF | ||
32 | 33 | ||
33 | config SWAP | 34 | config SWAP |
34 | def_bool n | 35 | def_bool n |
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 4259f8b0f113..0775e036c526 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/clocksource.h> | ||
12 | #include <linux/string.h> | 13 | #include <linux/string.h> |
13 | #include <linux/seq_file.h> | 14 | #include <linux/seq_file.h> |
14 | #include <linux/cpu.h> | 15 | #include <linux/cpu.h> |
@@ -192,6 +193,11 @@ void __init machine_early_init(const char *cmdline, unsigned int ram, | |||
192 | per_cpu(CURRENT_SAVE, 0) = (unsigned long)current; | 193 | per_cpu(CURRENT_SAVE, 0) = (unsigned long)current; |
193 | } | 194 | } |
194 | 195 | ||
196 | void __init time_init(void) | ||
197 | { | ||
198 | clocksource_of_init(); | ||
199 | } | ||
200 | |||
195 | #ifdef CONFIG_DEBUG_FS | 201 | #ifdef CONFIG_DEBUG_FS |
196 | struct dentry *of_debugfs_root; | 202 | struct dentry *of_debugfs_root; |
197 | 203 | ||
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index d00a60e62e05..6cb7f3b1914a 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c | |||
@@ -238,24 +238,12 @@ static int __init microblaze_clocksource_init(void) | |||
238 | */ | 238 | */ |
239 | static int timer_initialized; | 239 | static int timer_initialized; |
240 | 240 | ||
241 | void __init time_init(void) | 241 | static void __init xilinx_timer_init(struct device_node *timer) |
242 | { | 242 | { |
243 | u32 irq; | 243 | u32 irq; |
244 | u32 timer_num = 1; | 244 | u32 timer_num = 1; |
245 | struct device_node *timer = NULL; | ||
246 | const void *prop; | 245 | const void *prop; |
247 | 246 | ||
248 | prop = of_get_property(of_chosen, "system-timer", NULL); | ||
249 | if (prop) | ||
250 | timer = of_find_node_by_phandle(be32_to_cpup(prop)); | ||
251 | else | ||
252 | pr_info("No chosen timer found, using default\n"); | ||
253 | |||
254 | if (!timer) | ||
255 | timer = of_find_compatible_node(NULL, NULL, | ||
256 | "xlnx,xps-timer-1.00.a"); | ||
257 | BUG_ON(!timer); | ||
258 | |||
259 | timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); | 247 | timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); |
260 | timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); | 248 | timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); |
261 | irq = irq_of_parse_and_map(timer, 0); | 249 | irq = irq_of_parse_and_map(timer, 0); |
@@ -297,3 +285,6 @@ unsigned long long notrace sched_clock(void) | |||
297 | } | 285 | } |
298 | return 0; | 286 | return 0; |
299 | } | 287 | } |
288 | |||
289 | CLOCKSOURCE_OF_DECLARE(xilinx_timer, "xlnx,xps-timer-1.00.a", | ||
290 | xilinx_timer_init); | ||