Chameleon

Chameleon Commit Details

Date:2015-01-02 01:28:07 (5 years 10 months ago)
Author:ErmaC
Commit:2527
Parents: 2526
Message:C6 & C7 States credits to Clover Team.
Changes:
M/trunk/doc/BootHelp.txt
M/trunk/i386/libsaio/state_generator.c
M/trunk/i386/boot2/boot.h
M/trunk/CHANGES
M/trunk/package/OptionalSettings/PowerManagement.txt

File differences

trunk/i386/libsaio/state_generator.c
386386
387387
388388
389
390
389391
390392
391393
392394
393395
396
397
394398
395399
396400
397401
398402
399
403
400404
401405
402406
......
456460
457461
458462
459
460
463
464
461465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
462492
463493
464494
......
500530
501531
502532
503
504
533
534
505535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
506554
507555
508556
bool c2_enabled = false;
bool c3_enabled = false;
bool c4_enabled = false;
bool c6_enabled = false;
bool c7_enabled = false;
bool cst_using_systemio = false;
getBoolForKey(kEnableC2State, &c2_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC3State, &c3_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC4State, &c4_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC6State, &c6_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC7State, &c7_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kCSTUsingSystemIO, &cst_using_systemio, &bootInfo->chameleonConfig);
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);
unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + ((c3_enabled || c4_enabled)? 1 : 0) + (c6_enabled ? 1 : 0) + (c7_enabled ? 1 : 0);
AML_CHUNK* root = aml_create_node(NULL);
aml_add_buffer(root, cst_ssdt_header, sizeof(cst_ssdt_header)); // SSDT header
resource_template_register_systemio[12] = p_blk_hi; // C3
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x03);// C3
aml_add_word(tmpl, 0x0060);// Latency
aml_add_dword(tmpl, 0x0000015e);// Power
aml_add_word(tmpl, 0x0043);// Latency
aml_add_dword(tmpl, 0x000001F4);// Power
}
if (c6_enabled) // C6
{
p_blk_lo = acpi_cpu_p_blk + 5;
p_blk_hi = (acpi_cpu_p_blk + 5) >> 8;
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C6
resource_template_register_systemio[12] = p_blk_hi; // C6
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x06);// C6
aml_add_word(tmpl, 0x0046);// Latency
aml_add_dword(tmpl, 0x0000015E);// Power
}
if (c7_enabled) //C7
{
p_blk_lo = (acpi_cpu_p_blk + 6) & 0xff;
p_blk_hi = (acpi_cpu_p_blk + 5) >> 8;
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C4 or C7
resource_template_register_systemio[12] = p_blk_hi;
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x07);// C7
aml_add_word(tmpl, 0xF5);// Latency as in iMac14,1
aml_add_dword(tmpl, 0xC8);// Power
}
}
else
{
resource_template_register_fixedhw[11] = 0x20; // C3
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x03);// C3
aml_add_word(tmpl, 0x0060);// Latency
aml_add_dword(tmpl, 0x0000015e);// Power
aml_add_word(tmpl, 0x0043);// Latency
aml_add_dword(tmpl, 0x000001F4);// Power
}
if (c6_enabled) // C6
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x20; // C6
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x06);// C6
aml_add_word(tmpl, 0x0046);// Latency as in MacPro6,1
aml_add_dword(tmpl, 0x0000015E);// Power
}
if (c7_enabled) // C7
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x30; // C4 or C7
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x07);// C7
aml_add_word(tmpl, 0xF5);// Latency as in iMac14,1
aml_add_dword(tmpl, 0xC8);// Power
}
}
// Aliaces
trunk/i386/boot2/boot.h
143143
144144
145145
146
147
146148
147149
148150
#define kEnableC2State"EnableC2State"/* acpi_patcher.c */
#define kEnableC3State"EnableC3State"/* acpi_patcher.c */
#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
#define kEnableC6State"EnableC6State"/* acpi_patcher.c */
#define kEnableC7State"EnableC7State"/* acpi_patcher.c */
/* valv: added these keys */
#define kbusratio"busratio"/* cpu.c */
trunk/package/OptionalSettings/PowerManagement.txt
3030
3131
3232
33
34
33
34
3535
3636
Bool@EnableC2State:EnableC2State=Yes
Bool@EnableC3State:EnableC3State=Yes
Bool@EnableC4State:EnableC4State=Yes
#Bool@EnableC6State:EnableC6State=Yes
#Bool@EnableC7State:EnableC7State=Yes
Bool@EnableC6State:EnableC6State=Yes
Bool@EnableC7State:EnableC7State=Yes
Bool@GenerateCStates:GenerateCStates=Yes
Bool@GeneratePStates:GeneratePStates=Yes
trunk/doc/BootHelp.txt
136136
137137
138138
139
140
139141
140142
141143
EnableC2State=Yes Enable specific Processor power state, C2.
EnableC3State=Yes Enable specific Processor power state, C3.
EnableC4State=Yes Enable specific Processor power state, C4.
EnableC6State=Yes Enable specific Processor power state, C6.
EnableC7State=Yes Enable specific Processor power state, C7.
PrivateData=No Show masked data (serial number) in bdmesg log (enbaled by default).
trunk/CHANGES
1
12
23
34
- ErmaC : C6 & C7 States credits to Clover Team.
- ErmaC : define recursive cpu series for BrandString
- Zenith432 : saio_types.h, biosfn.c - minor typo in bios-defined data structure that isn't actually used.
fake_efi.c - eliminate redundant scan of bt(0,0) in setupSmbiosConfigFile. loadConfigFile already does a fall-back scan of bt(0,0), so another scan isn't needed.

Archive Download the corresponding diff file

Revision: 2527