aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/csrc-ioasic.c8
-rw-r--r--arch/mips/kernel/smp-cmp.c13
-rw-r--r--arch/mips/kernel/vpe.c2
3 files changed, 19 insertions, 4 deletions
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c
index 87e88feb4a25..6cbbf6e106b9 100644
--- a/arch/mips/kernel/csrc-ioasic.c
+++ b/arch/mips/kernel/csrc-ioasic.c
@@ -37,7 +37,7 @@ static struct clocksource clocksource_dec = {
37 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 37 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
38}; 38};
39 39
40void __init dec_ioasic_clocksource_init(void) 40int __init dec_ioasic_clocksource_init(void)
41{ 41{
42 unsigned int freq; 42 unsigned int freq;
43 u32 start, end; 43 u32 start, end;
@@ -56,8 +56,14 @@ void __init dec_ioasic_clocksource_init(void)
56 end = dec_ioasic_hpt_read(&clocksource_dec); 56 end = dec_ioasic_hpt_read(&clocksource_dec);
57 57
58 freq = (end - start) * 8; 58 freq = (end - start) * 8;
59
60 /* An early revision of the I/O ASIC didn't have the counter. */
61 if (!freq)
62 return -ENXIO;
63
59 printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); 64 printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq);
60 65
61 clocksource_dec.rating = 200 + freq / 10000000; 66 clocksource_dec.rating = 200 + freq / 10000000;
62 clocksource_register_hz(&clocksource_dec, freq); 67 clocksource_register_hz(&clocksource_dec, freq);
68 return 0;
63} 69}
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index c2e5d74739b4..5969f1e9b62a 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -99,7 +99,9 @@ static void cmp_init_secondary(void)
99 99
100 c->core = (read_c0_ebase() >> 1) & 0x1ff; 100 c->core = (read_c0_ebase() >> 1) & 0x1ff;
101#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) 101#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
102 c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; 102 if (cpu_has_mipsmt)
103 c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) &
104 TCBIND_CURVPE;
103#endif 105#endif
104#ifdef CONFIG_MIPS_MT_SMTC 106#ifdef CONFIG_MIPS_MT_SMTC
105 c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT; 107 c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT;
@@ -177,9 +179,16 @@ void __init cmp_smp_setup(void)
177 } 179 }
178 180
179 if (cpu_has_mipsmt) { 181 if (cpu_has_mipsmt) {
180 unsigned int nvpe, mvpconf0 = read_c0_mvpconf0(); 182 unsigned int nvpe = 1;
183#ifdef CONFIG_MIPS_MT_SMP
184 unsigned int mvpconf0 = read_c0_mvpconf0();
185
186 nvpe = ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
187#elif defined(CONFIG_MIPS_MT_SMTC)
188 unsigned int mvpconf0 = read_c0_mvpconf0();
181 189
182 nvpe = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; 190 nvpe = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
191#endif
183 smp_num_siblings = nvpe; 192 smp_num_siblings = nvpe;
184 } 193 }
185 pr_info("Detected %i available secondary CPU(s)\n", ncpu); 194 pr_info("Detected %i available secondary CPU(s)\n", ncpu);
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index faf84c5f2629..59b2b3cd7885 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1368,7 +1368,7 @@ out_einval:
1368} 1368}
1369static DEVICE_ATTR_RW(ntcs); 1369static DEVICE_ATTR_RW(ntcs);
1370 1370
1371static struct attribute vpe_attrs[] = { 1371static struct attribute *vpe_attrs[] = {
1372 &dev_attr_kill.attr, 1372 &dev_attr_kill.attr,
1373 &dev_attr_ntcs.attr, 1373 &dev_attr_ntcs.attr,
1374 NULL, 1374 NULL,