aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/cputable.c6
-rw-r--r--arch/powerpc/kernel/entry_32.S18
-rw-r--r--arch/powerpc/kernel/of_platform.c10
-rw-r--r--arch/powerpc/kernel/pci_64.c23
-rw-r--r--arch/powerpc/kernel/pmc.c6
-rw-r--r--arch/powerpc/kernel/prom.c5
-rw-r--r--arch/powerpc/kernel/rtas-proc.c2
-rw-r--r--arch/powerpc/kernel/smp.c34
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
9 files changed, 77 insertions, 31 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 9cb24d20f0f9..b2b5d664d328 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -235,6 +235,7 @@ static struct cpu_spec cpu_specs[] = {
235 .icache_bsize = 128, 235 .icache_bsize = 128,
236 .dcache_bsize = 128, 236 .dcache_bsize = 128,
237 .num_pmcs = 8, 237 .num_pmcs = 8,
238 .pmc_type = PPC_PMC_IBM,
238 .cpu_setup = __setup_cpu_ppc970, 239 .cpu_setup = __setup_cpu_ppc970,
239 .cpu_restore = __restore_cpu_ppc970, 240 .cpu_restore = __restore_cpu_ppc970,
240 .oprofile_cpu_type = "ppc64/970MP", 241 .oprofile_cpu_type = "ppc64/970MP",
@@ -251,6 +252,7 @@ static struct cpu_spec cpu_specs[] = {
251 .icache_bsize = 128, 252 .icache_bsize = 128,
252 .dcache_bsize = 128, 253 .dcache_bsize = 128,
253 .num_pmcs = 8, 254 .num_pmcs = 8,
255 .pmc_type = PPC_PMC_IBM,
254 .cpu_setup = __setup_cpu_ppc970MP, 256 .cpu_setup = __setup_cpu_ppc970MP,
255 .cpu_restore = __restore_cpu_ppc970, 257 .cpu_restore = __restore_cpu_ppc970,
256 .oprofile_cpu_type = "ppc64/970MP", 258 .oprofile_cpu_type = "ppc64/970MP",
@@ -317,6 +319,7 @@ static struct cpu_spec cpu_specs[] = {
317 .icache_bsize = 128, 319 .icache_bsize = 128,
318 .dcache_bsize = 128, 320 .dcache_bsize = 128,
319 .num_pmcs = 6, 321 .num_pmcs = 6,
322 .pmc_type = PPC_PMC_IBM,
320 .oprofile_cpu_type = "ppc64/power6", 323 .oprofile_cpu_type = "ppc64/power6",
321 .oprofile_type = PPC_OPROFILE_POWER4, 324 .oprofile_type = PPC_OPROFILE_POWER4,
322 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV, 325 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
@@ -335,6 +338,7 @@ static struct cpu_spec cpu_specs[] = {
335 .icache_bsize = 128, 338 .icache_bsize = 128,
336 .dcache_bsize = 128, 339 .dcache_bsize = 128,
337 .num_pmcs = 6, 340 .num_pmcs = 6,
341 .pmc_type = PPC_PMC_IBM,
338 .oprofile_cpu_type = "ppc64/power6", 342 .oprofile_cpu_type = "ppc64/power6",
339 .oprofile_type = PPC_OPROFILE_POWER4, 343 .oprofile_type = PPC_OPROFILE_POWER4,
340 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV, 344 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
@@ -836,7 +840,7 @@ static struct cpu_spec cpu_specs[] = {
836 .pvr_mask = 0xffff0000, 840 .pvr_mask = 0xffff0000,
837 .pvr_value = 0x80040000, 841 .pvr_value = 0x80040000,
838 .cpu_name = "7448", 842 .cpu_name = "7448",
839 .cpu_features = CPU_FTRS_7447A, 843 .cpu_features = CPU_FTRS_7448,
840 .cpu_user_features = COMMON_USER | 844 .cpu_user_features = COMMON_USER |
841 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE, 845 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
842 .icache_bsize = 32, 846 .icache_bsize = 32,
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index c29d1652a421..4074c0b31453 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -596,7 +596,11 @@ fast_exception_return:
596 mr r12,r4 /* restart at exc_exit_restart */ 596 mr r12,r4 /* restart at exc_exit_restart */
597 b 2b 597 b 2b
598 598
599 .comm fee_restarts,4 599 .section .bss
600 .align 2
601fee_restarts:
602 .space 4
603 .previous
600 604
601/* aargh, a nonrecoverable interrupt, panic */ 605/* aargh, a nonrecoverable interrupt, panic */
602/* aargh, we don't know which trap this is */ 606/* aargh, we don't know which trap this is */
@@ -851,7 +855,11 @@ load_dbcr0:
851 mtspr SPRN_DBSR,r11 /* clear all pending debug events */ 855 mtspr SPRN_DBSR,r11 /* clear all pending debug events */
852 blr 856 blr
853 857
854 .comm global_dbcr0,8 858 .section .bss
859 .align 4
860global_dbcr0:
861 .space 8
862 .previous
855#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ 863#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
856 864
857do_work: /* r10 contains MSR_KERNEL here */ 865do_work: /* r10 contains MSR_KERNEL here */
@@ -926,7 +934,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
926 /* shouldn't return */ 934 /* shouldn't return */
927 b 4b 935 b 4b
928 936
929 .comm ee_restarts,4 937 .section .bss
938 .align 2
939ee_restarts:
940 .space 4
941 .previous
930 942
931/* 943/*
932 * PROM code for specific machines follows. Put it 944 * PROM code for specific machines follows. Put it
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 84c34d979a88..d501c23e5159 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -427,11 +427,13 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
427 /* Process "ranges" property */ 427 /* Process "ranges" property */
428 pci_process_bridge_OF_ranges(phb, dev->node, 0); 428 pci_process_bridge_OF_ranges(phb, dev->node, 0);
429 429
430 /* Setup IO space. 430 /* Setup IO space. We use the non-dynamic version of that code here,
431 * This will not work properly for ISA IOs, something needs to be done 431 * which doesn't quite support unplugging. Next kernel release will
432 * about it if we ever generalize that way of probing PCI brigdes 432 * have a better fix for this.
433 * Note also that we don't do ISA, this will also be fixed with a
434 * more massive rework.
433 */ 435 */
434 pci_setup_phb_io_dynamic(phb, 0); 436 pci_setup_phb_io(phb, 0);
435 437
436 /* Init pci_dn data structures */ 438 /* Init pci_dn data structures */
437 pci_devs_phb_init_dynamic(phb); 439 pci_devs_phb_init_dynamic(phb);
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index b0409e19b1c1..249cca27a9b8 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -41,6 +41,7 @@
41 41
42unsigned long pci_probe_only = 1; 42unsigned long pci_probe_only = 1;
43int pci_assign_all_buses = 0; 43int pci_assign_all_buses = 0;
44static int pci_initial_scan_done;
44 45
45static void fixup_resource(struct resource *res, struct pci_dev *dev); 46static void fixup_resource(struct resource *res, struct pci_dev *dev);
46static void do_bus_setup(struct pci_bus *bus); 47static void do_bus_setup(struct pci_bus *bus);
@@ -604,6 +605,8 @@ static int __init pcibios_init(void)
604 /* map in PCI I/O space */ 605 /* map in PCI I/O space */
605 phbs_remap_io(); 606 phbs_remap_io();
606 607
608 pci_initial_scan_done = 1;
609
607 printk(KERN_DEBUG "PCI: Probing PCI hardware done\n"); 610 printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
608 611
609 return 0; 612 return 0;
@@ -1042,13 +1045,16 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
1042 } 1045 }
1043} 1046}
1044 1047
1045void __init pci_setup_phb_io(struct pci_controller *hose, int primary) 1048void __devinit pci_setup_phb_io(struct pci_controller *hose, int primary)
1046{ 1049{
1047 unsigned long size = hose->pci_io_size; 1050 unsigned long size = hose->pci_io_size;
1048 unsigned long io_virt_offset; 1051 unsigned long io_virt_offset;
1049 struct resource *res; 1052 struct resource *res;
1050 struct device_node *isa_dn; 1053 struct device_node *isa_dn;
1051 1054
1055 if (size == 0)
1056 return;
1057
1052 hose->io_base_virt = reserve_phb_iospace(size); 1058 hose->io_base_virt = reserve_phb_iospace(size);
1053 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 1059 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
1054 hose->global_number, hose->io_base_phys, 1060 hose->global_number, hose->io_base_phys,
@@ -1069,6 +1075,15 @@ void __init pci_setup_phb_io(struct pci_controller *hose, int primary)
1069 res = &hose->io_resource; 1075 res = &hose->io_resource;
1070 res->start += io_virt_offset; 1076 res->start += io_virt_offset;
1071 res->end += io_virt_offset; 1077 res->end += io_virt_offset;
1078
1079 /* If this is called after the initial PCI scan, then we need to
1080 * proceed to IO mappings now
1081 */
1082 if (pci_initial_scan_done)
1083 __ioremap_explicit(hose->io_base_phys,
1084 (unsigned long)hose->io_base_virt,
1085 hose->pci_io_size,
1086 _PAGE_NO_CACHE | _PAGE_GUARDED);
1072} 1087}
1073 1088
1074void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose, 1089void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
@@ -1078,6 +1093,9 @@ void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
1078 unsigned long io_virt_offset; 1093 unsigned long io_virt_offset;
1079 struct resource *res; 1094 struct resource *res;
1080 1095
1096 if (size == 0)
1097 return;
1098
1081 hose->io_base_virt = __ioremap(hose->io_base_phys, size, 1099 hose->io_base_virt = __ioremap(hose->io_base_phys, size,
1082 _PAGE_NO_CACHE | _PAGE_GUARDED); 1100 _PAGE_NO_CACHE | _PAGE_GUARDED);
1083 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 1101 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
@@ -1106,6 +1124,9 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
1106 /* Root Bus */ 1124 /* Root Bus */
1107 res = &hose->io_resource; 1125 res = &hose->io_resource;
1108 1126
1127 if (res->end == 0 && res->start == 0)
1128 return 1;
1129
1109 *start_virt = pci_io_base + res->start; 1130 *start_virt = pci_io_base + res->start;
1110 *start_phys = *start_virt + hose->io_base_phys 1131 *start_phys = *start_virt + hose->io_base_phys
1111 - (unsigned long) hose->io_base_virt; 1132 - (unsigned long) hose->io_base_virt;
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 24d7b7c99bb9..ea04e0ab3f2f 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -20,8 +20,8 @@
20#include <asm/cputable.h> 20#include <asm/cputable.h>
21#include <asm/pmc.h> 21#include <asm/pmc.h>
22 22
23#ifndef MMCR0_PMA0 23#ifndef MMCR0_PMAO
24#define MMCR0_PMA0 0 24#define MMCR0_PMAO 0
25#endif 25#endif
26 26
27static void dummy_perf(struct pt_regs *regs) 27static void dummy_perf(struct pt_regs *regs)
@@ -30,7 +30,7 @@ static void dummy_perf(struct pt_regs *regs)
30 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE); 30 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx) 31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
32 if (cur_cpu_spec->pmc_type == PPC_PMC_IBM) 32 if (cur_cpu_spec->pmc_type == PPC_PMC_IBM)
33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMA0)); 33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMAO));
34#else 34#else
35 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~MMCR0_PMXE); 35 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~MMCR0_PMXE);
36#endif 36#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index c065b5550368..066a6a7a25b8 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1472,6 +1472,11 @@ static int of_finish_dynamic_node(struct device_node *node)
1472 node->name = of_get_property(node, "name", NULL); 1472 node->name = of_get_property(node, "name", NULL);
1473 node->type = of_get_property(node, "device_type", NULL); 1473 node->type = of_get_property(node, "device_type", NULL);
1474 1474
1475 if (!node->name)
1476 node->name = "<NULL>";
1477 if (!node->type)
1478 node->type = "<NULL>";
1479
1475 if (!parent) { 1480 if (!parent) {
1476 err = -ENODEV; 1481 err = -ENODEV;
1477 goto out; 1482 goto out;
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 190b7ed1dbfb..f2e3bc714d76 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -379,7 +379,7 @@ static ssize_t ppc_rtas_progress_write(struct file *file,
379/* ****************************************************************** */ 379/* ****************************************************************** */
380static int ppc_rtas_progress_show(struct seq_file *m, void *v) 380static int ppc_rtas_progress_show(struct seq_file *m, void *v)
381{ 381{
382 if (progress_led) 382 if (progress_led[0])
383 seq_printf(m, "%s\n", progress_led); 383 seq_printf(m, "%s\n", progress_led);
384 return 0; 384 return 0;
385} 385}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 22f1ef1b3100..d577b71db375 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -201,13 +201,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
201 /* Can deadlock when called with interrupts disabled */ 201 /* Can deadlock when called with interrupts disabled */
202 WARN_ON(irqs_disabled()); 202 WARN_ON(irqs_disabled());
203 203
204 /* remove 'self' from the map */
205 if (cpu_isset(smp_processor_id(), map))
206 cpu_clear(smp_processor_id(), map);
207
208 /* sanity check the map, remove any non-online processors. */
209 cpus_and(map, map, cpu_online_map);
210
211 if (unlikely(smp_ops == NULL)) 204 if (unlikely(smp_ops == NULL))
212 return ret; 205 return ret;
213 206
@@ -222,10 +215,17 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
222 /* Must grab online cpu count with preempt disabled, otherwise 215 /* Must grab online cpu count with preempt disabled, otherwise
223 * it can change. */ 216 * it can change. */
224 num_cpus = num_online_cpus() - 1; 217 num_cpus = num_online_cpus() - 1;
225 if (!num_cpus || cpus_empty(map)) { 218 if (!num_cpus)
226 ret = 0; 219 goto done;
227 goto out; 220
228 } 221 /* remove 'self' from the map */
222 if (cpu_isset(smp_processor_id(), map))
223 cpu_clear(smp_processor_id(), map);
224
225 /* sanity check the map, remove any non-online processors. */
226 cpus_and(map, map, cpu_online_map);
227 if (cpus_empty(map))
228 goto done;
229 229
230 call_data = &data; 230 call_data = &data;
231 smp_wmb(); 231 smp_wmb();
@@ -263,6 +263,7 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
263 } 263 }
264 } 264 }
265 265
266 done:
266 ret = 0; 267 ret = 0;
267 268
268 out: 269 out:
@@ -282,16 +283,17 @@ EXPORT_SYMBOL(smp_call_function);
282int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic, 283int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
283 int wait) 284 int wait)
284{ 285{
285 cpumask_t map=CPU_MASK_NONE; 286 cpumask_t map = CPU_MASK_NONE;
287 int ret = -EBUSY;
286 288
287 if (!cpu_online(cpu)) 289 if (!cpu_online(cpu))
288 return -EINVAL; 290 return -EINVAL;
289 291
290 if (cpu == smp_processor_id())
291 return -EBUSY;
292
293 cpu_set(cpu, map); 292 cpu_set(cpu, map);
294 return smp_call_function_map(func,info,nonatomic,wait,map); 293 if (cpu != get_cpu())
294 ret = smp_call_function_map(func,info,nonatomic,wait,map);
295 put_cpu();
296 return ret;
295} 297}
296EXPORT_SYMBOL(smp_call_function_single); 298EXPORT_SYMBOL(smp_call_function_single);
297 299
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 132067313147..21c39ff2dc39 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -34,7 +34,7 @@ SECTIONS
34 /* Text and gots */ 34 /* Text and gots */
35 .text : { 35 .text : {
36 _text = .; 36 _text = .;
37 *(.text .text.*) 37 TEXT_TEXT
38 SCHED_TEXT 38 SCHED_TEXT
39 LOCK_TEXT 39 LOCK_TEXT
40 KPROBES_TEXT 40 KPROBES_TEXT
@@ -167,7 +167,7 @@ SECTIONS
167#ifdef CONFIG_PPC32 167#ifdef CONFIG_PPC32
168 .data : 168 .data :
169 { 169 {
170 *(.data) 170 DATA_DATA
171 *(.sdata) 171 *(.sdata)
172 *(.got.plt) *(.got) 172 *(.got.plt) *(.got)
173 } 173 }