smp.c (3c19d5ada1bec8b97119215298df7669d3ffb3db) smp.c (b866cc2199d6a6cdcefe4acfe4cfca3ac3c6d38e)
1/*
2 * SMP support for PowerNV machines.
3 *
4 * Copyright 2011 IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 39 unchanged lines hidden (view full) ---

48#endif
49
50static void pnv_smp_setup_cpu(int cpu)
51{
52 if (xive_enabled())
53 xive_smp_setup_cpu();
54 else if (cpu != boot_cpuid)
55 xics_setup_cpu();
1/*
2 * SMP support for PowerNV machines.
3 *
4 * Copyright 2011 IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version

--- 39 unchanged lines hidden (view full) ---

48#endif
49
50static void pnv_smp_setup_cpu(int cpu)
51{
52 if (xive_enabled())
53 xive_smp_setup_cpu();
54 else if (cpu != boot_cpuid)
55 xics_setup_cpu();
56
57#ifdef CONFIG_PPC_DOORBELL
58 if (cpu_has_feature(CPU_FTR_DBELL))
59 doorbell_setup_this_cpu();
60#endif
61}
62
63static int pnv_smp_kick_cpu(int nr)
64{
65 unsigned int pcpu = get_hard_smp_processor_id(nr);
66 unsigned long start_here =
67 __pa(ppc_function_entry(generic_secondary_smp_init));
68 long rc;

--- 180 unchanged lines hidden (view full) ---

249
250static int pnv_smp_prepare_cpu(int cpu)
251{
252 if (xive_enabled())
253 return xive_smp_prepare_cpu(cpu);
254 return 0;
255}
256
56}
57
58static int pnv_smp_kick_cpu(int nr)
59{
60 unsigned int pcpu = get_hard_smp_processor_id(nr);
61 unsigned long start_here =
62 __pa(ppc_function_entry(generic_secondary_smp_init));
63 long rc;

--- 180 unchanged lines hidden (view full) ---

244
245static int pnv_smp_prepare_cpu(int cpu)
246{
247 if (xive_enabled())
248 return xive_smp_prepare_cpu(cpu);
249 return 0;
250}
251
252static void pnv_cause_ipi(int cpu)
253{
254 if (doorbell_try_core_ipi(cpu))
255 return;
256
257 icp_ops->cause_ipi(cpu);
258}
259
257static void __init pnv_smp_probe(void)
258{
259 if (xive_enabled())
260 xive_smp_probe();
261 else
262 xics_smp_probe();
260static void __init pnv_smp_probe(void)
261{
262 if (xive_enabled())
263 xive_smp_probe();
264 else
265 xics_smp_probe();
266
267 if (cpu_has_feature(CPU_FTR_DBELL) && !cpu_has_feature(CPU_FTR_ARCH_300)) {
268 smp_ops->cause_ipi = pnv_cause_ipi;
269 } else {
270 smp_ops->cause_ipi = icp_ops->cause_ipi;
271 }
263}
264
265static struct smp_ops_t pnv_smp_ops = {
272}
273
274static struct smp_ops_t pnv_smp_ops = {
266 .message_pass = smp_muxed_ipi_message_pass,
267 .cause_ipi = NULL, /* Filled at runtime by xi{cs,ve}_smp_probe() */
275 .message_pass = NULL, /* Use smp_muxed_ipi_message_pass */
276 .cause_ipi = NULL, /* Filled at runtime by pnv_smp_probe() */
268 .probe = pnv_smp_probe,
269 .prepare_cpu = pnv_smp_prepare_cpu,
270 .kick_cpu = pnv_smp_kick_cpu,
271 .setup_cpu = pnv_smp_setup_cpu,
272 .cpu_bootable = pnv_cpu_bootable,
273#ifdef CONFIG_HOTPLUG_CPU
274 .cpu_disable = pnv_smp_cpu_disable,
275 .cpu_die = generic_cpu_die,

--- 12 unchanged lines hidden ---
277 .probe = pnv_smp_probe,
278 .prepare_cpu = pnv_smp_prepare_cpu,
279 .kick_cpu = pnv_smp_kick_cpu,
280 .setup_cpu = pnv_smp_setup_cpu,
281 .cpu_bootable = pnv_cpu_bootable,
282#ifdef CONFIG_HOTPLUG_CPU
283 .cpu_disable = pnv_smp_cpu_disable,
284 .cpu_die = generic_cpu_die,

--- 12 unchanged lines hidden ---