aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2007-02-02 11:48:19 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:22 -0500
commitad71860a17ba33eb0e673e9e2cf5ba0d8e3e3fdd (patch)
tree9f60547a2e8782c04d7cd1c41bc874047008458c /drivers/acpi/processor_idle.c
parenta4bbb810dedaecf74d54b16b6dd3c33e95e1024c (diff)
ACPICA: minimal patch to integrate new tables into Linux
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 3f30af21574e..9fa3d3965bb3 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -160,7 +160,7 @@ static inline u32 ticks_elapsed(u32 t1, u32 t2)
160{ 160{
161 if (t2 >= t1) 161 if (t2 >= t1)
162 return (t2 - t1); 162 return (t2 - t1);
163 else if (!acpi_fadt.tmr_val_ext) 163 else if (!(acpi_fadt.flags & ACPI_FADT_32BIT_TIMER))
164 return (((0x00FFFFFF - t1) + t2) & 0x00FFFFFF); 164 return (((0x00FFFFFF - t1) + t2) & 0x00FFFFFF);
165 else 165 else
166 return ((0xFFFFFFFF - t1) + t2); 166 return ((0xFFFFFFFF - t1) + t2);
@@ -236,7 +236,7 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
236 /* Dummy wait op - must do something useless after P_LVL2 read 236 /* Dummy wait op - must do something useless after P_LVL2 read
237 because chipsets cannot guarantee that STPCLK# signal 237 because chipsets cannot guarantee that STPCLK# signal
238 gets asserted in time to freeze execution properly. */ 238 gets asserted in time to freeze execution properly. */
239 unused = inl(acpi_fadt.xpm_tmr_blk.address); 239 unused = inl(acpi_fadt.xpm_timer_block.address);
240 } 240 }
241} 241}
242 242
@@ -338,7 +338,7 @@ static void acpi_processor_idle(void)
338 * detection phase, to work cleanly with logical CPU hotplug. 338 * detection phase, to work cleanly with logical CPU hotplug.
339 */ 339 */
340 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && 340 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
341 !pr->flags.has_cst && !acpi_fadt.plvl2_up) 341 !pr->flags.has_cst && !(acpi_fadt.flags & ACPI_FADT_C2_MP_SUPPORTED))
342 cx = &pr->power.states[ACPI_STATE_C1]; 342 cx = &pr->power.states[ACPI_STATE_C1];
343#endif 343#endif
344 344
@@ -384,11 +384,11 @@ static void acpi_processor_idle(void)
384 384
385 case ACPI_STATE_C2: 385 case ACPI_STATE_C2:
386 /* Get start time (ticks) */ 386 /* Get start time (ticks) */
387 t1 = inl(acpi_fadt.xpm_tmr_blk.address); 387 t1 = inl(acpi_fadt.xpm_timer_block.address);
388 /* Invoke C2 */ 388 /* Invoke C2 */
389 acpi_cstate_enter(cx); 389 acpi_cstate_enter(cx);
390 /* Get end time (ticks) */ 390 /* Get end time (ticks) */
391 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 391 t2 = inl(acpi_fadt.xpm_timer_block.address);
392 392
393#ifdef CONFIG_GENERIC_TIME 393#ifdef CONFIG_GENERIC_TIME
394 /* TSC halts in C2, so notify users */ 394 /* TSC halts in C2, so notify users */
@@ -420,11 +420,11 @@ static void acpi_processor_idle(void)
420 } 420 }
421 421
422 /* Get start time (ticks) */ 422 /* Get start time (ticks) */
423 t1 = inl(acpi_fadt.xpm_tmr_blk.address); 423 t1 = inl(acpi_fadt.xpm_timer_block.address);
424 /* Invoke C3 */ 424 /* Invoke C3 */
425 acpi_cstate_enter(cx); 425 acpi_cstate_enter(cx);
426 /* Get end time (ticks) */ 426 /* Get end time (ticks) */
427 t2 = inl(acpi_fadt.xpm_tmr_blk.address); 427 t2 = inl(acpi_fadt.xpm_timer_block.address);
428 if (pr->flags.bm_check) { 428 if (pr->flags.bm_check) {
429 /* Enable bus master arbitration */ 429 /* Enable bus master arbitration */
430 atomic_dec(&c3_cpu_count); 430 atomic_dec(&c3_cpu_count);
@@ -457,7 +457,7 @@ static void acpi_processor_idle(void)
457#ifdef CONFIG_HOTPLUG_CPU 457#ifdef CONFIG_HOTPLUG_CPU
458 /* Don't do promotion/demotion */ 458 /* Don't do promotion/demotion */
459 if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) && 459 if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) &&
460 !pr->flags.has_cst && !acpi_fadt.plvl2_up) { 460 !pr->flags.has_cst && !(acpi_fadt.flags & ACPI_FADT_C2_MP_SUPPORTED)) {
461 next_state = cx; 461 next_state = cx;
462 goto end; 462 goto end;
463 } 463 }
@@ -627,7 +627,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
627 * Check for P_LVL2_UP flag before entering C2 and above on 627 * Check for P_LVL2_UP flag before entering C2 and above on
628 * an SMP system. 628 * an SMP system.
629 */ 629 */
630 if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) 630 if ((num_online_cpus() > 1) &&
631 !(acpi_fadt.flags & ACPI_FADT_C2_MP_SUPPORTED))
631 return -ENODEV; 632 return -ENODEV;
632#endif 633#endif
633 634
@@ -636,8 +637,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
636 pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; 637 pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5;
637 638
638 /* determine latencies from FADT */ 639 /* determine latencies from FADT */
639 pr->power.states[ACPI_STATE_C2].latency = acpi_fadt.plvl2_lat; 640 pr->power.states[ACPI_STATE_C2].latency = acpi_fadt.C2latency;
640 pr->power.states[ACPI_STATE_C3].latency = acpi_fadt.plvl3_lat; 641 pr->power.states[ACPI_STATE_C3].latency = acpi_fadt.C3latency;
641 642
642 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 643 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
643 "lvl2[0x%08x] lvl3[0x%08x]\n", 644 "lvl2[0x%08x] lvl3[0x%08x]\n",
@@ -883,7 +884,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
883 * WBINVD should be set in fadt, for C3 state to be 884 * WBINVD should be set in fadt, for C3 state to be
884 * supported on when bm_check is not required. 885 * supported on when bm_check is not required.
885 */ 886 */
886 if (acpi_fadt.wb_invd != 1) { 887 if (!(acpi_fadt.flags & ACPI_FADT_WBINVD)) {
887 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 888 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
888 "Cache invalidation should work properly" 889 "Cache invalidation should work properly"
889 " for C3 to be enabled on SMP systems\n")); 890 " for C3 to be enabled on SMP systems\n"));
@@ -1164,9 +1165,9 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1164 if (!pr) 1165 if (!pr)
1165 return -EINVAL; 1166 return -EINVAL;
1166 1167
1167 if (acpi_fadt.cst_cnt && !nocst) { 1168 if (acpi_fadt.cst_control && !nocst) {
1168 status = 1169 status =
1169 acpi_os_write_port(acpi_fadt.smi_cmd, acpi_fadt.cst_cnt, 8); 1170 acpi_os_write_port(acpi_fadt.smi_command, acpi_fadt.cst_control, 8);
1170 if (ACPI_FAILURE(status)) { 1171 if (ACPI_FAILURE(status)) {
1171 ACPI_EXCEPTION((AE_INFO, status, 1172 ACPI_EXCEPTION((AE_INFO, status,
1172 "Notifying BIOS of _CST ability failed")); 1173 "Notifying BIOS of _CST ability failed"));