superio/common/ssdt: Make disabled PNP devices ACPI compliant

Always write a _HID, even for disabled PNP devices.

Fixes a BSOD on Windows 10.

Change-Id: I419a08bd6a3570fb4e1ae31bef4f9ccd6836fe1b
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37692
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
This commit is contained in:
Patrick Rudolph 2019-12-13 11:12:33 +01:00 committed by Felix Held
parent 1aba2a32e8
commit 5c8ff794a8
1 changed files with 22 additions and 22 deletions

View File

@ -219,28 +219,11 @@ void superio_common_fill_ssdt_generator(struct device *dev)
}
acpigen_pop_len(); /* Method */
if (!dev->enabled) {
acpigen_pop_len(); /* Device */
acpigen_pop_len(); /* Scope */
return;
}
if (has_resources(dev)) {
/* Resources - _CRS */
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
ldn_gen_resources(dev);
acpigen_write_resourcetemplate_footer();
/* Resources - _PRS */
acpigen_write_name("_PRS");
acpigen_write_resourcetemplate_header();
ldn_gen_resources(dev);
acpigen_write_resourcetemplate_footer();
/* Resources base and size for 3rd party ACPI code */
ldn_gen_resources_use(dev);
}
/*
* The ACPI6.2 spec Chapter 6.1.5 requires to set a _HID if no _ADR
* is present. Tests on Windows 10 showed that this is also true for
* disabled (_STA = 0) devices, otherwise it BSODs.
*/
hid = acpi_device_hid(dev);
if (!hid) {
@ -266,6 +249,23 @@ void superio_common_fill_ssdt_generator(struct device *dev)
}
acpigen_pop_len(); /* Method */
if (dev->enabled && has_resources(dev)) {
/* Resources - _CRS */
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
ldn_gen_resources(dev);
acpigen_write_resourcetemplate_footer();
/* Resources - _PRS */
acpigen_write_name("_PRS");
acpigen_write_resourcetemplate_header();
ldn_gen_resources(dev);
acpigen_write_resourcetemplate_footer();
/* Resources base and size for 3rd party ACPI code */
ldn_gen_resources_use(dev);
}
acpigen_pop_len(); /* Device */
acpigen_pop_len(); /* Scope */
}