Skip to content

Commit 47e8979

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/pseries: Fix build without CONFIG_HOTPLUG_CPU powerpc: Set nr_cpu_ids early and use it to free PACAs powerpc/pseries: Don't register global initcall powerpc/kexec: Fix mismatched ifdefs for PPC64/SMP. edac/mpc85xx: Limit setting/clearing of HID1[RFXE] to e500v1/v2 cores powerpc/85xx: Update dts for PCIe memory maps to match u-boot of Px020RDB
2 parents 884b826 + c60e65d commit 47e8979

File tree

10 files changed

+57
-38
lines changed

10 files changed

+57
-38
lines changed

arch/powerpc/boot/dts/p1020rdb.dts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* P1020 RDB Device Tree Source
33
*
4-
* Copyright 2009 Freescale Semiconductor Inc.
4+
* Copyright 2009-2011 Freescale Semiconductor Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by the
@@ -553,7 +553,7 @@
553553
reg = <0 0xffe09000 0 0x1000>;
554554
bus-range = <0 255>;
555555
ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
556-
0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
556+
0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
557557
clock-frequency = <33333333>;
558558
interrupt-parent = <&mpic>;
559559
interrupts = <16 2>;
@@ -580,8 +580,8 @@
580580
#address-cells = <3>;
581581
reg = <0 0xffe0a000 0 0x1000>;
582582
bus-range = <0 255>;
583-
ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
584-
0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
583+
ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
584+
0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
585585
clock-frequency = <33333333>;
586586
interrupt-parent = <&mpic>;
587587
interrupts = <16 2>;
@@ -590,8 +590,8 @@
590590
#size-cells = <2>;
591591
#address-cells = <3>;
592592
device_type = "pci";
593-
ranges = <0x2000000 0x0 0xc0000000
594-
0x2000000 0x0 0xc0000000
593+
ranges = <0x2000000 0x0 0x80000000
594+
0x2000000 0x0 0x80000000
595595
0x0 0x20000000
596596

597597
0x1000000 0x0 0x0

arch/powerpc/boot/dts/p2020rdb.dts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* P2020 RDB Device Tree Source
33
*
4-
* Copyright 2009 Freescale Semiconductor Inc.
4+
* Copyright 2009-2011 Freescale Semiconductor Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by the
@@ -537,7 +537,7 @@
537537
reg = <0 0xffe09000 0 0x1000>;
538538
bus-range = <0 255>;
539539
ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
540-
0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
540+
0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
541541
clock-frequency = <33333333>;
542542
interrupt-parent = <&mpic>;
543543
interrupts = <25 2>;
@@ -564,8 +564,8 @@
564564
#address-cells = <3>;
565565
reg = <0 0xffe0a000 0 0x1000>;
566566
bus-range = <0 255>;
567-
ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
568-
0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
567+
ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
568+
0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
569569
clock-frequency = <33333333>;
570570
interrupt-parent = <&mpic>;
571571
interrupts = <26 2>;
@@ -574,8 +574,8 @@
574574
#size-cells = <2>;
575575
#address-cells = <3>;
576576
device_type = "pci";
577-
ranges = <0x2000000 0x0 0xc0000000
578-
0x2000000 0x0 0xc0000000
577+
ranges = <0x2000000 0x0 0x80000000
578+
0x2000000 0x0 0x80000000
579579
0x0 0x20000000
580580

581581
0x1000000 0x0 0x0

arch/powerpc/boot/dts/p2020rdb_camp_core0.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* This dts file allows core0 to have memory, l2, i2c, spi, gpio, dma1, usb,
77
* eth1, eth2, sdhc, crypto, global-util, pci0.
88
*
9-
* Copyright 2009 Freescale Semiconductor Inc.
9+
* Copyright 2009-2011 Freescale Semiconductor Inc.
1010
*
1111
* This program is free software; you can redistribute it and/or modify it
1212
* under the terms of the GNU General Public License as published by the
@@ -342,7 +342,7 @@
342342
reg = <0 0xffe09000 0 0x1000>;
343343
bus-range = <0 255>;
344344
ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
345-
0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
345+
0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
346346
clock-frequency = <33333333>;
347347
interrupt-parent = <&mpic>;
348348
interrupts = <25 2>;

arch/powerpc/boot/dts/p2020rdb_camp_core1.dts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Please note to add "-b 1" for core1's dts compiling.
99
*
10-
* Copyright 2009 Freescale Semiconductor Inc.
10+
* Copyright 2009-2011 Freescale Semiconductor Inc.
1111
*
1212
* This program is free software; you can redistribute it and/or modify it
1313
* under the terms of the GNU General Public License as published by the
@@ -162,8 +162,8 @@
162162
#address-cells = <3>;
163163
reg = <0 0xffe0a000 0 0x1000>;
164164
bus-range = <0 255>;
165-
ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
166-
0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
165+
ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
166+
0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
167167
clock-frequency = <33333333>;
168168
interrupt-parent = <&mpic>;
169169
interrupts = <26 2>;
@@ -172,8 +172,8 @@
172172
#size-cells = <2>;
173173
#address-cells = <3>;
174174
device_type = "pci";
175-
ranges = <0x2000000 0x0 0xc0000000
176-
0x2000000 0x0 0xc0000000
175+
ranges = <0x2000000 0x0 0x80000000
176+
0x2000000 0x0 0x80000000
177177
0x0 0x20000000
178178

179179
0x1000000 0x0 0x0

arch/powerpc/kernel/crash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void crash_kexec_prepare_cpus(int cpu)
163163
}
164164

165165
/* wait for all the CPUs to hit real mode but timeout if they don't come in */
166-
#ifdef CONFIG_PPC_STD_MMU_64
166+
#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
167167
static void crash_kexec_wait_realmode(int cpu)
168168
{
169169
unsigned int msecs;
@@ -188,6 +188,8 @@ static void crash_kexec_wait_realmode(int cpu)
188188
}
189189
mb();
190190
}
191+
#else
192+
static inline void crash_kexec_wait_realmode(int cpu) {}
191193
#endif
192194

193195
/*
@@ -344,9 +346,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
344346
crash_save_cpu(regs, crashing_cpu);
345347
crash_kexec_prepare_cpus(crashing_cpu);
346348
cpu_set(crashing_cpu, cpus_in_crash);
347-
#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
348349
crash_kexec_wait_realmode(crashing_cpu);
349-
#endif
350350

351351
machine_kexec_mask_interrupts();
352352

arch/powerpc/kernel/paca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void __init free_unused_pacas(void)
203203
{
204204
int new_size;
205205

206-
new_size = PAGE_ALIGN(sizeof(struct paca_struct) * num_possible_cpus());
206+
new_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpu_ids);
207207

208208
if (new_size >= paca_size)
209209
return;

arch/powerpc/kernel/setup-common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ void __init smp_setup_cpu_maps(void)
509509
*/
510510
cpu_init_thread_core_maps(nthreads);
511511

512+
/* Now that possible cpus are set, set nr_cpu_ids for later use */
513+
nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
514+
512515
free_unused_pacas();
513516
}
514517
#endif /* CONFIG_SMP */

arch/powerpc/platforms/pseries/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int __init pSeries_init_panel(void)
378378

379379
return 0;
380380
}
381-
arch_initcall(pSeries_init_panel);
381+
machine_arch_initcall(pseries, pSeries_init_panel);
382382

383383
static int pseries_set_dabr(unsigned long dabr)
384384
{

arch/powerpc/platforms/pseries/smp.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
112112

113113
/* Fixup atomic count: it exited inside IRQ handler. */
114114
task_thread_info(paca[lcpu].__current)->preempt_count = 0;
115-
115+
#ifdef CONFIG_HOTPLUG_CPU
116116
if (get_cpu_current_state(lcpu) == CPU_STATE_INACTIVE)
117117
goto out;
118-
118+
#endif
119119
/*
120120
* If the RTAS start-cpu token does not exist then presume the
121121
* cpu is already spinning.
@@ -130,7 +130,9 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
130130
return 0;
131131
}
132132

133+
#ifdef CONFIG_HOTPLUG_CPU
133134
out:
135+
#endif
134136
return 1;
135137
}
136138

@@ -144,16 +146,15 @@ static void __devinit smp_xics_setup_cpu(int cpu)
144146
vpa_init(cpu);
145147

146148
cpumask_clear_cpu(cpu, of_spin_mask);
149+
#ifdef CONFIG_HOTPLUG_CPU
147150
set_cpu_current_state(cpu, CPU_STATE_ONLINE);
148151
set_default_offline_state(cpu);
149-
152+
#endif
150153
}
151154
#endif /* CONFIG_XICS */
152155

153156
static void __devinit smp_pSeries_kick_cpu(int nr)
154157
{
155-
long rc;
156-
unsigned long hcpuid;
157158
BUG_ON(nr < 0 || nr >= NR_CPUS);
158159

159160
if (!smp_startup_cpu(nr))
@@ -165,16 +166,20 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
165166
* the processor will continue on to secondary_start
166167
*/
167168
paca[nr].cpu_start = 1;
168-
169+
#ifdef CONFIG_HOTPLUG_CPU
169170
set_preferred_offline_state(nr, CPU_STATE_ONLINE);
170171

171172
if (get_cpu_current_state(nr) == CPU_STATE_INACTIVE) {
173+
long rc;
174+
unsigned long hcpuid;
175+
172176
hcpuid = get_hard_smp_processor_id(nr);
173177
rc = plpar_hcall_norets(H_PROD, hcpuid);
174178
if (rc != H_SUCCESS)
175179
printk(KERN_ERR "Error: Prod to wake up processor %d "
176180
"Ret= %ld\n", nr, rc);
177181
}
182+
#endif
178183
}
179184

180185
static int smp_pSeries_cpu_bootable(unsigned int nr)

drivers/edac/mpc85xx_edac.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,13 +1147,14 @@ static struct platform_driver mpc85xx_mc_err_driver = {
11471147
static void __init mpc85xx_mc_clear_rfxe(void *data)
11481148
{
11491149
orig_hid1[smp_processor_id()] = mfspr(SPRN_HID1);
1150-
mtspr(SPRN_HID1, (orig_hid1[smp_processor_id()] & ~0x20000));
1150+
mtspr(SPRN_HID1, (orig_hid1[smp_processor_id()] & ~HID1_RFXE));
11511151
}
11521152
#endif
11531153

11541154
static int __init mpc85xx_mc_init(void)
11551155
{
11561156
int res = 0;
1157+
u32 pvr = 0;
11571158

11581159
printk(KERN_INFO "Freescale(R) MPC85xx EDAC driver, "
11591160
"(C) 2006 Montavista Software\n");
@@ -1183,12 +1184,17 @@ static int __init mpc85xx_mc_init(void)
11831184
#endif
11841185

11851186
#ifdef CONFIG_FSL_SOC_BOOKE
1186-
/*
1187-
* need to clear HID1[RFXE] to disable machine check int
1188-
* so we can catch it
1189-
*/
1190-
if (edac_op_state == EDAC_OPSTATE_INT)
1191-
on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);
1187+
pvr = mfspr(SPRN_PVR);
1188+
1189+
if ((PVR_VER(pvr) == PVR_VER_E500V1) ||
1190+
(PVR_VER(pvr) == PVR_VER_E500V2)) {
1191+
/*
1192+
* need to clear HID1[RFXE] to disable machine check int
1193+
* so we can catch it
1194+
*/
1195+
if (edac_op_state == EDAC_OPSTATE_INT)
1196+
on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);
1197+
}
11921198
#endif
11931199

11941200
return 0;
@@ -1206,7 +1212,12 @@ static void __exit mpc85xx_mc_restore_hid1(void *data)
12061212
static void __exit mpc85xx_mc_exit(void)
12071213
{
12081214
#ifdef CONFIG_FSL_SOC_BOOKE
1209-
on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
1215+
u32 pvr = mfspr(SPRN_PVR);
1216+
1217+
if ((PVR_VER(pvr) == PVR_VER_E500V1) ||
1218+
(PVR_VER(pvr) == PVR_VER_E500V2)) {
1219+
on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
1220+
}
12101221
#endif
12111222
#ifdef CONFIG_PCI
12121223
platform_driver_unregister(&mpc85xx_pci_err_driver);

0 commit comments

Comments
 (0)