diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/smp.c')
-rw-r--r-- | arch/powerpc/platforms/cell/smp.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index 9046803c8276..bc97fada48c6 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <asm/prom.h> | 36 | #include <asm/prom.h> |
37 | #include <asm/smp.h> | 37 | #include <asm/smp.h> |
38 | #include <asm/paca.h> | 38 | #include <asm/paca.h> |
39 | #include <asm/time.h> | ||
40 | #include <asm/machdep.h> | 39 | #include <asm/machdep.h> |
41 | #include <asm/cputable.h> | 40 | #include <asm/cputable.h> |
42 | #include <asm/firmware.h> | 41 | #include <asm/firmware.h> |
@@ -140,31 +139,6 @@ static void __devinit smp_cell_setup_cpu(int cpu) | |||
140 | mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER); | 139 | mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER); |
141 | } | 140 | } |
142 | 141 | ||
143 | static DEFINE_SPINLOCK(timebase_lock); | ||
144 | static unsigned long timebase = 0; | ||
145 | |||
146 | static void __devinit cell_give_timebase(void) | ||
147 | { | ||
148 | spin_lock(&timebase_lock); | ||
149 | rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL); | ||
150 | timebase = get_tb(); | ||
151 | spin_unlock(&timebase_lock); | ||
152 | |||
153 | while (timebase) | ||
154 | barrier(); | ||
155 | rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL); | ||
156 | } | ||
157 | |||
158 | static void __devinit cell_take_timebase(void) | ||
159 | { | ||
160 | while (!timebase) | ||
161 | barrier(); | ||
162 | spin_lock(&timebase_lock); | ||
163 | set_tb(timebase >> 32, timebase & 0xffffffff); | ||
164 | timebase = 0; | ||
165 | spin_unlock(&timebase_lock); | ||
166 | } | ||
167 | |||
168 | static void __devinit smp_cell_kick_cpu(int nr) | 142 | static void __devinit smp_cell_kick_cpu(int nr) |
169 | { | 143 | { |
170 | BUG_ON(nr < 0 || nr >= NR_CPUS); | 144 | BUG_ON(nr < 0 || nr >= NR_CPUS); |
@@ -224,8 +198,8 @@ void __init smp_init_cell(void) | |||
224 | 198 | ||
225 | /* Non-lpar has additional take/give timebase */ | 199 | /* Non-lpar has additional take/give timebase */ |
226 | if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { | 200 | if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { |
227 | smp_ops->give_timebase = cell_give_timebase; | 201 | smp_ops->give_timebase = rtas_give_timebase; |
228 | smp_ops->take_timebase = cell_take_timebase; | 202 | smp_ops->take_timebase = rtas_take_timebase; |
229 | } | 203 | } |
230 | 204 | ||
231 | DBG(" <- smp_init_cell()\n"); | 205 | DBG(" <- smp_init_cell()\n"); |