Skip to content

Commit

Permalink
microblaze: Added fdt chosen capability for timer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
michalsimek committed Oct 4, 2012
1 parent 9998517 commit 88d23b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion arch/microblaze/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ void __init time_init(void)
0
};
#endif
timer = of_find_compatible_node(NULL, NULL, "xlnx,xps-timer-1.00.a");
prop = of_get_property(of_chosen, "system-timer", NULL);
if (prop)
timer = of_find_node_by_phandle(be32_to_cpup(prop));
else
pr_info("No chosen timer found, using default\n");

if (!timer)
timer = of_find_compatible_node(NULL, NULL,
"xlnx,xps-timer-1.00.a");
BUG_ON(!timer);

timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
Expand Down

0 comments on commit 88d23b4

Please sign in to comment.