diff options
Diffstat (limited to 'arch/x86/platform/mrst/mrst.c')
-rw-r--r-- | arch/x86/platform/mrst/mrst.c | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index 475e2cd0f3c3..6743587575a6 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -78,16 +78,11 @@ int sfi_mrtc_num; | |||
78 | 78 | ||
79 | static void mrst_power_off(void) | 79 | static void mrst_power_off(void) |
80 | { | 80 | { |
81 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
82 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1); | ||
83 | } | 81 | } |
84 | 82 | ||
85 | static void mrst_reboot(void) | 83 | static void mrst_reboot(void) |
86 | { | 84 | { |
87 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | 85 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); |
88 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0); | ||
89 | else | ||
90 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); | ||
91 | } | 86 | } |
92 | 87 | ||
93 | /* parse all the mtimer info to a static mtimer array */ | 88 | /* parse all the mtimer info to a static mtimer array */ |
@@ -200,34 +195,28 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table) | |||
200 | 195 | ||
201 | static unsigned long __init mrst_calibrate_tsc(void) | 196 | static unsigned long __init mrst_calibrate_tsc(void) |
202 | { | 197 | { |
203 | unsigned long flags, fast_calibrate; | 198 | unsigned long fast_calibrate; |
204 | if (__mrst_cpu_chip == MRST_CPU_CHIP_PENWELL) { | 199 | u32 lo, hi, ratio, fsb; |
205 | u32 lo, hi, ratio, fsb; | 200 | |
206 | 201 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); | |
207 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); | 202 | pr_debug("IA32 perf status is 0x%x, 0x%0x\n", lo, hi); |
208 | pr_debug("IA32 perf status is 0x%x, 0x%0x\n", lo, hi); | 203 | ratio = (hi >> 8) & 0x1f; |
209 | ratio = (hi >> 8) & 0x1f; | 204 | pr_debug("ratio is %d\n", ratio); |
210 | pr_debug("ratio is %d\n", ratio); | 205 | if (!ratio) { |
211 | if (!ratio) { | 206 | pr_err("read a zero ratio, should be incorrect!\n"); |
212 | pr_err("read a zero ratio, should be incorrect!\n"); | 207 | pr_err("force tsc ratio to 16 ...\n"); |
213 | pr_err("force tsc ratio to 16 ...\n"); | 208 | ratio = 16; |
214 | ratio = 16; | ||
215 | } | ||
216 | rdmsr(MSR_FSB_FREQ, lo, hi); | ||
217 | if ((lo & 0x7) == 0x7) | ||
218 | fsb = PENWELL_FSB_FREQ_83SKU; | ||
219 | else | ||
220 | fsb = PENWELL_FSB_FREQ_100SKU; | ||
221 | fast_calibrate = ratio * fsb; | ||
222 | pr_debug("read penwell tsc %lu khz\n", fast_calibrate); | ||
223 | lapic_timer_frequency = fsb * 1000 / HZ; | ||
224 | /* mark tsc clocksource as reliable */ | ||
225 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); | ||
226 | } else { | ||
227 | local_irq_save(flags); | ||
228 | fast_calibrate = apbt_quick_calibrate(); | ||
229 | local_irq_restore(flags); | ||
230 | } | 209 | } |
210 | rdmsr(MSR_FSB_FREQ, lo, hi); | ||
211 | if ((lo & 0x7) == 0x7) | ||
212 | fsb = PENWELL_FSB_FREQ_83SKU; | ||
213 | else | ||
214 | fsb = PENWELL_FSB_FREQ_100SKU; | ||
215 | fast_calibrate = ratio * fsb; | ||
216 | pr_debug("read penwell tsc %lu khz\n", fast_calibrate); | ||
217 | lapic_timer_frequency = fsb * 1000 / HZ; | ||
218 | /* mark tsc clocksource as reliable */ | ||
219 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); | ||
231 | 220 | ||
232 | if (fast_calibrate) | 221 | if (fast_calibrate) |
233 | return fast_calibrate; | 222 | return fast_calibrate; |
@@ -261,16 +250,11 @@ static void __cpuinit mrst_arch_setup(void) | |||
261 | { | 250 | { |
262 | if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) | 251 | if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) |
263 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; | 252 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; |
264 | else if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x26) | ||
265 | __mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT; | ||
266 | else { | 253 | else { |
267 | pr_err("Unknown Moorestown CPU (%d:%d), default to Lincroft\n", | 254 | pr_err("Unknown Intel MID CPU (%d:%d), default to Penwell\n", |
268 | boot_cpu_data.x86, boot_cpu_data.x86_model); | 255 | boot_cpu_data.x86, boot_cpu_data.x86_model); |
269 | __mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT; | 256 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; |
270 | } | 257 | } |
271 | pr_debug("Moorestown CPU %s identified\n", | ||
272 | (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) ? | ||
273 | "Lincroft" : "Penwell"); | ||
274 | } | 258 | } |
275 | 259 | ||
276 | /* MID systems don't have i8042 controller */ | 260 | /* MID systems don't have i8042 controller */ |