From: Michal Simek Date: Mon, 12 Dec 2011 13:02:47 +0000 (+0100) Subject: microblaze: Added fdt chosen capability for timer X-Git-Tag: v3.7-rc1~95^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88d23b4462c9c9b8c8876d60f5b57d39b53c6227;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: Michal Simek --- diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 522defa..edd3f83 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -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));