aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mach-voyager/voyager_smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mach-voyager/voyager_smp.c')
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index 0f6e8a6523ae..52145007bd7e 100644
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -7,6 +7,7 @@
7 * This file provides all the same external entries as smp.c but uses 7 * This file provides all the same external entries as smp.c but uses
8 * the voyager hal to provide the functionality 8 * the voyager hal to provide the functionality
9 */ 9 */
10#include <linux/cpu.h>
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/mm.h> 12#include <linux/mm.h>
12#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
@@ -90,6 +91,7 @@ static void ack_vic_irq(unsigned int irq);
90static void vic_enable_cpi(void); 91static void vic_enable_cpi(void);
91static void do_boot_cpu(__u8 cpuid); 92static void do_boot_cpu(__u8 cpuid);
92static void do_quad_bootstrap(void); 93static void do_quad_bootstrap(void);
94static void initialize_secondary(void);
93 95
94int hard_smp_processor_id(void); 96int hard_smp_processor_id(void);
95int safe_smp_processor_id(void); 97int safe_smp_processor_id(void);
@@ -344,6 +346,12 @@ static void do_quad_bootstrap(void)
344 } 346 }
345} 347}
346 348
349void prefill_possible_map(void)
350{
351 /* This is empty on voyager because we need a much
352 * earlier detection which is done in find_smp_config */
353}
354
347/* Set up all the basic stuff: read the SMP config and make all the 355/* Set up all the basic stuff: read the SMP config and make all the
348 * SMP information reflect only the boot cpu. All others will be 356 * SMP information reflect only the boot cpu. All others will be
349 * brought on-line later. */ 357 * brought on-line later. */
@@ -413,6 +421,7 @@ void __init smp_store_cpu_info(int id)
413 struct cpuinfo_x86 *c = &cpu_data(id); 421 struct cpuinfo_x86 *c = &cpu_data(id);
414 422
415 *c = boot_cpu_data; 423 *c = boot_cpu_data;
424 c->cpu_index = id;
416 425
417 identify_secondary_cpu(c); 426 identify_secondary_cpu(c);
418} 427}
@@ -650,6 +659,8 @@ void __init smp_boot_cpus(void)
650 smp_tune_scheduling(); 659 smp_tune_scheduling();
651 */ 660 */
652 smp_store_cpu_info(boot_cpu_id); 661 smp_store_cpu_info(boot_cpu_id);
662 /* setup the jump vector */
663 initial_code = (unsigned long)initialize_secondary;
653 printk("CPU%d: ", boot_cpu_id); 664 printk("CPU%d: ", boot_cpu_id);
654 print_cpu_info(&cpu_data(boot_cpu_id)); 665 print_cpu_info(&cpu_data(boot_cpu_id));
655 666
@@ -702,7 +713,7 @@ void __init smp_boot_cpus(void)
702 713
703/* Reload the secondary CPUs task structure (this function does not 714/* Reload the secondary CPUs task structure (this function does not
704 * return ) */ 715 * return ) */
705void __init initialize_secondary(void) 716static void __init initialize_secondary(void)
706{ 717{
707#if 0 718#if 0
708 // AC kernels only 719 // AC kernels only
@@ -1248,7 +1259,7 @@ static void handle_vic_irq(unsigned int irq, struct irq_desc *desc)
1248#define QIC_SET_GATE(cpi, vector) \ 1259#define QIC_SET_GATE(cpi, vector) \
1249 set_intr_gate((cpi) + QIC_DEFAULT_CPI_BASE, (vector)) 1260 set_intr_gate((cpi) + QIC_DEFAULT_CPI_BASE, (vector))
1250 1261
1251void __init smp_intr_init(void) 1262void __init voyager_smp_intr_init(void)
1252{ 1263{
1253 int i; 1264 int i;
1254 1265
@@ -1780,6 +1791,17 @@ void __init smp_setup_processor_id(void)
1780 x86_write_percpu(cpu_number, hard_smp_processor_id()); 1791 x86_write_percpu(cpu_number, hard_smp_processor_id());
1781} 1792}
1782 1793
1794static void voyager_send_call_func(cpumask_t callmask)
1795{
1796 __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id());
1797 send_CPI(mask, VIC_CALL_FUNCTION_CPI);
1798}
1799
1800static void voyager_send_call_func_single(int cpu)
1801{
1802 send_CPI(1 << cpu, VIC_CALL_FUNCTION_SINGLE_CPI);
1803}
1804
1783struct smp_ops smp_ops = { 1805struct smp_ops smp_ops = {
1784 .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu, 1806 .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu,
1785 .smp_prepare_cpus = voyager_smp_prepare_cpus, 1807 .smp_prepare_cpus = voyager_smp_prepare_cpus,
@@ -1789,6 +1811,6 @@ struct smp_ops smp_ops = {
1789 .smp_send_stop = voyager_smp_send_stop, 1811 .smp_send_stop = voyager_smp_send_stop,
1790 .smp_send_reschedule = voyager_smp_send_reschedule, 1812 .smp_send_reschedule = voyager_smp_send_reschedule,
1791 1813
1792 .send_call_func_ipi = native_send_call_func_ipi, 1814 .send_call_func_ipi = voyager_send_call_func,
1793 .send_call_func_single_ipi = native_send_call_func_single_ipi, 1815 .send_call_func_single_ipi = voyager_send_call_func_single,
1794}; 1816};