From a8a9fb08ddef31f7d5810e5d31a1d5e63f4bef9a Mon Sep 17 00:00:00 2001 From: Christian Walter Date: Thu, 6 Jun 2019 15:09:49 +0200 Subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen Use the new SuperIO ACPI generator to make includes in DSDT obsolete. Manually tested on X11SSH-TF and verified that ACPI tables are correct. Change-Id: I2ef49bb6f733994b249ae46f0460234380b552b8 Signed-off-by: Christian Walter Reviewed-on: https://review.coreboot.org/c/coreboot/+/33253 Reviewed-by: Felix Held Tested-by: build bot (Jenkins) --- src/superio/aspeed/ast2400/Makefile.inc | 2 ++ src/superio/aspeed/ast2400/superio.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'src/superio/aspeed/ast2400') diff --git a/src/superio/aspeed/ast2400/Makefile.inc b/src/superio/aspeed/ast2400/Makefile.inc index a6f8b2003a..625390fdf8 100644 --- a/src/superio/aspeed/ast2400/Makefile.inc +++ b/src/superio/aspeed/ast2400/Makefile.inc @@ -16,3 +16,5 @@ ## ramstage-$(CONFIG_SUPERIO_ASPEED_AST2400) += superio.c +ramstage-$(CONFIG_SUPERIO_ASPEED_AST2400) += ../../common/ssdt.c +ramstage-$(CONFIG_SUPERIO_ASPEED_AST2400) += ../../common/generic.c diff --git a/src/superio/aspeed/ast2400/superio.c b/src/superio/aspeed/ast2400/superio.c index dcb14fa668..54f3f3430d 100644 --- a/src/superio/aspeed/ast2400/superio.c +++ b/src/superio/aspeed/ast2400/superio.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "ast2400.h" static void ast2400_init(struct device *dev) @@ -36,6 +38,32 @@ static void ast2400_init(struct device *dev) } } +#if CONFIG(HAVE_ACPI_TABLES) +/* Provide ACPI HIDs for generic Super I/O SSDT */ +static const char *ast2400_acpi_hid(const struct device *dev) +{ + /* Sanity checks */ + if (dev->path.type != DEVICE_PATH_PNP) + return NULL; + if (dev->path.pnp.port == 0) + return NULL; + if ((dev->path.pnp.device & 0xff) > AST2400_MAILBOX) + return NULL; + + switch (dev->path.pnp.device & 0xff) { + case AST2400_SUART1: /* falltrough */ + case AST2400_SUART2: /* falltrough */ + case AST2400_SUART3: /* falltrough */ + case AST2400_SUART4: + return ACPI_HID_COM; + case AST2400_KBC: + return ACPI_HID_KEYBOARD; + default: + return ACPI_HID_PNP; + } +} +#endif + static struct device_operations ops = { .read_resources = pnp_read_resources, .set_resources = pnp_set_resources, @@ -43,6 +71,11 @@ static struct device_operations ops = { .enable = pnp_enable, .init = ast2400_init, .ops_pnp_mode = &pnp_conf_mode_a5a5_aa, +#if CONFIG(HAVE_ACPI_TABLES) + .acpi_fill_ssdt_generator = superio_common_fill_ssdt_generator, + .acpi_name = superio_common_ldn_acpi_name, + .acpi_hid = ast2400_acpi_hid, +#endif }; static struct pnp_info pnp_dev_info[] = { -- cgit v1.2.3