Chameleon

Chameleon Commit Details

Date:2010-10-24 05:30:11 (8 years 9 months ago)
Author:mozo
Commit:609
Parents: 608
Message:Added dirty algo for PSS generation for Core iX processors. Added options to force C2 and C3 C-States generation.
Changes:
M/trunk/i386/libsaio/acpi_patcher.c
M/trunk/i386/boot2/boot.h

File differences

trunk/i386/libsaio/acpi_patcher.c
233233
234234
235235
236
237
236
237
238238
239239
240
241
240242
243
244
245
241246
242247
243248
......
429434
430435
431436
432
437
433438
434439
435440
......
479484
480485
481486
482
487
488
489
483490
484491
485492
......
487494
488495
489496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
490527
491528
492529
if (acpi_cpu_count > 0)
{
bool c2_enabled = fadt->C2_Latency < 100;
bool c3_enabled = fadt->C3_Latency < 1000;
bool c2_enabled = false;
bool c3_enabled = false;
bool c4_enabled = false;
getBoolForKey(kEnableC2States, &c2_enabled, &bootInfo->bootConfig);
getBoolForKey(kEnableC3States, &c3_enabled, &bootInfo->bootConfig);
getBoolForKey(kEnableC4States, &c4_enabled, &bootInfo->bootConfig);
c2_enabled = c2_enabled | (fadt->C2_Latency < 100);
c3_enabled = c3_enabled | (fadt->C3_Latency < 1000);
unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0);
if (maximum.CID < minimum.CID)
{
DBG("Insane FID values!");
p_states_count = 1;
p_states_count = 0;
}
else
{
p_states_count -= invalid;
}
} break;
break;
}
case CPU_MODEL_FIELDS:
case CPU_MODEL_DALES:
case CPU_MODEL_DALES_32NM:
case CPU_MODEL_NEHALEM_EX:
case CPU_MODEL_WESTMERE:
case CPU_MODEL_WESTMERE_EX:
{
uint8_t i;
maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; // Is it allways the maximum multiplier?
// fix me: dirty method to get lowest multiplier... Hardcoded value!
minimum.Control = 0x09;
// Sanity check
if (maximum.Control < minimum.Control)
{
DBG("Insane control values!");
p_states_count = 0;
}
else
{
uint8_t i;
p_states_count = 0;
for (i = maximum.Control; i >= minimum.Control; i--)
{
p_states[p_states_count].Control = i;
p_states[p_states_count].CID = p_states[p_states_count].Control << 1;
p_states[p_states_count].Frequency = (Platform.CPU.FSBFrequency / 1000000) * i;
p_states_count++;
}
}
break;
}
default:
verbose ("Unsupported CPU: P-States not generated !!!\n");
break;
trunk/i386/boot2/boot.h
7070
7171
7272
73
74
7375
7476
7577
#define kRestartFix"RestartFix"/* acpi_patcher.c */
#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
#define kEnableC2States"EnableC2State"/* acpi_patcher.c */
#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
#define kDeviceProperties"device-properties"/* device_inject.c */
#define kHidePartition"Hide Partition"/* disk.c */

Archive Download the corresponding diff file

Revision: 609