Chameleon

Chameleon Commit Details

Date:2010-10-28 01:56:31 (13 years 5 months ago)
Author:Azimutz
Commit:617
Parents: 616
Message:Trunk it: adding some dirty stuff from rev 609 :P Namely, dirty algo for PSS generation for Core iX processors plus two new keys: EnableC2State and EnableC3State, to enable C2 and C3 C-States generation, respectively.
Changes:
M/branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c
M/branches/azimutz/Chazi/i386/boot2/boot.h

File differences

branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c
281281
282282
283283
284
285
284
285
286286
287287
288
289
288290
291
292
293
289294
290295
291296
......
477482
478483
479484
480
485
481486
482487
483488
......
527532
528533
529534
530
535
536
537
531538
532539
533540
......
535542
536543
537544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
538574
539575
540576
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(kEnableC4StatesKey, &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:
{
// Is it allways the maximum multiplier?
maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff;
// 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;
branches/azimutz/Chazi/i386/boot2/boot.h
9797
9898
9999
100
100
101101
102
102
103103
104104
105105
......
116116
117117
118118
119
120
121
119
120
121
122
123
122124
123125
124126
#define kBootUUIDKey "boot-uuid" // options.cprocessBootArg- kFlag
#define kHelperRootUUIDKey "Root UUID" // options.cgetValFK
#define kArchKey "arch" // boot.cgetValFK- kFlag
#define kKernelNameKey "Kernel" // options.cgetValFK
#define kKernelNameKey "Kernel" // options.cgetValFK- kFlag*** bFlag ?
#define kKernelCacheKey "Kernel Cache" // boot.cgetValFK- kFlag
#define kKernelFlagsKey "Kernel Flags" // options.cgetValFK
#define kKernelFlagsKey "Kernel Flags" // options.cgetValFK- kFlags***
#define kKPatcherKey "PatchKernel" // kernel_patcher.cgetBoolFK
#define kAltExtensionsKey "kext" // drivers.cgetValFK
#define kMKextCacheKey "MKext Cache" // options.cgetValFK- kFlag
#define kDSDTKey "DSDT" // acpi_patcher.cgetValFK
#define kDropSSDTKey "DropSSDT" // acpi_patcher.cgetBoolFK
#define kRestartFixKey "RestartFix" // acpi_patcher.cgetBoolFK- revert to true?
#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.cgetBoolFK
#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.cgetBoolFK
#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.cgetBoolFK
#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.cgetBoolFK- add to BootHelp***
#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.cgetBoolFK||
#define kEnableC2States "EnableC2State" // acpi_patcher.cgetBoolFK||
#define kEnableC3States "EnableC3State" // acpi_patcher.cgetBoolFK||
#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.cgetBoolFK||
#define kUseMemDetectKey "UseMemDetect" // platform.cgetBoolFK
#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.cgetBoolFK
#define kSMBIOSKey "SMBIOS" // fake_efi.cgetValFK

Archive Download the corresponding diff file

Revision: 617