superio/common/generic: Assign resources behind device

If multiple devices are behind a dev, we would only recognise port 0. We
need to scan the complete 'bus'.

Tested on ASpeed AST2500

Change-Id: Id80a2ae6e82c151b8d8adc9c5f35f38362d538fa
Signed-off-by: Christian Walter <christian.walter@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37607
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/superio/common/generic.c b/src/superio/common/generic.c
index 429ee51..7ac1f83 100644
--- a/src/superio/common/generic.c
+++ b/src/superio/common/generic.c
@@ -21,6 +21,9 @@
 {
 	struct resource *res;
 
+	if (dev->link_list)
+		assign_resources(dev->link_list);
+
 	for (res = dev->resource_list; res; res = res->next) {
 		if (!(res->flags & IORESOURCE_ASSIGNED))
 			continue;
@@ -167,6 +170,7 @@
 	.read_resources   = generic_read_resources,
 	.set_resources    = generic_set_resources,
 	.enable_resources = DEVICE_NOOP,
+	.scan_bus	  = scan_static_bus,
 #if CONFIG(HAVE_ACPI_TABLES)
 	.acpi_fill_ssdt_generator = generic_ssdt,
 	.acpi_name = generic_acpi_name,
@@ -182,11 +186,6 @@
 	else
 		dev->ops = &ops;
 
-	/*
-	 * Need to call enable_dev() on the devices "behind" the Generic Super I/O.
-	 * coreboot's generic allocator doesn't expect them behind PnP devices.
-	 */
-	enable_static_devices(dev);
 }
 
 struct chip_operations superio_common_ops = {