From 5c8ff794a8dcb0760c137d3b2dff1879a4a8dad6 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 13 Dec 2019 11:12:33 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/37692 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- src/superio/common/ssdt.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/superio/common') diff --git a/src/superio/common/ssdt.c b/src/superio/common/ssdt.c index bc5d39460a..41cafdfb0e 100644 --- a/src/superio/common/ssdt.c +++ b/src/superio/common/ssdt.c @@ -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 */ } -- cgit v1.2.3