aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/pervasive.c
diff options
context:
space:
mode:
authorChristian Krafft <krafft@de.ibm.com>2008-07-15 15:51:44 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-21 20:39:31 -0400
commit70694a8bab22bd0cc98ff4ee5cc75fe9be30fcd0 (patch)
tree9dab5e6d7d17deda385f21cafb7035857d1db38c /arch/powerpc/platforms/cell/pervasive.c
parent880e710580c09bf86cddac687fc492a8318934fe (diff)
powerpc/cell: Cleanup sysreset_hack for IBM cell blades
This patch adds a config option for the sysreset_hack used for IBM Cell blades. The code is moves from pervasive.c into ras.c and gets it's own init method. Signed-off-by: Christian Krafft <krafft@de.ibm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/pervasive.c')
-rw-r--r--arch/powerpc/platforms/cell/pervasive.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c
index 8a3631ce912b..efdacc829576 100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
@@ -38,8 +38,6 @@
38 38
39#include "pervasive.h" 39#include "pervasive.h"
40 40
41static int sysreset_hack;
42
43static void cbe_power_save(void) 41static void cbe_power_save(void)
44{ 42{
45 unsigned long ctrl, thread_switch_control; 43 unsigned long ctrl, thread_switch_control;
@@ -87,9 +85,6 @@ static void cbe_power_save(void)
87 85
88static int cbe_system_reset_exception(struct pt_regs *regs) 86static int cbe_system_reset_exception(struct pt_regs *regs)
89{ 87{
90 int cpu;
91 struct cbe_pmd_regs __iomem *pmd;
92
93 switch (regs->msr & SRR1_WAKEMASK) { 88 switch (regs->msr & SRR1_WAKEMASK) {
94 case SRR1_WAKEEE: 89 case SRR1_WAKEEE:
95 do_IRQ(regs); 90 do_IRQ(regs);
@@ -98,19 +93,7 @@ static int cbe_system_reset_exception(struct pt_regs *regs)
98 timer_interrupt(regs); 93 timer_interrupt(regs);
99 break; 94 break;
100 case SRR1_WAKEMT: 95 case SRR1_WAKEMT:
101 /* 96 return cbe_sysreset_hack();
102 * The BMC can inject user triggered system reset exceptions,
103 * but cannot set the system reset reason in srr1,
104 * so check an extra register here.
105 */
106 if (sysreset_hack && (cpu = smp_processor_id()) == 0) {
107 pmd = cbe_get_cpu_pmd_regs(cpu);
108 if (in_be64(&pmd->ras_esc_0) & 0xffff) {
109 out_be64(&pmd->ras_esc_0, 0);
110 return 0;
111 }
112 }
113 break;
114#ifdef CONFIG_CBE_RAS 97#ifdef CONFIG_CBE_RAS
115 case SRR1_WAKESYSERR: 98 case SRR1_WAKESYSERR:
116 cbe_system_error_exception(regs); 99 cbe_system_error_exception(regs);
@@ -134,8 +117,6 @@ void __init cbe_pervasive_init(void)
134 if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO)) 117 if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO))
135 return; 118 return;
136 119
137 sysreset_hack = machine_is_compatible("IBM,CBPLUS-1.0");
138
139 for_each_possible_cpu(cpu) { 120 for_each_possible_cpu(cpu) {
140 struct cbe_pmd_regs __iomem *regs = cbe_get_cpu_pmd_regs(cpu); 121 struct cbe_pmd_regs __iomem *regs = cbe_get_cpu_pmd_regs(cpu);
141 if (!regs) 122 if (!regs)
@@ -144,12 +125,6 @@ void __init cbe_pervasive_init(void)
144 /* Enable Pause(0) control bit */ 125 /* Enable Pause(0) control bit */
145 out_be64(&regs->pmcr, in_be64(&regs->pmcr) | 126 out_be64(&regs->pmcr, in_be64(&regs->pmcr) |
146 CBE_PMD_PAUSE_ZERO_CONTROL); 127 CBE_PMD_PAUSE_ZERO_CONTROL);
147
148 /* Enable JTAG system-reset hack */
149 if (sysreset_hack)
150 out_be32(&regs->fir_mode_reg,
151 in_be32(&regs->fir_mode_reg) |
152 CBE_PMD_FIR_MODE_M8);
153 } 128 }
154 129
155 ppc_md.power_save = cbe_power_save; 130 ppc_md.power_save = cbe_power_save;