soc/intel/common/acpi: Don't generate LPI constraints for disabled/hidden devices

When walking the devicetree to generate the list of devices and minimum
sleep states, skip any devices which have the disable or hidden flags
set. This prevents adding entries for devices which are not present,
which are hidden (and likely to not have a min sleep state entry), or
generating duplicate entries in the case of PCIe remapping.

Any of these conditions are considered invalid by Windows and will
result in a BSOD with an INTERNAL_POWER_ERROR.

TEST=tested with rest of patch train

Change-Id: I06f64a72c82b9e03dc8af18700d24b3d10b7d3a7
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78518
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
diff --git a/src/soc/intel/common/block/acpi/pep.c b/src/soc/intel/common/block/acpi/pep.c
index 5e03345..39f9542 100644
--- a/src/soc/intel/common/block/acpi/pep.c
+++ b/src/soc/intel/common/block/acpi/pep.c
@@ -169,6 +169,8 @@
 
 	if (size && states_arr) {
 		for (dev = all_devices; dev; dev = dev->next) {
+			if (!dev->enabled || dev->hidden)
+				continue;
 			if (get_min_sleep_state(dev, states_arr, size)
 				!= ACPI_DEVICE_SLEEP_NONE)
 				num_entries++;
@@ -182,6 +184,8 @@
 
 		size_t cpu_index = 0;
 		for (dev = all_devices; dev; dev = dev->next) {
+			if (!dev->enabled || dev->hidden)
+				continue;
 			min_sleep_state = get_min_sleep_state(dev, states_arr, size);
 			if (min_sleep_state == ACPI_DEVICE_SLEEP_NONE)
 				continue;