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>
This commit is contained in:
Jonathon Hall 2023-04-07 14:43:25 -04:00 committed by Felix Held
parent 1ff8768c8c
commit 247ec33eb9
2 changed files with 9 additions and 0 deletions

View File

@ -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__ */

View File

@ -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