diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-08 18:39:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-08 18:39:30 -0400 |
commit | 98d86c091534f35c4bab294451ae6bccab8e9075 (patch) | |
tree | 98c9f0b80bb078405cf173f1d5cc91c72e77082d /arch/sparc/kernel | |
parent | d875a4b0ffad754e6d89fa561ea7dcdd79c9508b (diff) | |
parent | 4d084617fb0d025c42c242362d1f27d337e2d407 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts:
arch/sparc/kernel/of_device.c
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 4ef160755881..c88af7efc335 100644 --- a/arch/sparc/kernel/of_device.c +++ b/arch/sparc/kernel/of_device.c | |||
@@ -93,7 +93,7 @@ struct of_bus { | |||
93 | int *addrc, int *sizec); | 93 | int *addrc, int *sizec); |
94 | int (*map)(u32 *addr, const u32 *range, | 94 | int (*map)(u32 *addr, const u32 *range, |
95 | int na, int ns, int pna); | 95 | int na, int ns, int pna); |
96 | unsigned int (*get_flags)(const u32 *addr); | 96 | unsigned long (*get_flags)(const u32 *addr, unsigned long); |
97 | }; | 97 | }; |
98 | 98 | ||
99 | /* | 99 | /* |
@@ -153,8 +153,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, | |||
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
155 | 155 | ||
156 | static unsigned int of_bus_default_get_flags(const u32 *addr) | 156 | static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) |
157 | { | 157 | { |
158 | if (flags) | ||
159 | return flags; | ||
158 | return IORESOURCE_MEM; | 160 | return IORESOURCE_MEM; |
159 | } | 161 | } |
160 | 162 | ||
@@ -217,17 +219,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, | |||
217 | return 0; | 219 | return 0; |
218 | } | 220 | } |
219 | 221 | ||
220 | static unsigned int of_bus_pci_get_flags(const u32 *addr) | 222 | static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) |
221 | { | 223 | { |
222 | unsigned int flags = 0; | ||
223 | u32 w = addr[0]; | 224 | u32 w = addr[0]; |
224 | 225 | ||
226 | /* For PCI, we override whatever child busses may have used. */ | ||
227 | flags = 0; | ||
225 | switch((w >> 24) & 0x03) { | 228 | switch((w >> 24) & 0x03) { |
226 | case 0x01: | 229 | case 0x01: |
227 | flags |= IORESOURCE_IO; | 230 | flags |= IORESOURCE_IO; |
231 | break; | ||
232 | |||
228 | case 0x02: /* 32 bits */ | 233 | case 0x02: /* 32 bits */ |
229 | case 0x03: /* 64 bits */ | 234 | case 0x03: /* 64 bits */ |
230 | flags |= IORESOURCE_MEM; | 235 | flags |= IORESOURCE_MEM; |
236 | break; | ||
231 | } | 237 | } |
232 | if (w & 0x40000000) | 238 | if (w & 0x40000000) |
233 | flags |= IORESOURCE_PREFETCH; | 239 | flags |= IORESOURCE_PREFETCH; |
@@ -406,10 +412,11 @@ static void __init build_device_resources(struct of_device *op, | |||
406 | int pna, pns; | 412 | int pna, pns; |
407 | 413 | ||
408 | size = of_read_addr(reg + na, ns); | 414 | size = of_read_addr(reg + na, ns); |
409 | flags = bus->get_flags(reg); | ||
410 | 415 | ||
411 | memcpy(addr, reg, na * 4); | 416 | memcpy(addr, reg, na * 4); |
412 | 417 | ||
418 | flags = bus->get_flags(reg, 0); | ||
419 | |||
413 | if (use_1to1_mapping(pp)) { | 420 | if (use_1to1_mapping(pp)) { |
414 | result = of_read_addr(addr, na); | 421 | result = of_read_addr(addr, na); |
415 | goto build_res; | 422 | goto build_res; |
@@ -434,6 +441,8 @@ static void __init build_device_resources(struct of_device *op, | |||
434 | dna, dns, pna)) | 441 | dna, dns, pna)) |
435 | break; | 442 | break; |
436 | 443 | ||
444 | flags = pbus->get_flags(addr, flags); | ||
445 | |||
437 | dna = pna; | 446 | dna = pna; |
438 | dns = pns; | 447 | dns = pns; |
439 | dbus = pbus; | 448 | dbus = pbus; |
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index bf7147a9308e..72fa8daab60b 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -261,8 +261,9 @@ static struct smp_funcall { | |||
261 | static DEFINE_SPINLOCK(cross_call_lock); | 261 | static DEFINE_SPINLOCK(cross_call_lock); |
262 | 262 | ||
263 | /* Cross calls must be serialized, at least currently. */ | 263 | /* Cross calls must be serialized, at least currently. */ |
264 | void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 264 | static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
265 | unsigned long arg3, unsigned long arg4, unsigned long arg5) | 265 | unsigned long arg2, unsigned long arg3, |
266 | unsigned long arg4) | ||
266 | { | 267 | { |
267 | if(smp_processors_ready) { | 268 | if(smp_processors_ready) { |
268 | register int high = smp_highest_cpu; | 269 | register int high = smp_highest_cpu; |
@@ -277,7 +278,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
277 | register unsigned long a2 asm("i2") = arg2; | 278 | register unsigned long a2 asm("i2") = arg2; |
278 | register unsigned long a3 asm("i3") = arg3; | 279 | register unsigned long a3 asm("i3") = arg3; |
279 | register unsigned long a4 asm("i4") = arg4; | 280 | register unsigned long a4 asm("i4") = arg4; |
280 | register unsigned long a5 asm("i5") = arg5; | 281 | register unsigned long a5 asm("i5") = 0; |
281 | 282 | ||
282 | __asm__ __volatile__( | 283 | __asm__ __volatile__( |
283 | "std %0, [%6]\n\t" | 284 | "std %0, [%6]\n\t" |
@@ -289,11 +290,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
289 | 290 | ||
290 | /* Init receive/complete mapping, plus fire the IPI's off. */ | 291 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
291 | { | 292 | { |
292 | cpumask_t mask; | ||
293 | register int i; | 293 | register int i; |
294 | 294 | ||
295 | mask = cpumask_of_cpu(hard_smp4d_processor_id()); | 295 | cpu_clear(smp_processor_id(), mask); |
296 | cpus_andnot(mask, cpu_online_map, mask); | 296 | cpus_and(mask, cpu_online_map, mask); |
297 | for(i = 0; i <= high; i++) { | 297 | for(i = 0; i <= high; i++) { |
298 | if (cpu_isset(i, mask)) { | 298 | if (cpu_isset(i, mask)) { |
299 | ccall_info.processors_in[i] = 0; | 299 | ccall_info.processors_in[i] = 0; |
@@ -308,12 +308,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
308 | 308 | ||
309 | i = 0; | 309 | i = 0; |
310 | do { | 310 | do { |
311 | if (!cpu_isset(i, mask)) | ||
312 | continue; | ||
311 | while(!ccall_info.processors_in[i]) | 313 | while(!ccall_info.processors_in[i]) |
312 | barrier(); | 314 | barrier(); |
313 | } while(++i <= high); | 315 | } while(++i <= high); |
314 | 316 | ||
315 | i = 0; | 317 | i = 0; |
316 | do { | 318 | do { |
319 | if (!cpu_isset(i, mask)) | ||
320 | continue; | ||
317 | while(!ccall_info.processors_out[i]) | 321 | while(!ccall_info.processors_out[i]) |
318 | barrier(); | 322 | barrier(); |
319 | } while(++i <= high); | 323 | } 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); |