aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/time.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 02:34:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:17 -0400
commit07f8e5f358a0b7240f1dad6b3819f2fd1103f159 (patch)
tree5976cc05de92f27a9cc12a3db31ced5311ac3769 /arch/sparc64/kernel/time.c
parent6d307724cb6a6b8466cad4fdf13d8a409bc2433f (diff)
[SPARC64]: Convert cpu_find_by_*() interface to in-kernel PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/time.c')
-rw-r--r--arch/sparc64/kernel/time.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 0f00a99927e..aa5438a4fd5 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -48,6 +48,7 @@
48#include <asm/sections.h> 48#include <asm/sections.h>
49#include <asm/cpudata.h> 49#include <asm/cpudata.h>
50#include <asm/uaccess.h> 50#include <asm/uaccess.h>
51#include <asm/prom.h>
51 52
52DEFINE_SPINLOCK(mostek_lock); 53DEFINE_SPINLOCK(mostek_lock);
53DEFINE_SPINLOCK(rtc_lock); 54DEFINE_SPINLOCK(rtc_lock);
@@ -983,12 +984,14 @@ try_isa_clock:
983/* This is gets the master TICK_INT timer going. */ 984/* This is gets the master TICK_INT timer going. */
984static unsigned long sparc64_init_timers(void) 985static unsigned long sparc64_init_timers(void)
985{ 986{
987 struct device_node *dp;
988 struct property *prop;
986 unsigned long clock; 989 unsigned long clock;
987 int node;
988#ifdef CONFIG_SMP 990#ifdef CONFIG_SMP
989 extern void smp_tick_init(void); 991 extern void smp_tick_init(void);
990#endif 992#endif
991 993
994 dp = of_find_node_by_path("/");
992 if (tlb_type == spitfire) { 995 if (tlb_type == spitfire) {
993 unsigned long ver, manuf, impl; 996 unsigned long ver, manuf, impl;
994 997
@@ -999,18 +1002,17 @@ static unsigned long sparc64_init_timers(void)
999 if (manuf == 0x17 && impl == 0x13) { 1002 if (manuf == 0x17 && impl == 0x13) {
1000 /* Hummingbird, aka Ultra-IIe */ 1003 /* Hummingbird, aka Ultra-IIe */
1001 tick_ops = &hbtick_operations; 1004 tick_ops = &hbtick_operations;
1002 node = prom_root_node; 1005 prop = of_find_property(dp, "stick-frequency", NULL);
1003 clock = prom_getint(node, "stick-frequency");
1004 } else { 1006 } else {
1005 tick_ops = &tick_operations; 1007 tick_ops = &tick_operations;
1006 cpu_find_by_instance(0, &node, NULL); 1008 cpu_find_by_instance(0, &dp, NULL);
1007 clock = prom_getint(node, "clock-frequency"); 1009 prop = of_find_property(dp, "clock-frequency", NULL);
1008 } 1010 }
1009 } else { 1011 } else {
1010 tick_ops = &stick_operations; 1012 tick_ops = &stick_operations;
1011 node = prom_root_node; 1013 prop = of_find_property(dp, "stick-frequency", NULL);
1012 clock = prom_getint(node, "stick-frequency");
1013 } 1014 }
1015 clock = *(unsigned int *) prop->value;
1014 timer_tick_offset = clock / HZ; 1016 timer_tick_offset = clock / HZ;
1015 1017
1016#ifdef CONFIG_SMP 1018#ifdef CONFIG_SMP