summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathon Hall <jonathon.hall@puri.sm>2023-04-07 14:43:25 -0400
committerFelix Held <felix-coreboot@felixheld.de>2023-05-26 19:21:12 +0000
commit247ec33eb995ebb10b423f86e965666e3a0ac8fa (patch)
tree9f0030c2ac56b2bcb5c2d8e904225d54791e5dc5 /src
parent1ff8768c8ccf22917f9dba4c780f3bdca4a72fde (diff)
superio/common: Support more than one SuperIO in ACPI
The SuperIO ACPI name was hard-coded to "SIO0". Allow setting the name in the device tree so more than one SuperIO can be named. An upcoming board (purism/librem_l1um_v2) has two SuperIOs - one in the AST2500 BMC, and a Nuvoton NCT6791D used for hardware monitor, POST display, etc. Many boards have references to SIO0 already, so the default name is still the same for a single SuperIO. Change-Id: Ibfa6ab7622749e6310ee91530bc3722e8e28d9bb Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm> Reviewed-on: https://review.coreboot.org/c/coreboot/+/75089 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/superio/common/chip.h3
-rw-r--r--src/superio/common/generic.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/superio/common/chip.h b/src/superio/common/chip.h
index 737c90c500..2836a522f1 100644
--- a/src/superio/common/chip.h
+++ b/src/superio/common/chip.h
@@ -5,6 +5,9 @@
struct superio_common_config {
/* FIXME: Add enter conf/exit conf codes here for SSDT generation */
+ /* Rarely, boards may have more than one SuperIO. Give each SuperIO a
+ * unique name for ACPI. The default is 'SIO0'. */
+ char acpi_name[5];
};
#endif /* __SUPERIO_COMMON_CHIP_H__ */
diff --git a/src/superio/common/generic.c b/src/superio/common/generic.c
index 83f2fea2b2..c6903402a0 100644
--- a/src/superio/common/generic.c
+++ b/src/superio/common/generic.c
@@ -4,6 +4,7 @@
#include <device/pnp.h>
#include <acpi/acpigen.h>
#include <console/console.h>
+#include "chip.h"
static void generic_set_resources(struct device *dev)
{
@@ -292,6 +293,11 @@ static void generic_ssdt(const struct device *dev)
static const char *generic_acpi_name(const struct device *dev)
{
+ const struct superio_common_config *cfg = dev->chip_info;
+ if (cfg && cfg->acpi_name[sizeof(cfg->acpi_name)-1] == '\0' &&
+ strlen(cfg->acpi_name) == 4) {
+ return cfg->acpi_name;
+ }
return "SIO0";
}
#endif