diff options
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/of_device.c | 19 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_smp.c | 16 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_smp.c | 12 |
3 files changed, 32 insertions, 15 deletions
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c index cc4c235c4f59..c481d45f97b7 100644 --- a/arch/sparc/kernel/of_device.c +++ b/arch/sparc/kernel/of_device.c | |||
@@ -70,7 +70,7 @@ struct of_bus { | |||
70 | int *addrc, int *sizec); | 70 | int *addrc, int *sizec); |
71 | int (*map)(u32 *addr, const u32 *range, | 71 | int (*map)(u32 *addr, const u32 *range, |
72 | int na, int ns, int pna); | 72 | int na, int ns, int pna); |
73 | unsigned int (*get_flags)(const u32 *addr); | 73 | unsigned long (*get_flags)(const u32 *addr, unsigned long); |
74 | }; | 74 | }; |
75 | 75 | ||
76 | /* | 76 | /* |
@@ -130,8 +130,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, | |||
130 | return 0; | 130 | return 0; |
131 | } | 131 | } |
132 | 132 | ||
133 | static unsigned int of_bus_default_get_flags(const u32 *addr) | 133 | static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) |
134 | { | 134 | { |
135 | if (flags) | ||
136 | return flags; | ||
135 | return IORESOURCE_MEM; | 137 | return IORESOURCE_MEM; |
136 | } | 138 | } |
137 | 139 | ||
@@ -194,17 +196,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, | |||
194 | return 0; | 196 | return 0; |
195 | } | 197 | } |
196 | 198 | ||
197 | static unsigned int of_bus_pci_get_flags(const u32 *addr) | 199 | static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) |
198 | { | 200 | { |
199 | unsigned int flags = 0; | ||
200 | u32 w = addr[0]; | 201 | u32 w = addr[0]; |
201 | 202 | ||
203 | /* For PCI, we override whatever child busses may have used. */ | ||
204 | flags = 0; | ||
202 | switch((w >> 24) & 0x03) { | 205 | switch((w >> 24) & 0x03) { |
203 | case 0x01: | 206 | case 0x01: |
204 | flags |= IORESOURCE_IO; | 207 | flags |= IORESOURCE_IO; |
208 | break; | ||
209 | |||
205 | case 0x02: /* 32 bits */ | 210 | case 0x02: /* 32 bits */ |
206 | case 0x03: /* 64 bits */ | 211 | case 0x03: /* 64 bits */ |
207 | flags |= IORESOURCE_MEM; | 212 | flags |= IORESOURCE_MEM; |
213 | break; | ||
208 | } | 214 | } |
209 | if (w & 0x40000000) | 215 | if (w & 0x40000000) |
210 | flags |= IORESOURCE_PREFETCH; | 216 | flags |= IORESOURCE_PREFETCH; |
@@ -362,10 +368,11 @@ static void __init build_device_resources(struct of_device *op, | |||
362 | int pna, pns; | 368 | int pna, pns; |
363 | 369 | ||
364 | size = of_read_addr(reg + na, ns); | 370 | size = of_read_addr(reg + na, ns); |
365 | flags = bus->get_flags(reg); | ||
366 | 371 | ||
367 | memcpy(addr, reg, na * 4); | 372 | memcpy(addr, reg, na * 4); |
368 | 373 | ||
374 | flags = bus->get_flags(reg, 0); | ||
375 | |||
369 | /* If the immediate parent has no ranges property to apply, | 376 | /* If the immediate parent has no ranges property to apply, |
370 | * just use a 1<->1 mapping. | 377 | * just use a 1<->1 mapping. |
371 | */ | 378 | */ |
@@ -393,6 +400,8 @@ static void __init build_device_resources(struct of_device *op, | |||
393 | dna, dns, pna)) | 400 | dna, dns, pna)) |
394 | break; | 401 | break; |
395 | 402 | ||
403 | flags = pbus->get_flags(addr, flags); | ||
404 | |||
396 | dna = pna; | 405 | dna = pna; |
397 | dns = pns; | 406 | dns = pns; |
398 | dbus = pbus; | 407 | dbus = pbus; |
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index dfde77ff0848..69596402a500 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -262,8 +262,9 @@ static struct smp_funcall { | |||
262 | static DEFINE_SPINLOCK(cross_call_lock); | 262 | static DEFINE_SPINLOCK(cross_call_lock); |
263 | 263 | ||
264 | /* Cross calls must be serialized, at least currently. */ | 264 | /* Cross calls must be serialized, at least currently. */ |
265 | void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 265 | static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
266 | unsigned long arg3, unsigned long arg4, unsigned long arg5) | 266 | unsigned long arg2, unsigned long arg3, |
267 | unsigned long arg4) | ||
267 | { | 268 | { |
268 | if(smp_processors_ready) { | 269 | if(smp_processors_ready) { |
269 | register int high = smp_highest_cpu; | 270 | register int high = smp_highest_cpu; |
@@ -278,7 +279,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
278 | register unsigned long a2 asm("i2") = arg2; | 279 | register unsigned long a2 asm("i2") = arg2; |
279 | register unsigned long a3 asm("i3") = arg3; | 280 | register unsigned long a3 asm("i3") = arg3; |
280 | register unsigned long a4 asm("i4") = arg4; | 281 | register unsigned long a4 asm("i4") = arg4; |
281 | register unsigned long a5 asm("i5") = arg5; | 282 | register unsigned long a5 asm("i5") = 0; |
282 | 283 | ||
283 | __asm__ __volatile__( | 284 | __asm__ __volatile__( |
284 | "std %0, [%6]\n\t" | 285 | "std %0, [%6]\n\t" |
@@ -290,11 +291,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
290 | 291 | ||
291 | /* Init receive/complete mapping, plus fire the IPI's off. */ | 292 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
292 | { | 293 | { |
293 | cpumask_t mask; | ||
294 | register int i; | 294 | register int i; |
295 | 295 | ||
296 | mask = cpumask_of_cpu(hard_smp4d_processor_id()); | 296 | cpu_clear(smp_processor_id(), mask); |
297 | cpus_andnot(mask, cpu_online_map, mask); | 297 | cpus_and(mask, cpu_online_map, mask); |
298 | for(i = 0; i <= high; i++) { | 298 | for(i = 0; i <= high; i++) { |
299 | if (cpu_isset(i, mask)) { | 299 | if (cpu_isset(i, mask)) { |
300 | ccall_info.processors_in[i] = 0; | 300 | ccall_info.processors_in[i] = 0; |
@@ -309,12 +309,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
309 | 309 | ||
310 | i = 0; | 310 | i = 0; |
311 | do { | 311 | do { |
312 | if (!cpu_isset(i, mask)) | ||
313 | continue; | ||
312 | while(!ccall_info.processors_in[i]) | 314 | while(!ccall_info.processors_in[i]) |
313 | barrier(); | 315 | barrier(); |
314 | } while(++i <= high); | 316 | } while(++i <= high); |
315 | 317 | ||
316 | i = 0; | 318 | i = 0; |
317 | do { | 319 | do { |
320 | if (!cpu_isset(i, mask)) | ||
321 | continue; | ||
318 | while(!ccall_info.processors_out[i]) | 322 | while(!ccall_info.processors_out[i]) |
319 | barrier(); | 323 | barrier(); |
320 | } while(++i <= high); | 324 | } while(++i <= high); |
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 406ac1abc83a..a14a76ac7f36 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c | |||
@@ -244,9 +244,9 @@ static struct smp_funcall { | |||
244 | static DEFINE_SPINLOCK(cross_call_lock); | 244 | static DEFINE_SPINLOCK(cross_call_lock); |
245 | 245 | ||
246 | /* Cross calls must be serialized, at least currently. */ | 246 | /* Cross calls must be serialized, at least currently. */ |
247 | static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | 247 | static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
248 | unsigned long arg2, unsigned long arg3, | 248 | unsigned long arg2, unsigned long arg3, |
249 | unsigned long arg4, unsigned long arg5) | 249 | unsigned long arg4) |
250 | { | 250 | { |
251 | register int ncpus = SUN4M_NCPUS; | 251 | register int ncpus = SUN4M_NCPUS; |
252 | unsigned long flags; | 252 | unsigned long flags; |
@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | |||
259 | ccall_info.arg2 = arg2; | 259 | ccall_info.arg2 = arg2; |
260 | ccall_info.arg3 = arg3; | 260 | ccall_info.arg3 = arg3; |
261 | ccall_info.arg4 = arg4; | 261 | ccall_info.arg4 = arg4; |
262 | ccall_info.arg5 = arg5; | 262 | ccall_info.arg5 = 0; |
263 | 263 | ||
264 | /* Init receive/complete mapping, plus fire the IPI's off. */ | 264 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
265 | { | 265 | { |
266 | cpumask_t mask = cpu_online_map; | ||
267 | register int i; | 266 | register int i; |
268 | 267 | ||
269 | cpu_clear(smp_processor_id(), mask); | 268 | cpu_clear(smp_processor_id(), mask); |
269 | cpus_and(mask, cpu_online_map, mask); | ||
270 | for(i = 0; i < ncpus; i++) { | 270 | for(i = 0; i < ncpus; i++) { |
271 | if (cpu_isset(i, mask)) { | 271 | if (cpu_isset(i, mask)) { |
272 | ccall_info.processors_in[i] = 0; | 272 | ccall_info.processors_in[i] = 0; |
@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | |||
284 | 284 | ||
285 | i = 0; | 285 | i = 0; |
286 | do { | 286 | do { |
287 | if (!cpu_isset(i, mask)) | ||
288 | continue; | ||
287 | while(!ccall_info.processors_in[i]) | 289 | while(!ccall_info.processors_in[i]) |
288 | barrier(); | 290 | barrier(); |
289 | } while(++i < ncpus); | 291 | } while(++i < ncpus); |
290 | 292 | ||
291 | i = 0; | 293 | i = 0; |
292 | do { | 294 | do { |
295 | if (!cpu_isset(i, mask)) | ||
296 | continue; | ||
293 | while(!ccall_info.processors_out[i]) | 297 | while(!ccall_info.processors_out[i]) |
294 | barrier(); | 298 | barrier(); |
295 | } while(++i < ncpus); | 299 | } while(++i < ncpus); |