diff options
41 files changed, 418 insertions, 172 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index e9a3cb1d6b06..7327f37d78f3 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -711,13 +711,14 @@ define a bus type with a more complex address format, including things | |||
711 | like address space bits, you'll have to add a bus translator to the | 711 | like address space bits, you'll have to add a bus translator to the |
712 | prom_parse.c file of the recent kernels for your bus type. | 712 | prom_parse.c file of the recent kernels for your bus type. |
713 | 713 | ||
714 | The "reg" property only defines addresses and sizes (if #size-cells | 714 | The "reg" property only defines addresses and sizes (if #size-cells is |
715 | is non-0) within a given bus. In order to translate addresses upward | 715 | non-0) within a given bus. In order to translate addresses upward |
716 | (that is into parent bus addresses, and possibly into CPU physical | 716 | (that is into parent bus addresses, and possibly into CPU physical |
717 | addresses), all busses must contain a "ranges" property. If the | 717 | addresses), all busses must contain a "ranges" property. If the |
718 | "ranges" property is missing at a given level, it's assumed that | 718 | "ranges" property is missing at a given level, it's assumed that |
719 | translation isn't possible. The format of the "ranges" property for a | 719 | translation isn't possible, i.e., the registers are not visible on the |
720 | bus is a list of: | 720 | parent bus. The format of the "ranges" property for a bus is a list |
721 | of: | ||
721 | 722 | ||
722 | bus address, parent bus address, size | 723 | bus address, parent bus address, size |
723 | 724 | ||
@@ -735,6 +736,10 @@ fit in a single 32-bit word. New 32-bit powerpc boards should use a | |||
735 | 1/1 format, unless the processor supports physical addresses greater | 736 | 1/1 format, unless the processor supports physical addresses greater |
736 | than 32-bits, in which case a 2/1 format is recommended. | 737 | than 32-bits, in which case a 2/1 format is recommended. |
737 | 738 | ||
739 | Alternatively, the "ranges" property may be empty, indicating that the | ||
740 | registers are visible on the parent bus using an identity mapping | ||
741 | translation. In other words, the parent bus address space is the same | ||
742 | as the child bus address space. | ||
738 | 743 | ||
739 | 2) Note about "compatible" properties | 744 | 2) Note about "compatible" properties |
740 | ------------------------------------- | 745 | ------------------------------------- |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index bd87626c1f60..f70df9b64f8f 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -167,6 +167,9 @@ boot := arch/$(ARCH)/boot | |||
167 | $(BOOT_TARGETS): vmlinux | 167 | $(BOOT_TARGETS): vmlinux |
168 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 168 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
169 | 169 | ||
170 | bootwrapper_install: | ||
171 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | ||
172 | |||
170 | define archhelp | 173 | define archhelp |
171 | @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' | 174 | @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' |
172 | @echo ' install - Install kernel using' | 175 | @echo ' install - Install kernel using' |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 18e32719d0ed..e1c73e9afa59 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -243,3 +243,51 @@ clean-kernel := vmlinux.strip vmlinux.bin | |||
243 | clean-kernel += $(addsuffix .gz,$(clean-kernel)) | 243 | clean-kernel += $(addsuffix .gz,$(clean-kernel)) |
244 | # If not absolute clean-files are relative to $(obj). | 244 | # If not absolute clean-files are relative to $(obj). |
245 | clean-files += $(addprefix $(objtree)/, $(clean-kernel)) | 245 | clean-files += $(addprefix $(objtree)/, $(clean-kernel)) |
246 | |||
247 | WRAPPER_OBJDIR := /usr/lib/kernel-wrapper | ||
248 | WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts | ||
249 | WRAPPER_BINDIR := /usr/sbin | ||
250 | INSTALL := install | ||
251 | |||
252 | extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) | ||
253 | hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) | ||
254 | wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper | ||
255 | dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts)) | ||
256 | |||
257 | all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) | ||
258 | |||
259 | quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) | ||
260 | cmd_mkdir = mkdir -p $@ | ||
261 | |||
262 | quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@) | ||
263 | cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@ | ||
264 | |||
265 | quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@) | ||
266 | cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@ | ||
267 | |||
268 | quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) | ||
269 | cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@ | ||
270 | |||
271 | quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) | ||
272 | cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\ | ||
273 | sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \ | ||
274 | -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \ | ||
275 | |||
276 | |||
277 | $(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR): | ||
278 | $(call cmd,mkdir) | ||
279 | |||
280 | $(extra-installed) : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR) | ||
281 | $(call cmd,install) | ||
282 | |||
283 | $(hostprogs-installed) : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR) | ||
284 | $(call cmd,install_exe) | ||
285 | |||
286 | $(dts-installed) : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR) | ||
287 | $(call cmd,install_dts) | ||
288 | |||
289 | $(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR) | ||
290 | $(call cmd,install_wrapper) | ||
291 | |||
292 | $(obj)/bootwrapper_install: $(all-installed) | ||
293 | |||
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 31147a037728..a591ced47875 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -45,6 +45,7 @@ CROSS= | |||
45 | 45 | ||
46 | # directory for object and other files used by this script | 46 | # directory for object and other files used by this script |
47 | object=arch/powerpc/boot | 47 | object=arch/powerpc/boot |
48 | objbin=$object | ||
48 | 49 | ||
49 | # directory for working files | 50 | # directory for working files |
50 | tmpdir=. | 51 | tmpdir=. |
@@ -95,6 +96,7 @@ while [ "$#" -gt 0 ]; do | |||
95 | shift | 96 | shift |
96 | [ "$#" -gt 0 ] || usage | 97 | [ "$#" -gt 0 ] || usage |
97 | object="$1" | 98 | object="$1" |
99 | objbin="$1" | ||
98 | ;; | 100 | ;; |
99 | -W) | 101 | -W) |
100 | shift | 102 | shift |
@@ -116,6 +118,9 @@ while [ "$#" -gt 0 ]; do | |||
116 | done | 118 | done |
117 | 119 | ||
118 | if [ -n "$dts" ]; then | 120 | if [ -n "$dts" ]; then |
121 | if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then | ||
122 | dts="$object/dts/$dts" | ||
123 | fi | ||
119 | if [ -z "$dtb" ]; then | 124 | if [ -z "$dtb" ]; then |
120 | dtb="$platform.dtb" | 125 | dtb="$platform.dtb" |
121 | fi | 126 | fi |
@@ -246,11 +251,11 @@ fi | |||
246 | # post-processing needed for some platforms | 251 | # post-processing needed for some platforms |
247 | case "$platform" in | 252 | case "$platform" in |
248 | pseries|chrp) | 253 | pseries|chrp) |
249 | $object/addnote "$ofile" | 254 | $objbin/addnote "$ofile" |
250 | ;; | 255 | ;; |
251 | coff) | 256 | coff) |
252 | ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" | 257 | ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" |
253 | $object/hack-coff "$ofile" | 258 | $objbin/hack-coff "$ofile" |
254 | ;; | 259 | ;; |
255 | cuboot*) | 260 | cuboot*) |
256 | gzip -f -9 "$ofile" | 261 | gzip -f -9 "$ofile" |
@@ -259,7 +264,7 @@ cuboot*) | |||
259 | ;; | 264 | ;; |
260 | treeboot*) | 265 | treeboot*) |
261 | mv "$ofile" "$ofile.elf" | 266 | mv "$ofile" "$ofile.elf" |
262 | $object/mktree "$ofile.elf" "$ofile" "$base" "$entry" | 267 | $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry" |
263 | if [ -z "$cacheit" ]; then | 268 | if [ -z "$cacheit" ]; then |
264 | rm -f "$ofile.elf" | 269 | rm -f "$ofile.elf" |
265 | fi | 270 | fi |
@@ -287,8 +292,6 @@ ps3) | |||
287 | overlay_dest="256" | 292 | overlay_dest="256" |
288 | overlay_size="256" | 293 | overlay_size="256" |
289 | 294 | ||
290 | rm -f "$object/otheros.bld" | ||
291 | |||
292 | ${CROSS}objcopy -O binary "$ofile" "$ofile.bin" | 295 | ${CROSS}objcopy -O binary "$ofile" "$ofile.bin" |
293 | 296 | ||
294 | dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ | 297 | dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ |
@@ -299,6 +302,8 @@ ps3) | |||
299 | skip=$system_reset_overlay seek=$overlay_dest \ | 302 | skip=$system_reset_overlay seek=$overlay_dest \ |
300 | count=$overlay_size bs=1 | 303 | count=$overlay_size bs=1 |
301 | 304 | ||
302 | gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" | 305 | odir="$(dirname "$ofile.bin")" |
306 | rm -f "$odir/otheros.bld" | ||
307 | gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld" | ||
303 | ;; | 308 | ;; |
304 | esac | 309 | esac |
diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c index f0f49d1be3d5..965bfcc9ad2d 100644 --- a/arch/powerpc/kernel/isa-bridge.c +++ b/arch/powerpc/kernel/isa-bridge.c | |||
@@ -108,7 +108,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, | |||
108 | if (size > 0x10000) | 108 | if (size > 0x10000) |
109 | size = 0x10000; | 109 | size = 0x10000; |
110 | 110 | ||
111 | printk(KERN_ERR "no ISA IO ranges or unexpected isa range," | 111 | printk(KERN_ERR "no ISA IO ranges or unexpected isa range, " |
112 | "mapping 64k\n"); | 112 | "mapping 64k\n"); |
113 | 113 | ||
114 | __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, | 114 | __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, |
@@ -116,7 +116,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, | |||
116 | return; | 116 | return; |
117 | 117 | ||
118 | inval_range: | 118 | inval_range: |
119 | printk(KERN_ERR "no ISA IO ranges or unexpected isa range," | 119 | printk(KERN_ERR "no ISA IO ranges or unexpected isa range, " |
120 | "mapping 64k\n"); | 120 | "mapping 64k\n"); |
121 | __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, | 121 | __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, |
122 | 0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED); | 122 | 0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 2ae3b6f778a3..15ec71a84f78 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -48,9 +48,7 @@ | |||
48 | static DEFINE_SPINLOCK(hose_spinlock); | 48 | static DEFINE_SPINLOCK(hose_spinlock); |
49 | 49 | ||
50 | /* XXX kill that some day ... */ | 50 | /* XXX kill that some day ... */ |
51 | int global_phb_number; /* Global phb counter */ | 51 | static int global_phb_number; /* Global phb counter */ |
52 | |||
53 | extern struct list_head hose_list; | ||
54 | 52 | ||
55 | /* | 53 | /* |
56 | * pci_controller(phb) initialized common variables. | 54 | * pci_controller(phb) initialized common variables. |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2de00f870edc..6adb5a1e98bb 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/serial.h> | 33 | #include <linux/serial.h> |
34 | #include <linux/serial_8250.h> | 34 | #include <linux/serial_8250.h> |
35 | #include <linux/debugfs.h> | 35 | #include <linux/debugfs.h> |
36 | #include <linux/percpu.h> | ||
36 | #include <asm/io.h> | 37 | #include <asm/io.h> |
37 | #include <asm/prom.h> | 38 | #include <asm/prom.h> |
38 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
@@ -57,6 +58,7 @@ | |||
57 | #include <asm/mmu.h> | 58 | #include <asm/mmu.h> |
58 | #include <asm/lmb.h> | 59 | #include <asm/lmb.h> |
59 | #include <asm/xmon.h> | 60 | #include <asm/xmon.h> |
61 | #include <asm/cputhreads.h> | ||
60 | 62 | ||
61 | #include "setup.h" | 63 | #include "setup.h" |
62 | 64 | ||
@@ -327,6 +329,31 @@ void __init check_for_initrd(void) | |||
327 | 329 | ||
328 | #ifdef CONFIG_SMP | 330 | #ifdef CONFIG_SMP |
329 | 331 | ||
332 | int threads_per_core, threads_shift; | ||
333 | cpumask_t threads_core_mask; | ||
334 | |||
335 | static void __init cpu_init_thread_core_maps(int tpc) | ||
336 | { | ||
337 | int i; | ||
338 | |||
339 | threads_per_core = tpc; | ||
340 | threads_core_mask = CPU_MASK_NONE; | ||
341 | |||
342 | /* This implementation only supports power of 2 number of threads | ||
343 | * for simplicity and performance | ||
344 | */ | ||
345 | threads_shift = ilog2(tpc); | ||
346 | BUG_ON(tpc != (1 << threads_shift)); | ||
347 | |||
348 | for (i = 0; i < tpc; i++) | ||
349 | cpu_set(i, threads_core_mask); | ||
350 | |||
351 | printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n", | ||
352 | tpc, tpc > 1 ? "s" : ""); | ||
353 | printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift); | ||
354 | } | ||
355 | |||
356 | |||
330 | /** | 357 | /** |
331 | * setup_cpu_maps - initialize the following cpu maps: | 358 | * setup_cpu_maps - initialize the following cpu maps: |
332 | * cpu_possible_map | 359 | * cpu_possible_map |
@@ -350,22 +377,32 @@ void __init smp_setup_cpu_maps(void) | |||
350 | { | 377 | { |
351 | struct device_node *dn = NULL; | 378 | struct device_node *dn = NULL; |
352 | int cpu = 0; | 379 | int cpu = 0; |
380 | int nthreads = 1; | ||
381 | |||
382 | DBG("smp_setup_cpu_maps()\n"); | ||
353 | 383 | ||
354 | while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { | 384 | while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { |
355 | const int *intserv; | 385 | const int *intserv; |
356 | int j, len = sizeof(u32), nthreads = 1; | 386 | int j, len; |
387 | |||
388 | DBG(" * %s...\n", dn->full_name); | ||
357 | 389 | ||
358 | intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", | 390 | intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", |
359 | &len); | 391 | &len); |
360 | if (intserv) | 392 | if (intserv) { |
361 | nthreads = len / sizeof(int); | 393 | nthreads = len / sizeof(int); |
362 | else { | 394 | DBG(" ibm,ppc-interrupt-server#s -> %d threads\n", |
395 | nthreads); | ||
396 | } else { | ||
397 | DBG(" no ibm,ppc-interrupt-server#s -> 1 thread\n"); | ||
363 | intserv = of_get_property(dn, "reg", NULL); | 398 | intserv = of_get_property(dn, "reg", NULL); |
364 | if (!intserv) | 399 | if (!intserv) |
365 | intserv = &cpu; /* assume logical == phys */ | 400 | intserv = &cpu; /* assume logical == phys */ |
366 | } | 401 | } |
367 | 402 | ||
368 | for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { | 403 | for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { |
404 | DBG(" thread %d -> cpu %d (hard id %d)\n", | ||
405 | j, cpu, intserv[j]); | ||
369 | cpu_set(cpu, cpu_present_map); | 406 | cpu_set(cpu, cpu_present_map); |
370 | set_hard_smp_processor_id(cpu, intserv[j]); | 407 | set_hard_smp_processor_id(cpu, intserv[j]); |
371 | cpu_set(cpu, cpu_possible_map); | 408 | cpu_set(cpu, cpu_possible_map); |
@@ -373,6 +410,12 @@ void __init smp_setup_cpu_maps(void) | |||
373 | } | 410 | } |
374 | } | 411 | } |
375 | 412 | ||
413 | /* If no SMT supported, nthreads is forced to 1 */ | ||
414 | if (!cpu_has_feature(CPU_FTR_SMT)) { | ||
415 | DBG(" SMT disabled ! nthreads forced to 1\n"); | ||
416 | nthreads = 1; | ||
417 | } | ||
418 | |||
376 | #ifdef CONFIG_PPC64 | 419 | #ifdef CONFIG_PPC64 |
377 | /* | 420 | /* |
378 | * On pSeries LPAR, we need to know how many cpus | 421 | * On pSeries LPAR, we need to know how many cpus |
@@ -395,7 +438,7 @@ void __init smp_setup_cpu_maps(void) | |||
395 | 438 | ||
396 | /* Double maxcpus for processors which have SMT capability */ | 439 | /* Double maxcpus for processors which have SMT capability */ |
397 | if (cpu_has_feature(CPU_FTR_SMT)) | 440 | if (cpu_has_feature(CPU_FTR_SMT)) |
398 | maxcpus *= 2; | 441 | maxcpus *= nthreads; |
399 | 442 | ||
400 | if (maxcpus > NR_CPUS) { | 443 | if (maxcpus > NR_CPUS) { |
401 | printk(KERN_WARNING | 444 | printk(KERN_WARNING |
@@ -412,9 +455,16 @@ void __init smp_setup_cpu_maps(void) | |||
412 | out: | 455 | out: |
413 | of_node_put(dn); | 456 | of_node_put(dn); |
414 | } | 457 | } |
415 | |||
416 | vdso_data->processorCount = num_present_cpus(); | 458 | vdso_data->processorCount = num_present_cpus(); |
417 | #endif /* CONFIG_PPC64 */ | 459 | #endif /* CONFIG_PPC64 */ |
460 | |||
461 | /* Initialize CPU <=> thread mapping/ | ||
462 | * | ||
463 | * WARNING: We assume that the number of threads is the same for | ||
464 | * every CPU in the system. If that is not the case, then some code | ||
465 | * here will have to be reworked | ||
466 | */ | ||
467 | cpu_init_thread_core_maps(nthreads); | ||
418 | } | 468 | } |
419 | 469 | ||
420 | /* | 470 | /* |
@@ -424,17 +474,19 @@ void __init smp_setup_cpu_maps(void) | |||
424 | */ | 474 | */ |
425 | void __init smp_setup_cpu_sibling_map(void) | 475 | void __init smp_setup_cpu_sibling_map(void) |
426 | { | 476 | { |
427 | #if defined(CONFIG_PPC64) | 477 | #ifdef CONFIG_PPC64 |
428 | int cpu; | 478 | int i, cpu, base; |
429 | 479 | ||
430 | /* | ||
431 | * Do the sibling map; assume only two threads per processor. | ||
432 | */ | ||
433 | for_each_possible_cpu(cpu) { | 480 | for_each_possible_cpu(cpu) { |
434 | cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); | 481 | DBG("Sibling map for CPU %d:", cpu); |
435 | if (cpu_has_feature(CPU_FTR_SMT)) | 482 | base = cpu_first_thread_in_core(cpu); |
436 | cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu)); | 483 | for (i = 0; i < threads_per_core; i++) { |
484 | cpu_set(base + i, per_cpu(cpu_sibling_map, cpu)); | ||
485 | DBG(" %d", base + i); | ||
486 | } | ||
487 | DBG("\n"); | ||
437 | } | 488 | } |
489 | |||
438 | #endif /* CONFIG_PPC64 */ | 490 | #endif /* CONFIG_PPC64 */ |
439 | } | 491 | } |
440 | #endif /* CONFIG_SMP */ | 492 | #endif /* CONFIG_SMP */ |
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 8135da06e0a4..10dda224a361 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -189,7 +189,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address, | |||
189 | return SIGSEGV; | 189 | return SIGSEGV; |
190 | /* in_atomic() in user mode is really bad, | 190 | /* in_atomic() in user mode is really bad, |
191 | as is current->mm == NULL. */ | 191 | as is current->mm == NULL. */ |
192 | printk(KERN_EMERG "Page fault in user mode with" | 192 | printk(KERN_EMERG "Page fault in user mode with " |
193 | "in_atomic() = %d mm = %p\n", in_atomic(), mm); | 193 | "in_atomic() = %d mm = %p\n", in_atomic(), mm); |
194 | printk(KERN_EMERG "NIP = %lx MSR = %lx\n", | 194 | printk(KERN_EMERG "NIP = %lx MSR = %lx\n", |
195 | regs->nip, regs->msr); | 195 | regs->nip, regs->msr); |
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index d35eda80e9e6..ba645c2b63f6 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -120,7 +120,7 @@ void __init mpc8xx_calibrate_decr(void) | |||
120 | ppc_tb_freq /= 16; | 120 | ppc_tb_freq /= 16; |
121 | ppc_proc_freq = 50000000; | 121 | ppc_proc_freq = 50000000; |
122 | if (!get_freq("clock-frequency", &ppc_proc_freq)) | 122 | if (!get_freq("clock-frequency", &ppc_proc_freq)) |
123 | printk(KERN_ERR "WARNING: Estimating processor frequency" | 123 | printk(KERN_ERR "WARNING: Estimating processor frequency " |
124 | "(not found)\n"); | 124 | "(not found)\n"); |
125 | 125 | ||
126 | printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); | 126 | printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); |
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index e4438456c867..efb3964457b1 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/firmware.h> | 42 | #include <asm/firmware.h> |
43 | #include <asm/system.h> | 43 | #include <asm/system.h> |
44 | #include <asm/rtas.h> | 44 | #include <asm/rtas.h> |
45 | #include <asm/cputhreads.h> | ||
45 | 46 | ||
46 | #include "interrupt.h" | 47 | #include "interrupt.h" |
47 | #include <asm/udbg.h> | 48 | #include <asm/udbg.h> |
@@ -182,7 +183,7 @@ static int smp_cell_cpu_bootable(unsigned int nr) | |||
182 | */ | 183 | */ |
183 | if (system_state < SYSTEM_RUNNING && | 184 | if (system_state < SYSTEM_RUNNING && |
184 | cpu_has_feature(CPU_FTR_SMT) && | 185 | cpu_has_feature(CPU_FTR_SMT) && |
185 | !smt_enabled_at_boot && nr % 2 != 0) | 186 | !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) |
186 | return 0; | 187 | return 0; |
187 | 188 | ||
188 | return 1; | 189 | return 1; |
diff --git a/arch/powerpc/platforms/celleb/io-workarounds.c b/arch/powerpc/platforms/celleb/io-workarounds.c index 2b912140bcbb..32b9cecfda15 100644 --- a/arch/powerpc/platforms/celleb/io-workarounds.c +++ b/arch/powerpc/platforms/celleb/io-workarounds.c | |||
@@ -256,7 +256,7 @@ int __init celleb_pci_workaround_init(void) | |||
256 | 256 | ||
257 | celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL); | 257 | celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL); |
258 | if (!celleb_dummy_page_va) { | 258 | if (!celleb_dummy_page_va) { |
259 | printk(KERN_ERR "Celleb: dummy read disabled." | 259 | printk(KERN_ERR "Celleb: dummy read disabled. " |
260 | "Alloc celleb_dummy_page_va failed\n"); | 260 | "Alloc celleb_dummy_page_va failed\n"); |
261 | return 1; | 261 | return 1; |
262 | } | 262 | } |
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c index 6bc32fda7a6b..13ec4a606b96 100644 --- a/arch/powerpc/platforms/celleb/pci.c +++ b/arch/powerpc/platforms/celleb/pci.c | |||
@@ -138,8 +138,6 @@ static void celleb_config_read_fake(unsigned char *config, int where, | |||
138 | *val = celleb_fake_config_readl(p); | 138 | *val = celleb_fake_config_readl(p); |
139 | break; | 139 | break; |
140 | } | 140 | } |
141 | |||
142 | return; | ||
143 | } | 141 | } |
144 | 142 | ||
145 | static void celleb_config_write_fake(unsigned char *config, int where, | 143 | static void celleb_config_write_fake(unsigned char *config, int where, |
@@ -158,7 +156,6 @@ static void celleb_config_write_fake(unsigned char *config, int where, | |||
158 | celleb_fake_config_writel(val, p); | 156 | celleb_fake_config_writel(val, p); |
159 | break; | 157 | break; |
160 | } | 158 | } |
161 | return; | ||
162 | } | 159 | } |
163 | 160 | ||
164 | static int celleb_fake_pci_read_config(struct pci_bus *bus, | 161 | static int celleb_fake_pci_read_config(struct pci_bus *bus, |
@@ -351,6 +348,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, | |||
351 | wi1 = of_get_property(node, "vendor-id", NULL); | 348 | wi1 = of_get_property(node, "vendor-id", NULL); |
352 | wi2 = of_get_property(node, "class-code", NULL); | 349 | wi2 = of_get_property(node, "class-code", NULL); |
353 | wi3 = of_get_property(node, "revision-id", NULL); | 350 | wi3 = of_get_property(node, "revision-id", NULL); |
351 | if (!wi0 || !wi1 || !wi2 || !wi3) { | ||
352 | printk(KERN_ERR "PCI: Missing device tree properties.\n"); | ||
353 | goto error; | ||
354 | } | ||
354 | 355 | ||
355 | celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff); | 356 | celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff); |
356 | celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff); | 357 | celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff); |
@@ -372,6 +373,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, | |||
372 | celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr); | 373 | celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr); |
373 | 374 | ||
374 | li = of_get_property(node, "interrupts", &rlen); | 375 | li = of_get_property(node, "interrupts", &rlen); |
376 | if (!li) { | ||
377 | printk(KERN_ERR "PCI: interrupts not found.\n"); | ||
378 | goto error; | ||
379 | } | ||
375 | val = li[0]; | 380 | val = li[0]; |
376 | celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1); | 381 | celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1); |
377 | celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val); | 382 | celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val); |
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c index 9d076426676c..a3c7cfbcb323 100644 --- a/arch/powerpc/platforms/celleb/scc_epci.c +++ b/arch/powerpc/platforms/celleb/scc_epci.c | |||
@@ -95,7 +95,7 @@ void __init epci_workaround_init(struct pci_controller *hose) | |||
95 | private->dummy_page_da = dma_map_single(hose->parent, | 95 | private->dummy_page_da = dma_map_single(hose->parent, |
96 | celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE); | 96 | celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE); |
97 | if (private->dummy_page_da == DMA_ERROR_CODE) { | 97 | if (private->dummy_page_da == DMA_ERROR_CODE) { |
98 | printk(KERN_ERR "EPCI: dummy read disabled." | 98 | printk(KERN_ERR "EPCI: dummy read disabled. " |
99 | "Map dummy page failed.\n"); | 99 | "Map dummy page failed.\n"); |
100 | return; | 100 | return; |
101 | } | 101 | } |
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index b6de2b5223dd..ce91787f3c7c 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/serial.h> | 26 | #include <linux/serial.h> |
27 | #include <linux/tty.h> | 27 | #include <linux/tty.h> |
28 | #include <linux/serial_core.h> | 28 | #include <linux/serial_core.h> |
29 | #include <linux/of_platform.h> | ||
29 | 30 | ||
30 | #include <asm/system.h> | 31 | #include <asm/system.h> |
31 | #include <asm/time.h> | 32 | #include <asm/time.h> |
@@ -39,7 +40,6 @@ | |||
39 | #include <asm/tsi108_irq.h> | 40 | #include <asm/tsi108_irq.h> |
40 | #include <asm/tsi108_pci.h> | 41 | #include <asm/tsi108_pci.h> |
41 | #include <asm/mpic.h> | 42 | #include <asm/mpic.h> |
42 | #include <asm/of_platform.h> | ||
43 | 43 | ||
44 | #undef DEBUG | 44 | #undef DEBUG |
45 | 45 | ||
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index da87162000f0..a74d1e1966dd 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -87,7 +87,7 @@ static DEFINE_SPINLOCK(iomm_table_lock); | |||
87 | * - CurrentIndex is incremented to keep track of the last entry. | 87 | * - CurrentIndex is incremented to keep track of the last entry. |
88 | * - Builds the resource entry for allocated BARs. | 88 | * - Builds the resource entry for allocated BARs. |
89 | */ | 89 | */ |
90 | static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) | 90 | static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) |
91 | { | 91 | { |
92 | struct resource *bar_res = &dev->resource[bar_num]; | 92 | struct resource *bar_res = &dev->resource[bar_num]; |
93 | long bar_size = pci_resource_len(dev, bar_num); | 93 | long bar_size = pci_resource_len(dev, bar_num); |
@@ -130,7 +130,7 @@ static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) | |||
130 | * - Loops through The Bar resources(0 - 5) including the ROM | 130 | * - Loops through The Bar resources(0 - 5) including the ROM |
131 | * is resource(6). | 131 | * is resource(6). |
132 | */ | 132 | */ |
133 | static void allocate_device_bars(struct pci_dev *dev) | 133 | static void __init allocate_device_bars(struct pci_dev *dev) |
134 | { | 134 | { |
135 | int bar_num; | 135 | int bar_num; |
136 | 136 | ||
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h index 33a8489fde54..730986bc917a 100644 --- a/arch/powerpc/platforms/iseries/pci.h +++ b/arch/powerpc/platforms/iseries/pci.h | |||
@@ -59,5 +59,10 @@ static inline u64 iseries_ds_addr(struct device_node *node) | |||
59 | } | 59 | } |
60 | 60 | ||
61 | extern void iSeries_Device_Information(struct pci_dev*, int); | 61 | extern void iSeries_Device_Information(struct pci_dev*, int); |
62 | #ifdef CONFIG_PCI | ||
63 | extern void iSeries_pci_final_fixup(void); | ||
64 | #else | ||
65 | static void iSeries_pci_final_fixup(void) { } | ||
66 | #endif | ||
62 | 67 | ||
63 | #endif /* _PLATFORMS_ISERIES_PCI_H */ | 68 | #endif /* _PLATFORMS_ISERIES_PCI_H */ |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 0877a8834110..2175a71800d5 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include "main_store.h" | 63 | #include "main_store.h" |
64 | #include "call_sm.h" | 64 | #include "call_sm.h" |
65 | #include "call_hpt.h" | 65 | #include "call_hpt.h" |
66 | #include "pci.h" | ||
66 | 67 | ||
67 | #ifdef DEBUG | 68 | #ifdef DEBUG |
68 | #define DBG(fmt...) udbg_printf(fmt) | 69 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -74,11 +75,6 @@ | |||
74 | static unsigned long build_iSeries_Memory_Map(void); | 75 | static unsigned long build_iSeries_Memory_Map(void); |
75 | static void iseries_shared_idle(void); | 76 | static void iseries_shared_idle(void); |
76 | static void iseries_dedicated_idle(void); | 77 | static void iseries_dedicated_idle(void); |
77 | #ifdef CONFIG_PCI | ||
78 | extern void iSeries_pci_final_fixup(void); | ||
79 | #else | ||
80 | static void iSeries_pci_final_fixup(void) { } | ||
81 | #endif | ||
82 | 78 | ||
83 | 79 | ||
84 | struct MemoryBlock { | 80 | struct MemoryBlock { |
@@ -112,13 +108,13 @@ static unsigned long iSeries_process_Condor_mainstore_vpd( | |||
112 | * correctly. | 108 | * correctly. |
113 | */ | 109 | */ |
114 | mb_array[0].logicalStart = 0; | 110 | mb_array[0].logicalStart = 0; |
115 | mb_array[0].logicalEnd = 0x100000000; | 111 | mb_array[0].logicalEnd = 0x100000000UL; |
116 | mb_array[0].absStart = 0; | 112 | mb_array[0].absStart = 0; |
117 | mb_array[0].absEnd = 0x100000000; | 113 | mb_array[0].absEnd = 0x100000000UL; |
118 | 114 | ||
119 | if (holeSize) { | 115 | if (holeSize) { |
120 | numMemoryBlocks = 2; | 116 | numMemoryBlocks = 2; |
121 | holeStart = holeStart & 0x000fffffffffffff; | 117 | holeStart = holeStart & 0x000fffffffffffffUL; |
122 | holeStart = addr_to_chunk(holeStart); | 118 | holeStart = addr_to_chunk(holeStart); |
123 | holeFirstChunk = holeStart; | 119 | holeFirstChunk = holeStart; |
124 | holeSize = addr_to_chunk(holeSize); | 120 | holeSize = addr_to_chunk(holeSize); |
@@ -128,9 +124,9 @@ static unsigned long iSeries_process_Condor_mainstore_vpd( | |||
128 | mb_array[0].logicalEnd = holeFirstChunk; | 124 | mb_array[0].logicalEnd = holeFirstChunk; |
129 | mb_array[0].absEnd = holeFirstChunk; | 125 | mb_array[0].absEnd = holeFirstChunk; |
130 | mb_array[1].logicalStart = holeFirstChunk; | 126 | mb_array[1].logicalStart = holeFirstChunk; |
131 | mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks; | 127 | mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks; |
132 | mb_array[1].absStart = holeFirstChunk + holeSizeChunks; | 128 | mb_array[1].absStart = holeFirstChunk + holeSizeChunks; |
133 | mb_array[1].absEnd = 0x100000000; | 129 | mb_array[1].absEnd = 0x100000000UL; |
134 | } | 130 | } |
135 | return numMemoryBlocks; | 131 | return numMemoryBlocks; |
136 | } | 132 | } |
@@ -234,9 +230,9 @@ static unsigned long iSeries_process_Regatta_mainstore_vpd( | |||
234 | mb_array[i].logicalEnd, | 230 | mb_array[i].logicalEnd, |
235 | mb_array[i].absStart, mb_array[i].absEnd); | 231 | mb_array[i].absStart, mb_array[i].absEnd); |
236 | mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart & | 232 | mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart & |
237 | 0x000fffffffffffff); | 233 | 0x000fffffffffffffUL); |
238 | mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd & | 234 | mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd & |
239 | 0x000fffffffffffff); | 235 | 0x000fffffffffffffUL); |
240 | mb_array[i].logicalStart = | 236 | mb_array[i].logicalStart = |
241 | addr_to_chunk(mb_array[i].logicalStart); | 237 | addr_to_chunk(mb_array[i].logicalStart); |
242 | mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd); | 238 | mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd); |
@@ -320,7 +316,7 @@ struct mschunks_map mschunks_map = { | |||
320 | }; | 316 | }; |
321 | EXPORT_SYMBOL(mschunks_map); | 317 | EXPORT_SYMBOL(mschunks_map); |
322 | 318 | ||
323 | void mschunks_alloc(unsigned long num_chunks) | 319 | static void mschunks_alloc(unsigned long num_chunks) |
324 | { | 320 | { |
325 | klimit = _ALIGN(klimit, sizeof(u32)); | 321 | klimit = _ALIGN(klimit, sizeof(u32)); |
326 | mschunks_map.mapping = (u32 *)klimit; | 322 | mschunks_map.mapping = (u32 *)klimit; |
diff --git a/arch/powerpc/platforms/iseries/setup.h b/arch/powerpc/platforms/iseries/setup.h index 0a47ac53c959..729754bbb018 100644 --- a/arch/powerpc/platforms/iseries/setup.h +++ b/arch/powerpc/platforms/iseries/setup.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #ifndef __ISERIES_SETUP_H__ | 17 | #ifndef __ISERIES_SETUP_H__ |
18 | #define __ISERIES_SETUP_H__ | 18 | #define __ISERIES_SETUP_H__ |
19 | 19 | ||
20 | extern void *iSeries_early_setup(void); | ||
20 | extern unsigned long iSeries_get_boot_time(void); | 21 | extern unsigned long iSeries_get_boot_time(void); |
21 | extern int iSeries_set_rtc_time(struct rtc_time *tm); | 22 | extern int iSeries_set_rtc_time(struct rtc_time *tm); |
22 | extern void iSeries_get_rtc_time(struct rtc_time *tm); | 23 | extern void iSeries_get_rtc_time(struct rtc_time *tm); |
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig index 735e1536cbfc..2f4dd6e4aac1 100644 --- a/arch/powerpc/platforms/pasemi/Kconfig +++ b/arch/powerpc/platforms/pasemi/Kconfig | |||
@@ -17,7 +17,7 @@ config PPC_PASEMI_IOMMU | |||
17 | bool "PA Semi IOMMU support" | 17 | bool "PA Semi IOMMU support" |
18 | depends on PPC_PASEMI | 18 | depends on PPC_PASEMI |
19 | help | 19 | help |
20 | IOMMU support for PA6T-1682M | 20 | IOMMU support for PA Semi PWRficient |
21 | 21 | ||
22 | config PPC_PASEMI_IOMMU_DMA_FORCE | 22 | config PPC_PASEMI_IOMMU_DMA_FORCE |
23 | bool "Force DMA engine to use IOMMU" | 23 | bool "Force DMA engine to use IOMMU" |
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 1cfb8b0c8fec..58556b028a4c 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/io.h> | 32 | #include <asm/io.h> |
33 | #include <asm/prom.h> | 33 | #include <asm/prom.h> |
34 | #include <asm/time.h> | 34 | #include <asm/time.h> |
35 | #include <asm/smp.h> | ||
35 | 36 | ||
36 | #define SDCASR_REG 0x0100 | 37 | #define SDCASR_REG 0x0100 |
37 | #define SDCASR_REG_STRIDE 0x1000 | 38 | #define SDCASR_REG_STRIDE 0x1000 |
@@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned int astate) | |||
124 | local_irq_restore(flags); | 125 | local_irq_restore(flags); |
125 | } | 126 | } |
126 | 127 | ||
128 | int check_astate(void) | ||
129 | { | ||
130 | return get_cur_astate(hard_smp_processor_id()); | ||
131 | } | ||
132 | |||
127 | void restore_astate(int cpu) | 133 | void restore_astate(int cpu) |
128 | { | 134 | { |
129 | set_astate(cpu, current_astate); | 135 | set_astate(cpu, current_astate); |
@@ -147,7 +153,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
147 | if (!cpu) | 153 | if (!cpu) |
148 | goto out; | 154 | goto out; |
149 | 155 | ||
150 | dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc"); | 156 | dn = of_find_compatible_node(NULL, NULL, "1682m-sdc"); |
157 | if (!dn) | ||
158 | dn = of_find_compatible_node(NULL, NULL, | ||
159 | "pasemi,pwrficient-sdc"); | ||
151 | if (!dn) | 160 | if (!dn) |
152 | goto out; | 161 | goto out; |
153 | err = of_address_to_resource(dn, 0, &res); | 162 | err = of_address_to_resource(dn, 0, &res); |
@@ -160,7 +169,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
160 | goto out; | 169 | goto out; |
161 | } | 170 | } |
162 | 171 | ||
163 | dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo"); | 172 | dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo"); |
173 | if (!dn) | ||
174 | dn = of_find_compatible_node(NULL, NULL, | ||
175 | "pasemi,pwrficient-gizmo"); | ||
164 | if (!dn) { | 176 | if (!dn) { |
165 | err = -ENODEV; | 177 | err = -ENODEV; |
166 | goto out_unmap_sdcasr; | 178 | goto out_unmap_sdcasr; |
@@ -292,7 +304,8 @@ static struct cpufreq_driver pas_cpufreq_driver = { | |||
292 | 304 | ||
293 | static int __init pas_cpufreq_init(void) | 305 | static int __init pas_cpufreq_init(void) |
294 | { | 306 | { |
295 | if (!machine_is_compatible("PA6T-1682M")) | 307 | if (!machine_is_compatible("PA6T-1682M") && |
308 | !machine_is_compatible("pasemi,pwrficient")) | ||
296 | return -ENODEV; | 309 | return -ENODEV; |
297 | 310 | ||
298 | return cpufreq_register_driver(&pas_cpufreq_driver); | 311 | return cpufreq_register_driver(&pas_cpufreq_driver); |
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index dae9f658122e..b46542990cf8 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/phy.h> | 31 | #include <linux/phy.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <asm/of_platform.h> | 33 | #include <linux/of_platform.h> |
34 | 34 | ||
35 | #define DELAY 1 | 35 | #define DELAY 1 |
36 | 36 | ||
@@ -218,45 +218,27 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, | |||
218 | const struct of_device_id *match) | 218 | const struct of_device_id *match) |
219 | { | 219 | { |
220 | struct device *dev = &ofdev->dev; | 220 | struct device *dev = &ofdev->dev; |
221 | struct device_node *np = ofdev->node; | 221 | struct device_node *phy_dn, *np = ofdev->node; |
222 | struct device_node *gpio_np; | ||
223 | struct mii_bus *new_bus; | 222 | struct mii_bus *new_bus; |
224 | struct resource res; | ||
225 | struct gpio_priv *priv; | 223 | struct gpio_priv *priv; |
226 | const unsigned int *prop; | 224 | const unsigned int *prop; |
227 | int err = 0; | 225 | int err; |
228 | int i; | 226 | int i; |
229 | 227 | ||
230 | gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio"); | 228 | err = -ENOMEM; |
231 | |||
232 | if (!gpio_np) | ||
233 | return -ENODEV; | ||
234 | |||
235 | err = of_address_to_resource(gpio_np, 0, &res); | ||
236 | of_node_put(gpio_np); | ||
237 | |||
238 | if (err) | ||
239 | return -EINVAL; | ||
240 | |||
241 | if (!gpio_regs) | ||
242 | gpio_regs = ioremap(res.start, 0x100); | ||
243 | |||
244 | if (!gpio_regs) | ||
245 | return -EPERM; | ||
246 | |||
247 | priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); | 229 | priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); |
248 | if (priv == NULL) | 230 | if (!priv) |
249 | return -ENOMEM; | 231 | goto out; |
250 | 232 | ||
251 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); | 233 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); |
252 | 234 | ||
253 | if (new_bus == NULL) | 235 | if (!new_bus) |
254 | return -ENOMEM; | 236 | goto out_free_priv; |
255 | 237 | ||
256 | new_bus->name = "pasemi gpio mdio bus", | 238 | new_bus->name = "pasemi gpio mdio bus"; |
257 | new_bus->read = &gpio_mdio_read, | 239 | new_bus->read = &gpio_mdio_read; |
258 | new_bus->write = &gpio_mdio_write, | 240 | new_bus->write = &gpio_mdio_write; |
259 | new_bus->reset = &gpio_mdio_reset, | 241 | new_bus->reset = &gpio_mdio_reset; |
260 | 242 | ||
261 | prop = of_get_property(np, "reg", NULL); | 243 | prop = of_get_property(np, "reg", NULL); |
262 | new_bus->id = *prop; | 244 | new_bus->id = *prop; |
@@ -265,9 +247,24 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, | |||
265 | new_bus->phy_mask = 0; | 247 | new_bus->phy_mask = 0; |
266 | 248 | ||
267 | new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); | 249 | new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); |
268 | for(i = 0; i < PHY_MAX_ADDR; ++i) | ||
269 | new_bus->irq[i] = irq_create_mapping(NULL, 10); | ||
270 | 250 | ||
251 | if (!new_bus->irq) | ||
252 | goto out_free_bus; | ||
253 | |||
254 | for (i = 0; i < PHY_MAX_ADDR; i++) | ||
255 | new_bus->irq[i] = NO_IRQ; | ||
256 | |||
257 | for (phy_dn = of_get_next_child(np, NULL); | ||
258 | phy_dn != NULL; | ||
259 | phy_dn = of_get_next_child(np, phy_dn)) { | ||
260 | const unsigned int *ip, *regp; | ||
261 | |||
262 | ip = of_get_property(phy_dn, "interrupts", NULL); | ||
263 | regp = of_get_property(phy_dn, "reg", NULL); | ||
264 | if (!ip || !regp || *regp >= PHY_MAX_ADDR) | ||
265 | continue; | ||
266 | new_bus->irq[*regp] = irq_create_mapping(NULL, *ip); | ||
267 | } | ||
271 | 268 | ||
272 | prop = of_get_property(np, "mdc-pin", NULL); | 269 | prop = of_get_property(np, "mdc-pin", NULL); |
273 | priv->mdc_pin = *prop; | 270 | priv->mdc_pin = *prop; |
@@ -280,17 +277,21 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, | |||
280 | 277 | ||
281 | err = mdiobus_register(new_bus); | 278 | err = mdiobus_register(new_bus); |
282 | 279 | ||
283 | if (0 != err) { | 280 | if (err != 0) { |
284 | printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n", | 281 | printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n", |
285 | new_bus->name, err); | 282 | new_bus->name, err); |
286 | goto bus_register_fail; | 283 | goto out_free_irq; |
287 | } | 284 | } |
288 | 285 | ||
289 | return 0; | 286 | return 0; |
290 | 287 | ||
291 | bus_register_fail: | 288 | out_free_irq: |
289 | kfree(new_bus->irq); | ||
290 | out_free_bus: | ||
292 | kfree(new_bus); | 291 | kfree(new_bus); |
293 | 292 | out_free_priv: | |
293 | kfree(priv); | ||
294 | out: | ||
294 | return err; | 295 | return err; |
295 | } | 296 | } |
296 | 297 | ||
@@ -317,6 +318,7 @@ static struct of_device_id gpio_mdio_match[] = | |||
317 | }, | 318 | }, |
318 | {}, | 319 | {}, |
319 | }; | 320 | }; |
321 | MODULE_DEVICE_TABLE(of, gpio_mdio_match); | ||
320 | 322 | ||
321 | static struct of_platform_driver gpio_mdio_driver = | 323 | static struct of_platform_driver gpio_mdio_driver = |
322 | { | 324 | { |
@@ -330,12 +332,32 @@ static struct of_platform_driver gpio_mdio_driver = | |||
330 | 332 | ||
331 | int gpio_mdio_init(void) | 333 | int gpio_mdio_init(void) |
332 | { | 334 | { |
335 | struct device_node *np; | ||
336 | |||
337 | np = of_find_compatible_node(NULL, NULL, "1682m-gpio"); | ||
338 | if (!np) | ||
339 | np = of_find_compatible_node(NULL, NULL, | ||
340 | "pasemi,pwrficient-gpio"); | ||
341 | if (!np) | ||
342 | return -ENODEV; | ||
343 | gpio_regs = of_iomap(np, 0); | ||
344 | of_node_put(np); | ||
345 | |||
346 | if (!gpio_regs) | ||
347 | return -ENODEV; | ||
348 | |||
333 | return of_register_platform_driver(&gpio_mdio_driver); | 349 | return of_register_platform_driver(&gpio_mdio_driver); |
334 | } | 350 | } |
351 | module_init(gpio_mdio_init); | ||
335 | 352 | ||
336 | void gpio_mdio_exit(void) | 353 | void gpio_mdio_exit(void) |
337 | { | 354 | { |
338 | of_unregister_platform_driver(&gpio_mdio_driver); | 355 | of_unregister_platform_driver(&gpio_mdio_driver); |
356 | if (gpio_regs) | ||
357 | iounmap(gpio_regs); | ||
339 | } | 358 | } |
340 | device_initcall(gpio_mdio_init); | 359 | module_exit(gpio_mdio_exit); |
341 | 360 | ||
361 | MODULE_LICENSE("GPL"); | ||
362 | MODULE_AUTHOR("Olof Johansson <olof@lixom.net>"); | ||
363 | MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards"); | ||
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h index 516acabb4e96..c96127b029b6 100644 --- a/arch/powerpc/platforms/pasemi/pasemi.h +++ b/arch/powerpc/platforms/pasemi/pasemi.h | |||
@@ -16,8 +16,14 @@ extern void idle_doze(void); | |||
16 | 16 | ||
17 | /* Restore astate to last set */ | 17 | /* Restore astate to last set */ |
18 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ | 18 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ |
19 | extern int check_astate(void); | ||
19 | extern void restore_astate(int cpu); | 20 | extern void restore_astate(int cpu); |
20 | #else | 21 | #else |
22 | static inline int check_astate(void) | ||
23 | { | ||
24 | /* Always return >0 so we never power save */ | ||
25 | return 1; | ||
26 | } | ||
21 | static inline void restore_astate(int cpu) | 27 | static inline void restore_astate(int cpu) |
22 | { | 28 | { |
23 | } | 29 | } |
diff --git a/arch/powerpc/platforms/pasemi/powersave.S b/arch/powerpc/platforms/pasemi/powersave.S index 6d0fba6aab17..56f45adcd089 100644 --- a/arch/powerpc/platforms/pasemi/powersave.S +++ b/arch/powerpc/platforms/pasemi/powersave.S | |||
@@ -62,7 +62,16 @@ sleep_common: | |||
62 | mflr r0 | 62 | mflr r0 |
63 | std r0, 16(r1) | 63 | std r0, 16(r1) |
64 | stdu r1,-64(r1) | 64 | stdu r1,-64(r1) |
65 | #ifdef CONFIG_PPC_PASEMI_CPUFREQ | ||
66 | std r3, 48(r1) | ||
65 | 67 | ||
68 | /* Only do power savings when in astate 0 */ | ||
69 | bl .check_astate | ||
70 | cmpwi r3,0 | ||
71 | bne 1f | ||
72 | |||
73 | ld r3, 48(r1) | ||
74 | #endif | ||
66 | LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE) | 75 | LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE) |
67 | mfmsr r4 | 76 | mfmsr r4 |
68 | andc r5,r4,r6 | 77 | andc r5,r4,r6 |
@@ -73,7 +82,7 @@ sleep_common: | |||
73 | 82 | ||
74 | mtmsrd r4,0 | 83 | mtmsrd r4,0 |
75 | 84 | ||
76 | addi r1,r1,64 | 85 | 1: addi r1,r1,64 |
77 | ld r0,16(r1) | 86 | ld r0,16(r1) |
78 | mtlr r0 | 87 | mtlr r0 |
79 | blr | 88 | blr |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 3d62060498b4..5748194a667f 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/console.h> | 28 | #include <linux/console.h> |
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/of_platform.h> | ||
30 | 31 | ||
31 | #include <asm/prom.h> | 32 | #include <asm/prom.h> |
32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
@@ -35,7 +36,6 @@ | |||
35 | #include <asm/mpic.h> | 36 | #include <asm/mpic.h> |
36 | #include <asm/smp.h> | 37 | #include <asm/smp.h> |
37 | #include <asm/time.h> | 38 | #include <asm/time.h> |
38 | #include <asm/of_platform.h> | ||
39 | 39 | ||
40 | #include <pcmcia/ss.h> | 40 | #include <pcmcia/ss.h> |
41 | #include <pcmcia/cistpl.h> | 41 | #include <pcmcia/cistpl.h> |
@@ -43,6 +43,10 @@ | |||
43 | 43 | ||
44 | #include "pasemi.h" | 44 | #include "pasemi.h" |
45 | 45 | ||
46 | #if !defined(CONFIG_SMP) | ||
47 | static void smp_send_stop(void) {} | ||
48 | #endif | ||
49 | |||
46 | /* SDC reset register, must be pre-mapped at reset time */ | 50 | /* SDC reset register, must be pre-mapped at reset time */ |
47 | static void __iomem *reset_reg; | 51 | static void __iomem *reset_reg; |
48 | 52 | ||
@@ -60,6 +64,9 @@ static int num_mce_regs; | |||
60 | 64 | ||
61 | static void pas_restart(char *cmd) | 65 | static void pas_restart(char *cmd) |
62 | { | 66 | { |
67 | /* Need to put others cpu in hold loop so they're not sleeping */ | ||
68 | smp_send_stop(); | ||
69 | udelay(10000); | ||
63 | printk("Restarting...\n"); | 70 | printk("Restarting...\n"); |
64 | while (1) | 71 | while (1) |
65 | out_le32(reset_reg, 0x6000000); | 72 | out_le32(reset_reg, 0x6000000); |
@@ -362,8 +369,12 @@ static inline void pasemi_pcmcia_init(void) | |||
362 | 369 | ||
363 | 370 | ||
364 | static struct of_device_id pasemi_bus_ids[] = { | 371 | static struct of_device_id pasemi_bus_ids[] = { |
372 | /* Unfortunately needed for legacy firmwares */ | ||
365 | { .type = "localbus", }, | 373 | { .type = "localbus", }, |
366 | { .type = "sdc", }, | 374 | { .type = "sdc", }, |
375 | /* These are the proper entries, which newer firmware uses */ | ||
376 | { .compatible = "pasemi,localbus", }, | ||
377 | { .compatible = "pasemi,sdc", }, | ||
367 | {}, | 378 | {}, |
368 | }; | 379 | }; |
369 | 380 | ||
@@ -389,7 +400,8 @@ static int __init pas_probe(void) | |||
389 | { | 400 | { |
390 | unsigned long root = of_get_flat_dt_root(); | 401 | unsigned long root = of_get_flat_dt_root(); |
391 | 402 | ||
392 | if (!of_flat_dt_is_compatible(root, "PA6T-1682M")) | 403 | if (!of_flat_dt_is_compatible(root, "PA6T-1682M") && |
404 | !of_flat_dt_is_compatible(root, "pasemi,pwrficient")) | ||
393 | return 0; | 405 | return 0; |
394 | 406 | ||
395 | hpte_init_native(); | 407 | hpte_init_native(); |
@@ -400,7 +412,7 @@ static int __init pas_probe(void) | |||
400 | } | 412 | } |
401 | 413 | ||
402 | define_machine(pasemi) { | 414 | define_machine(pasemi) { |
403 | .name = "PA Semi PA6T-1682M", | 415 | .name = "PA Semi PWRficient", |
404 | .probe = pas_probe, | 416 | .probe = pas_probe, |
405 | .setup_arch = pas_setup_arch, | 417 | .setup_arch = pas_setup_arch, |
406 | .init_early = pas_init_early, | 418 | .init_early = pas_init_early, |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 02c533096627..3acb59d5cdf5 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -51,6 +51,8 @@ | |||
51 | #include <linux/root_dev.h> | 51 | #include <linux/root_dev.h> |
52 | #include <linux/bitops.h> | 52 | #include <linux/bitops.h> |
53 | #include <linux/suspend.h> | 53 | #include <linux/suspend.h> |
54 | #include <linux/of_device.h> | ||
55 | #include <linux/of_platform.h> | ||
54 | 56 | ||
55 | #include <asm/reg.h> | 57 | #include <asm/reg.h> |
56 | #include <asm/sections.h> | 58 | #include <asm/sections.h> |
@@ -68,8 +70,6 @@ | |||
68 | #include <asm/btext.h> | 70 | #include <asm/btext.h> |
69 | #include <asm/pmac_feature.h> | 71 | #include <asm/pmac_feature.h> |
70 | #include <asm/time.h> | 72 | #include <asm/time.h> |
71 | #include <asm/of_device.h> | ||
72 | #include <asm/of_platform.h> | ||
73 | #include <asm/mmu_context.h> | 73 | #include <asm/mmu_context.h> |
74 | #include <asm/iommu.h> | 74 | #include <asm/iommu.h> |
75 | #include <asm/smu.h> | 75 | #include <asm/smu.h> |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index bf9da56942e8..bbbefd64ab59 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -84,12 +84,14 @@ long __init pmac_time_init(void) | |||
84 | return delta; | 84 | return delta; |
85 | } | 85 | } |
86 | 86 | ||
87 | #if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU) | ||
87 | static void to_rtc_time(unsigned long now, struct rtc_time *tm) | 88 | static void to_rtc_time(unsigned long now, struct rtc_time *tm) |
88 | { | 89 | { |
89 | to_tm(now, tm); | 90 | to_tm(now, tm); |
90 | tm->tm_year -= 1900; | 91 | tm->tm_year -= 1900; |
91 | tm->tm_mon -= 1; | 92 | tm->tm_mon -= 1; |
92 | } | 93 | } |
94 | #endif | ||
93 | 95 | ||
94 | static unsigned long from_rtc_time(struct rtc_time *tm) | 96 | static unsigned long from_rtc_time(struct rtc_time *tm) |
95 | { | 97 | { |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index fb3d636e088b..aa14a8559edb 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -480,6 +480,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) | |||
480 | no_dn++; | 480 | no_dn++; |
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | dn = find_device_pe(dn); | ||
483 | pdn = PCI_DN(dn); | 484 | pdn = PCI_DN(dn); |
484 | 485 | ||
485 | /* Access to IO BARs might get this far and still not want checking. */ | 486 | /* Access to IO BARs might get this far and still not want checking. */ |
@@ -545,7 +546,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) | |||
545 | 546 | ||
546 | /* Note that config-io to empty slots may fail; | 547 | /* Note that config-io to empty slots may fail; |
547 | * they are empty when they don't have children. */ | 548 | * they are empty when they don't have children. */ |
548 | if ((rets[0] == 5) && (dn->child == NULL)) { | 549 | if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) { |
549 | false_positives++; | 550 | false_positives++; |
550 | pdn->eeh_false_positives ++; | 551 | pdn->eeh_false_positives ++; |
551 | rc = 0; | 552 | rc = 0; |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 57e025e84ab4..06b89b56d0e9 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -354,13 +354,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
354 | if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) | 354 | if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) |
355 | goto excess_failures; | 355 | goto excess_failures; |
356 | 356 | ||
357 | /* Get the current PCI slot state. */ | ||
358 | rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000); | ||
359 | if (rc < 0) { | ||
360 | printk(KERN_WARNING "EEH: Permanent failure\n"); | ||
361 | goto hard_fail; | ||
362 | } | ||
363 | |||
364 | printk(KERN_WARNING | 357 | printk(KERN_WARNING |
365 | "EEH: This PCI device has failed %d times in the last hour:\n", | 358 | "EEH: This PCI device has failed %d times in the last hour:\n", |
366 | frozen_pdn->eeh_freeze_count); | 359 | frozen_pdn->eeh_freeze_count); |
@@ -376,6 +369,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
376 | */ | 369 | */ |
377 | pci_walk_bus(frozen_bus, eeh_report_error, &result); | 370 | pci_walk_bus(frozen_bus, eeh_report_error, &result); |
378 | 371 | ||
372 | /* Get the current PCI slot state. This can take a long time, | ||
373 | * sometimes over 3 seconds for certain systems. */ | ||
374 | rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000); | ||
375 | if (rc < 0) { | ||
376 | printk(KERN_WARNING "EEH: Permanent failure\n"); | ||
377 | goto hard_fail; | ||
378 | } | ||
379 | |||
379 | /* Since rtas may enable MMIO when posting the error log, | 380 | /* Since rtas may enable MMIO when posting the error log, |
380 | * don't post the error log until after all dev drivers | 381 | * don't post the error log until after all dev drivers |
381 | * have been informed. | 382 | * have been informed. |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index d003c80fa31d..d8680b589dc9 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -8,11 +8,6 @@ static inline long poll_pending(void) | |||
8 | return plpar_hcall_norets(H_POLL_PENDING); | 8 | return plpar_hcall_norets(H_POLL_PENDING); |
9 | } | 9 | } |
10 | 10 | ||
11 | static inline long prod_processor(void) | ||
12 | { | ||
13 | return plpar_hcall_norets(H_PROD); | ||
14 | } | ||
15 | |||
16 | static inline long cede_processor(void) | 11 | static inline long cede_processor(void) |
17 | { | 12 | { |
18 | return plpar_hcall_norets(H_CEDE); | 13 | return plpar_hcall_norets(H_CEDE); |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 116305b22a2b..ea4c65917a64 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <asm/pSeries_reconfig.h> | 46 | #include <asm/pSeries_reconfig.h> |
47 | #include <asm/mpic.h> | 47 | #include <asm/mpic.h> |
48 | #include <asm/vdso_datapage.h> | 48 | #include <asm/vdso_datapage.h> |
49 | #include <asm/cputhreads.h> | ||
49 | 50 | ||
50 | #include "plpar_wrappers.h" | 51 | #include "plpar_wrappers.h" |
51 | #include "pseries.h" | 52 | #include "pseries.h" |
@@ -202,7 +203,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr) | |||
202 | */ | 203 | */ |
203 | if (system_state < SYSTEM_RUNNING && | 204 | if (system_state < SYSTEM_RUNNING && |
204 | cpu_has_feature(CPU_FTR_SMT) && | 205 | cpu_has_feature(CPU_FTR_SMT) && |
205 | !smt_enabled_at_boot && nr % 2 != 0) | 206 | !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) |
206 | return 0; | 207 | return 0; |
207 | 208 | ||
208 | return 1; | 209 | return 1; |
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 5eaf3e3f4b8b..d359d6e92975 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c | |||
@@ -42,8 +42,9 @@ | |||
42 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
43 | #include <linux/string.h> | 43 | #include <linux/string.h> |
44 | #include <linux/types.h> | 44 | #include <linux/types.h> |
45 | #include <asm/of_device.h> | 45 | #include <linux/of_device.h> |
46 | #include <asm/of_platform.h> | 46 | #include <linux/of_platform.h> |
47 | |||
47 | #include <asm/page.h> | 48 | #include <asm/page.h> |
48 | #include <asm/prom.h> | 49 | #include <asm/prom.h> |
49 | 50 | ||
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 33df4c347ca7..87e58e09b500 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -222,7 +222,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary) | |||
222 | hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK; | 222 | hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK; |
223 | } | 223 | } |
224 | 224 | ||
225 | printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx." | 225 | printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. " |
226 | "Firmware bus number: %d->%d\n", | 226 | "Firmware bus number: %d->%d\n", |
227 | (unsigned long long)rsrc.start, hose->first_busno, | 227 | (unsigned long long)rsrc.start, hose->first_busno, |
228 | hose->last_busno); | 228 | hose->last_busno); |
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index 20edd1e94eff..c858749263e0 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c | |||
@@ -28,9 +28,9 @@ | |||
28 | #include <linux/completion.h> | 28 | #include <linux/completion.h> |
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/of_device.h> | ||
32 | #include <linux/of_platform.h> | ||
31 | 33 | ||
32 | #include <asm/of_device.h> | ||
33 | #include <asm/of_platform.h> | ||
34 | #include <asm/io.h> | 34 | #include <asm/io.h> |
35 | #include <asm/pmi.h> | 35 | #include <asm/pmi.h> |
36 | #include <asm/prom.h> | 36 | #include <asm/prom.h> |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 121b04d165d1..381d467cf55b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -153,6 +153,10 @@ static const char *getvecname(unsigned long vec); | |||
153 | 153 | ||
154 | static int do_spu_cmd(void); | 154 | static int do_spu_cmd(void); |
155 | 155 | ||
156 | #ifdef CONFIG_44x | ||
157 | static void dump_tlb_44x(void); | ||
158 | #endif | ||
159 | |||
156 | int xmon_no_auto_backtrace; | 160 | int xmon_no_auto_backtrace; |
157 | 161 | ||
158 | extern void xmon_enter(void); | 162 | extern void xmon_enter(void); |
@@ -231,6 +235,9 @@ Commands:\n\ | |||
231 | #ifdef CONFIG_PPC_STD_MMU_32 | 235 | #ifdef CONFIG_PPC_STD_MMU_32 |
232 | " u dump segment registers\n" | 236 | " u dump segment registers\n" |
233 | #endif | 237 | #endif |
238 | #ifdef CONFIG_44x | ||
239 | " u dump TLB\n" | ||
240 | #endif | ||
234 | " ? help\n" | 241 | " ? help\n" |
235 | " zr reboot\n\ | 242 | " zr reboot\n\ |
236 | zh halt\n" | 243 | zh halt\n" |
@@ -856,6 +863,11 @@ cmds(struct pt_regs *excp) | |||
856 | dump_segments(); | 863 | dump_segments(); |
857 | break; | 864 | break; |
858 | #endif | 865 | #endif |
866 | #ifdef CONFIG_4xx | ||
867 | case 'u': | ||
868 | dump_tlb_44x(); | ||
869 | break; | ||
870 | #endif | ||
859 | default: | 871 | default: |
860 | printf("Unrecognized command: "); | 872 | printf("Unrecognized command: "); |
861 | do { | 873 | do { |
@@ -2581,6 +2593,32 @@ void dump_segments(void) | |||
2581 | } | 2593 | } |
2582 | #endif | 2594 | #endif |
2583 | 2595 | ||
2596 | #ifdef CONFIG_44x | ||
2597 | static void dump_tlb_44x(void) | ||
2598 | { | ||
2599 | int i; | ||
2600 | |||
2601 | for (i = 0; i < PPC44x_TLB_SIZE; i++) { | ||
2602 | unsigned long w0,w1,w2; | ||
2603 | asm volatile("tlbre %0,%1,0" : "=r" (w0) : "r" (i)); | ||
2604 | asm volatile("tlbre %0,%1,1" : "=r" (w1) : "r" (i)); | ||
2605 | asm volatile("tlbre %0,%1,2" : "=r" (w2) : "r" (i)); | ||
2606 | printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); | ||
2607 | if (w0 & PPC44x_TLB_VALID) { | ||
2608 | printf("V %08x -> %01x%08x %c%c%c%c%c", | ||
2609 | w0 & PPC44x_TLB_EPN_MASK, | ||
2610 | w1 & PPC44x_TLB_ERPN_MASK, | ||
2611 | w1 & PPC44x_TLB_RPN_MASK, | ||
2612 | (w2 & PPC44x_TLB_W) ? 'W' : 'w', | ||
2613 | (w2 & PPC44x_TLB_I) ? 'I' : 'i', | ||
2614 | (w2 & PPC44x_TLB_M) ? 'M' : 'm', | ||
2615 | (w2 & PPC44x_TLB_G) ? 'G' : 'g', | ||
2616 | (w2 & PPC44x_TLB_E) ? 'E' : 'e'); | ||
2617 | } | ||
2618 | printf("\n"); | ||
2619 | } | ||
2620 | } | ||
2621 | #endif /* CONFIG_44x */ | ||
2584 | void xmon_init(int enable) | 2622 | void xmon_init(int enable) |
2585 | { | 2623 | { |
2586 | #ifdef CONFIG_PPC_ISERIES | 2624 | #ifdef CONFIG_PPC_ISERIES |
diff --git a/arch/ppc/platforms/ev64260.c b/arch/ppc/platforms/ev64260.c index 976270d537c1..c1f77e1d368e 100644 --- a/arch/ppc/platforms/ev64260.c +++ b/arch/ppc/platforms/ev64260.c | |||
@@ -336,7 +336,7 @@ ev64260_early_serial_map(void) | |||
336 | #endif | 336 | #endif |
337 | 337 | ||
338 | if (early_serial_setup(&port) != 0) | 338 | if (early_serial_setup(&port) != 0) |
339 | printk(KERN_WARNING "Early serial init of port 0" | 339 | printk(KERN_WARNING "Early serial init of port 0 " |
340 | "failed\n"); | 340 | "failed\n"); |
341 | 341 | ||
342 | first_time = 0; | 342 | first_time = 0; |
@@ -388,7 +388,7 @@ ev64260_setup_arch(void) | |||
388 | ev64260_early_serial_map(); | 388 | ev64260_early_serial_map(); |
389 | #endif | 389 | #endif |
390 | 390 | ||
391 | printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc." | 391 | printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. " |
392 | "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE); | 392 | "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE); |
393 | 393 | ||
394 | if (ppc_md.progress) | 394 | if (ppc_md.progress) |
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 2d7cd486e025..6bbd4fa50f3b 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -98,7 +98,7 @@ config HW_RANDOM_PASEMI | |||
98 | default HW_RANDOM | 98 | default HW_RANDOM |
99 | ---help--- | 99 | ---help--- |
100 | This driver provides kernel-side support for the Random Number | 100 | This driver provides kernel-side support for the Random Number |
101 | Generator hardware found on PA6T-1682M processor. | 101 | Generator hardware found on PA Semi PWRficient SoCs. |
102 | 102 | ||
103 | To compile this driver as a module, choose M here: the | 103 | To compile this driver as a module, choose M here: the |
104 | module will be called pasemi-rng. | 104 | module will be called pasemi-rng. |
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c index fa6040b6c8f2..24ae3073991f 100644 --- a/drivers/char/hw_random/pasemi-rng.c +++ b/drivers/char/hw_random/pasemi-rng.c | |||
@@ -126,10 +126,9 @@ static int __devexit rng_remove(struct of_device *dev) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static struct of_device_id rng_match[] = { | 128 | static struct of_device_id rng_match[] = { |
129 | { | 129 | { .compatible = "1682m-rng", }, |
130 | .compatible = "1682m-rng", | 130 | { .compatible = "pasemi,pwrficient-rng", }, |
131 | }, | 131 | { }, |
132 | {}, | ||
133 | }; | 132 | }; |
134 | 133 | ||
135 | static struct of_platform_driver rng_driver = { | 134 | static struct of_platform_driver rng_driver = { |
diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index 9007d0677220..90320917be28 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c | |||
@@ -225,7 +225,7 @@ static int __devinit pasemi_edac_probe(struct pci_dev *pdev, | |||
225 | EDAC_FLAG_NONE; | 225 | EDAC_FLAG_NONE; |
226 | mci->mod_name = MODULE_NAME; | 226 | mci->mod_name = MODULE_NAME; |
227 | mci->dev_name = pci_name(pdev); | 227 | mci->dev_name = pci_name(pdev); |
228 | mci->ctl_name = "pasemi,1682m-mc"; | 228 | mci->ctl_name = "pasemi,pwrficient-mc"; |
229 | mci->edac_check = pasemi_edac_check; | 229 | mci->edac_check = pasemi_edac_check; |
230 | mci->ctl_page_to_phys = NULL; | 230 | mci->ctl_page_to_phys = NULL; |
231 | pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub); | 231 | pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub); |
@@ -297,4 +297,4 @@ module_exit(pasemi_edac_exit); | |||
297 | 297 | ||
298 | MODULE_LICENSE("GPL"); | 298 | MODULE_LICENSE("GPL"); |
299 | MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>"); | 299 | MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>"); |
300 | MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller"); | 300 | MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller"); |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index dc741d3a4531..35e1f22089d6 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/adb.h> | 33 | #include <linux/adb.h> |
34 | #include <linux/pmu.h> | 34 | #include <linux/pmu.h> |
35 | #include <linux/cuda.h> | 35 | #include <linux/cuda.h> |
36 | #include <linux/smp_lock.h> | ||
37 | #include <linux/module.h> | 36 | #include <linux/module.h> |
38 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
39 | #include <linux/pm.h> | 38 | #include <linux/pm.h> |
@@ -65,9 +64,7 @@ | |||
65 | #include "via-pmu-event.h" | 64 | #include "via-pmu-event.h" |
66 | 65 | ||
67 | /* Some compile options */ | 66 | /* Some compile options */ |
68 | #undef SUSPEND_USES_PMU | ||
69 | #define DEBUG_SLEEP | 67 | #define DEBUG_SLEEP |
70 | #undef HACKED_PCI_SAVE | ||
71 | 68 | ||
72 | /* Misc minor number allocated for /dev/pmu */ | 69 | /* Misc minor number allocated for /dev/pmu */ |
73 | #define PMU_MINOR 154 | 70 | #define PMU_MINOR 154 |
@@ -1256,9 +1253,7 @@ void | |||
1256 | pmu_suspend(void) | 1253 | pmu_suspend(void) |
1257 | { | 1254 | { |
1258 | unsigned long flags; | 1255 | unsigned long flags; |
1259 | #ifdef SUSPEND_USES_PMU | 1256 | |
1260 | struct adb_request *req; | ||
1261 | #endif | ||
1262 | if (!via) | 1257 | if (!via) |
1263 | return; | 1258 | return; |
1264 | 1259 | ||
@@ -1276,17 +1271,10 @@ pmu_suspend(void) | |||
1276 | via_pmu_interrupt(0, NULL); | 1271 | via_pmu_interrupt(0, NULL); |
1277 | spin_lock_irqsave(&pmu_lock, flags); | 1272 | spin_lock_irqsave(&pmu_lock, flags); |
1278 | if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) { | 1273 | if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) { |
1279 | #ifdef SUSPEND_USES_PMU | ||
1280 | pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0); | ||
1281 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1282 | while(!req.complete) | ||
1283 | pmu_poll(); | ||
1284 | #else /* SUSPEND_USES_PMU */ | ||
1285 | if (gpio_irq >= 0) | 1274 | if (gpio_irq >= 0) |
1286 | disable_irq_nosync(gpio_irq); | 1275 | disable_irq_nosync(gpio_irq); |
1287 | out_8(&via[IER], CB1_INT | IER_CLR); | 1276 | out_8(&via[IER], CB1_INT | IER_CLR); |
1288 | spin_unlock_irqrestore(&pmu_lock, flags); | 1277 | spin_unlock_irqrestore(&pmu_lock, flags); |
1289 | #endif /* SUSPEND_USES_PMU */ | ||
1290 | break; | 1278 | break; |
1291 | } | 1279 | } |
1292 | } while (1); | 1280 | } while (1); |
@@ -1307,18 +1295,11 @@ pmu_resume(void) | |||
1307 | return; | 1295 | return; |
1308 | } | 1296 | } |
1309 | adb_int_pending = 1; | 1297 | adb_int_pending = 1; |
1310 | #ifdef SUSPEND_USES_PMU | ||
1311 | pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); | ||
1312 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1313 | while(!req.complete) | ||
1314 | pmu_poll(); | ||
1315 | #else /* SUSPEND_USES_PMU */ | ||
1316 | if (gpio_irq >= 0) | 1298 | if (gpio_irq >= 0) |
1317 | enable_irq(gpio_irq); | 1299 | enable_irq(gpio_irq); |
1318 | out_8(&via[IER], CB1_INT | IER_SET); | 1300 | out_8(&via[IER], CB1_INT | IER_SET); |
1319 | spin_unlock_irqrestore(&pmu_lock, flags); | 1301 | spin_unlock_irqrestore(&pmu_lock, flags); |
1320 | pmu_poll(); | 1302 | pmu_poll(); |
1321 | #endif /* SUSPEND_USES_PMU */ | ||
1322 | } | 1303 | } |
1323 | 1304 | ||
1324 | /* Interrupt data could be the result data from an ADB cmd */ | 1305 | /* Interrupt data could be the result data from an ADB cmd */ |
@@ -1804,14 +1785,10 @@ static void broadcast_wake(void) | |||
1804 | * PCI devices which may get powered off when we sleep. | 1785 | * PCI devices which may get powered off when we sleep. |
1805 | */ | 1786 | */ |
1806 | static struct pci_save { | 1787 | static struct pci_save { |
1807 | #ifndef HACKED_PCI_SAVE | ||
1808 | u16 command; | 1788 | u16 command; |
1809 | u16 cache_lat; | 1789 | u16 cache_lat; |
1810 | u16 intr; | 1790 | u16 intr; |
1811 | u32 rom_address; | 1791 | u32 rom_address; |
1812 | #else | ||
1813 | u32 config[16]; | ||
1814 | #endif | ||
1815 | } *pbook_pci_saves; | 1792 | } *pbook_pci_saves; |
1816 | static int pbook_npci_saves; | 1793 | static int pbook_npci_saves; |
1817 | 1794 | ||
@@ -1857,16 +1834,10 @@ pbook_pci_save(void) | |||
1857 | pci_dev_put(pd); | 1834 | pci_dev_put(pd); |
1858 | return; | 1835 | return; |
1859 | } | 1836 | } |
1860 | #ifndef HACKED_PCI_SAVE | ||
1861 | pci_read_config_word(pd, PCI_COMMAND, &ps->command); | 1837 | pci_read_config_word(pd, PCI_COMMAND, &ps->command); |
1862 | pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); | 1838 | pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); |
1863 | pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr); | 1839 | pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr); |
1864 | pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address); | 1840 | pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address); |
1865 | #else | ||
1866 | int i; | ||
1867 | for (i=1;i<16;i++) | ||
1868 | pci_read_config_dword(pd, i<<4, &ps->config[i]); | ||
1869 | #endif | ||
1870 | ++ps; | 1841 | ++ps; |
1871 | } | 1842 | } |
1872 | } | 1843 | } |
@@ -1885,17 +1856,6 @@ pbook_pci_restore(void) | |||
1885 | int j; | 1856 | int j; |
1886 | 1857 | ||
1887 | while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { | 1858 | while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { |
1888 | #ifdef HACKED_PCI_SAVE | ||
1889 | int i; | ||
1890 | if (npci-- == 0) { | ||
1891 | pci_dev_put(pd); | ||
1892 | return; | ||
1893 | } | ||
1894 | ps++; | ||
1895 | for (i=2;i<16;i++) | ||
1896 | pci_write_config_dword(pd, i<<4, ps->config[i]); | ||
1897 | pci_write_config_dword(pd, 4, ps->config[1]); | ||
1898 | #else | ||
1899 | if (npci-- == 0) | 1859 | if (npci-- == 0) |
1900 | return; | 1860 | return; |
1901 | ps++; | 1861 | ps++; |
@@ -1919,7 +1879,6 @@ pbook_pci_restore(void) | |||
1919 | pci_write_config_word(pd, PCI_COMMAND, ps->command); | 1879 | pci_write_config_word(pd, PCI_COMMAND, ps->command); |
1920 | break; | 1880 | break; |
1921 | } | 1881 | } |
1922 | #endif | ||
1923 | } | 1882 | } |
1924 | } | 1883 | } |
1925 | 1884 | ||
@@ -2547,7 +2506,6 @@ pmu_release(struct inode *inode, struct file *file) | |||
2547 | struct pmu_private *pp = file->private_data; | 2506 | struct pmu_private *pp = file->private_data; |
2548 | unsigned long flags; | 2507 | unsigned long flags; |
2549 | 2508 | ||
2550 | lock_kernel(); | ||
2551 | if (pp != 0) { | 2509 | if (pp != 0) { |
2552 | file->private_data = NULL; | 2510 | file->private_data = NULL; |
2553 | spin_lock_irqsave(&all_pvt_lock, flags); | 2511 | spin_lock_irqsave(&all_pvt_lock, flags); |
@@ -2561,7 +2519,6 @@ pmu_release(struct inode *inode, struct file *file) | |||
2561 | 2519 | ||
2562 | kfree(pp); | 2520 | kfree(pp); |
2563 | } | 2521 | } |
2564 | unlock_kernel(); | ||
2565 | return 0; | 2522 | return 0; |
2566 | } | 2523 | } |
2567 | 2524 | ||
diff --git a/include/asm-powerpc/cputhreads.h b/include/asm-powerpc/cputhreads.h new file mode 100644 index 000000000000..8485c28b5f47 --- /dev/null +++ b/include/asm-powerpc/cputhreads.h | |||
@@ -0,0 +1,71 @@ | |||
1 | #ifndef _ASM_POWERPC_CPUTHREADS_H | ||
2 | #define _ASM_POWERPC_CPUTHREADS_H | ||
3 | |||
4 | #include <linux/cpumask.h> | ||
5 | |||
6 | /* | ||
7 | * Mapping of threads to cores | ||
8 | */ | ||
9 | |||
10 | #ifdef CONFIG_SMP | ||
11 | extern int threads_per_core; | ||
12 | extern int threads_shift; | ||
13 | extern cpumask_t threads_core_mask; | ||
14 | #else | ||
15 | #define threads_per_core 1 | ||
16 | #define threads_shift 0 | ||
17 | #define threads_core_mask (CPU_MASK_CPU0) | ||
18 | #endif | ||
19 | |||
20 | /* cpu_thread_mask_to_cores - Return a cpumask of one per cores | ||
21 | * hit by the argument | ||
22 | * | ||
23 | * @threads: a cpumask of threads | ||
24 | * | ||
25 | * This function returns a cpumask which will have one "cpu" (or thread) | ||
26 | * bit set for each core that has at least one thread set in the argument. | ||
27 | * | ||
28 | * This can typically be used for things like IPI for tlb invalidations | ||
29 | * since those need to be done only once per core/TLB | ||
30 | */ | ||
31 | static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads) | ||
32 | { | ||
33 | cpumask_t tmp, res; | ||
34 | int i; | ||
35 | |||
36 | res = CPU_MASK_NONE; | ||
37 | for (i = 0; i < NR_CPUS; i += threads_per_core) { | ||
38 | cpus_shift_right(tmp, threads_core_mask, i); | ||
39 | if (cpus_intersects(threads, tmp)) | ||
40 | cpu_set(i, res); | ||
41 | } | ||
42 | return res; | ||
43 | } | ||
44 | |||
45 | static inline int cpu_nr_cores(void) | ||
46 | { | ||
47 | return NR_CPUS >> threads_shift; | ||
48 | } | ||
49 | |||
50 | static inline cpumask_t cpu_online_cores_map(void) | ||
51 | { | ||
52 | return cpu_thread_mask_to_cores(cpu_online_map); | ||
53 | } | ||
54 | |||
55 | static inline int cpu_thread_to_core(int cpu) | ||
56 | { | ||
57 | return cpu >> threads_shift; | ||
58 | } | ||
59 | |||
60 | static inline int cpu_thread_in_core(int cpu) | ||
61 | { | ||
62 | return cpu & (threads_per_core - 1); | ||
63 | } | ||
64 | |||
65 | static inline int cpu_first_thread_in_core(int cpu) | ||
66 | { | ||
67 | return cpu & ~(threads_per_core - 1); | ||
68 | } | ||
69 | |||
70 | #endif /* _ASM_POWERPC_CPUTHREADS_H */ | ||
71 | |||
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index b847aa10074b..fda5e3d1f62a 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -22,7 +22,6 @@ extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary); | |||
22 | 22 | ||
23 | 23 | ||
24 | extern struct list_head hose_list; | 24 | extern struct list_head hose_list; |
25 | extern int global_phb_number; | ||
26 | 25 | ||
27 | extern void find_and_init_phbs(void); | 26 | extern void find_and_init_phbs(void); |
28 | 27 | ||