diff options
Diffstat (limited to 'arch/powerpc/platforms/ps3/smp.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/smp.c | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c index 4c44794faac0..efc1cd8c034a 100644 --- a/arch/powerpc/platforms/ps3/smp.c +++ b/arch/powerpc/platforms/ps3/smp.c | |||
@@ -59,46 +59,49 @@ static void ps3_smp_message_pass(int cpu, int msg) | |||
59 | 59 | ||
60 | static int ps3_smp_probe(void) | 60 | static int ps3_smp_probe(void) |
61 | { | 61 | { |
62 | return 2; | 62 | int cpu; |
63 | } | ||
64 | 63 | ||
65 | static void __init ps3_smp_setup_cpu(int cpu) | 64 | for (cpu = 0; cpu < 2; cpu++) { |
66 | { | 65 | int result; |
67 | int result; | 66 | unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); |
68 | unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); | 67 | int i; |
69 | int i; | ||
70 | 68 | ||
71 | DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); | 69 | DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); |
72 | 70 | ||
73 | /* | 71 | /* |
74 | * Check assumptions on ps3_ipi_virqs[] indexing. If this | 72 | * Check assumptions on ps3_ipi_virqs[] indexing. If this |
75 | * check fails, then a different mapping of PPC_MSG_ | 73 | * check fails, then a different mapping of PPC_MSG_ |
76 | * to index needs to be setup. | 74 | * to index needs to be setup. |
77 | */ | 75 | */ |
78 | 76 | ||
79 | BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); | 77 | BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); |
80 | BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); | 78 | BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); |
81 | BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); | 79 | BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); |
82 | BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); | 80 | BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); |
83 | 81 | ||
84 | for (i = 0; i < MSG_COUNT; i++) { | 82 | for (i = 0; i < MSG_COUNT; i++) { |
85 | result = ps3_event_receive_port_setup(cpu, &virqs[i]); | 83 | result = ps3_event_receive_port_setup(cpu, &virqs[i]); |
86 | 84 | ||
87 | if (result) | 85 | if (result) |
88 | continue; | 86 | continue; |
89 | 87 | ||
90 | DBG("%s:%d: (%d, %d) => virq %u\n", | 88 | DBG("%s:%d: (%d, %d) => virq %u\n", |
91 | __func__, __LINE__, cpu, i, virqs[i]); | 89 | __func__, __LINE__, cpu, i, virqs[i]); |
92 | 90 | ||
93 | result = smp_request_message_ipi(virqs[i], i); | 91 | result = smp_request_message_ipi(virqs[i], i); |
94 | 92 | ||
95 | if (result) | 93 | if (result) |
96 | virqs[i] = NO_IRQ; | 94 | virqs[i] = NO_IRQ; |
97 | } | 95 | else |
96 | ps3_register_ipi_irq(cpu, virqs[i]); | ||
97 | } | ||
98 | 98 | ||
99 | ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); | 99 | ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); |
100 | 100 | ||
101 | DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); | 101 | DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); |
102 | } | ||
103 | |||
104 | return 2; | ||
102 | } | 105 | } |
103 | 106 | ||
104 | void ps3_smp_cleanup_cpu(int cpu) | 107 | void ps3_smp_cleanup_cpu(int cpu) |
@@ -121,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = { | |||
121 | .probe = ps3_smp_probe, | 124 | .probe = ps3_smp_probe, |
122 | .message_pass = ps3_smp_message_pass, | 125 | .message_pass = ps3_smp_message_pass, |
123 | .kick_cpu = smp_generic_kick_cpu, | 126 | .kick_cpu = smp_generic_kick_cpu, |
124 | .setup_cpu = ps3_smp_setup_cpu, | ||
125 | }; | 127 | }; |
126 | 128 | ||
127 | void smp_init_ps3(void) | 129 | void smp_init_ps3(void) |