diff options
author | Michal Simek <monstr@monstr.eu> | 2011-12-12 08:02:47 -0500 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2012-10-04 08:29:15 -0400 |
commit | 88d23b4462c9c9b8c8876d60f5b57d39b53c6227 (patch) | |
tree | 42a10487a2d7b1ab182c2098894ecee178fb169b /arch/microblaze | |
parent | 9998517a2789850e4e48bad6ada4de1f6c5a760d (diff) |
microblaze: Added fdt chosen capability for timer
This lets a dts author flag a particular timer in the system as the system timer.
If the chosen node contains a "system-timer=<&foo>" entry than that handle will
be used to determine the system timer. In no such entry exists then the first
found timer will be used (current behaviour).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/kernel/timer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 522defa7d41f..edd3f835e7df 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c | |||
@@ -257,7 +257,15 @@ void __init time_init(void) | |||
257 | 0 | 257 | 0 |
258 | }; | 258 | }; |
259 | #endif | 259 | #endif |
260 | timer = of_find_compatible_node(NULL, NULL, "xlnx,xps-timer-1.00.a"); | 260 | prop = of_get_property(of_chosen, "system-timer", NULL); |
261 | if (prop) | ||
262 | timer = of_find_node_by_phandle(be32_to_cpup(prop)); | ||
263 | else | ||
264 | pr_info("No chosen timer found, using default\n"); | ||
265 | |||
266 | if (!timer) | ||
267 | timer = of_find_compatible_node(NULL, NULL, | ||
268 | "xlnx,xps-timer-1.00.a"); | ||
261 | BUG_ON(!timer); | 269 | BUG_ON(!timer); |
262 | 270 | ||
263 | timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); | 271 | timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); |