Fix up Sandybridge C state generation code
This code fixes the sandybridge C state generation code to work with the current version of the ACPI code generator. Change-Id: I56ae1185dc0694c06976236523fdcbe5c1795b01 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/950 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
f69b46805c
commit
c31384e62c
|
@ -152,6 +152,7 @@ struct cpu_device_id {
|
|||
struct cpu_driver {
|
||||
struct device_operations *ops;
|
||||
struct cpu_device_id *id_table;
|
||||
struct acpi_cstate *cstates;
|
||||
};
|
||||
|
||||
struct device;
|
||||
|
|
|
@ -76,12 +76,18 @@ static int generate_cstate_entries(acpi_cstate_t *cstates,
|
|||
length += acpigen_write_byte(cstate_count);
|
||||
|
||||
/* Add an entry if the level is enabled */
|
||||
if (c1 > 0)
|
||||
length += acpigen_write_CST_package(1, &cstates[c1]);
|
||||
if (c2 > 0)
|
||||
length += acpigen_write_CST_package(2, &cstates[c2]);
|
||||
if (c3 > 0)
|
||||
length += acpigen_write_CST_package(3, &cstates[c3]);
|
||||
if (c1 > 0) {
|
||||
cstates[c1].ctype = 1;
|
||||
length += acpigen_write_CST_package_entry(&cstates[c1]);
|
||||
}
|
||||
if (c2 > 0) {
|
||||
cstates[c2].ctype = 2;
|
||||
length += acpigen_write_CST_package_entry(&cstates[c2]);
|
||||
}
|
||||
if (c3 > 0) {
|
||||
cstates[c2].ctype = 2;
|
||||
length += acpigen_write_CST_package_entry(&cstates[c3]);
|
||||
}
|
||||
|
||||
acpigen_patch_len(length - 1);
|
||||
return length;
|
||||
|
|
Loading…
Reference in New Issue