Christian Walter has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33253
Change subject: src/superio/aspeed/ast2400: Add Autogen ACPI Code ......................................................................
src/superio/aspeed/ast2400: Add Autogen ACPI Code
Once the Autogen ACPI Code is merged, we can use this to autogenerate the ACPI Code for the AST2400. This is WIP.
Has been tested w/ AST2400.
Change-Id: I2ef49bb6f733994b249ae46f0460234380b552b8 Signed-off-by: Christian Walter christian.walter@9elements.com --- M src/superio/aspeed/ast2400/Makefile.inc M src/superio/aspeed/ast2400/superio.c 2 files changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/33253/1
diff --git a/src/superio/aspeed/ast2400/Makefile.inc b/src/superio/aspeed/ast2400/Makefile.inc index a6f8b20..9a1a8f5 100644 --- a/src/superio/aspeed/ast2400/Makefile.inc +++ b/src/superio/aspeed/ast2400/Makefile.inc @@ -16,3 +16,4 @@ ##
ramstage-$(CONFIG_SUPERIO_ASPEED_AST2400) += superio.c +ramstage-$(CONFIG_SUPERIO_ASPEED_AST2400) += ../../common/ssdt.c diff --git a/src/superio/aspeed/ast2400/superio.c b/src/superio/aspeed/ast2400/superio.c index dcb14fa..c4d0c72 100644 --- a/src/superio/aspeed/ast2400/superio.c +++ b/src/superio/aspeed/ast2400/superio.c @@ -22,6 +22,7 @@ #include <console/console.h> #include <string.h> #include <pc80/keyboard.h> +#include <superio/common/ssdt.h> #include "ast2400.h"
static void ast2400_init(struct device *dev) @@ -36,6 +37,13 @@ } }
+#if CONFIG(HAVE_ACPI_TABLES) +static const char *aspeed_ast2400_name(const struct device *dev) +{ + return "SIO0"; +} +#endif + static struct device_operations ops = { .read_resources = pnp_read_resources, .set_resources = pnp_set_resources, @@ -43,6 +51,10 @@ .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 = aspeed_ast2400_name, +#endif };
static struct pnp_info pnp_dev_info[] = {
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
Patch Set 16:
This change is ready for review.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
Patch Set 16: Code-Review+2
Patrick Rudolph has uploaded a new patch set (#17) to the change originally created by Christian Walter. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
src/superio/aspeed/ast2400: Use new SuperIO acpigen
Use the new SuperIO ACPI generator to make includes in DSDT obsolete.
Tested on X11SSH-TF.
Change-Id: I2ef49bb6f733994b249ae46f0460234380b552b8 Signed-off-by: Christian Walter christian.walter@9elements.com --- M src/superio/aspeed/ast2400/Makefile.inc M src/superio/aspeed/ast2400/superio.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/33253/17
Patrick Rudolph has uploaded a new patch set (#20) to the change originally created by Christian Walter. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
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 christian.walter@9elements.com --- M src/superio/aspeed/ast2400/Makefile.inc M src/superio/aspeed/ast2400/superio.c 2 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/33253/20
Patrick Rudolph has uploaded a new patch set (#22) to the change originally created by Christian Walter. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
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 christian.walter@9elements.com --- M src/superio/aspeed/ast2400/Makefile.inc M src/superio/aspeed/ast2400/superio.c 2 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/33253/22
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
Patch Set 22: Code-Review+2
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
Patch Set 22:
(5 comments)
there is only one comment left that might be worth a thought; I'm not marking that as resolved so that the whole patch isn't marked with all comments resolved, so it doesn't get accidentally merged before the SIO SSDT generation patch.
https://review.coreboot.org/c/coreboot/+/33253/13//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/33253/13//COMMIT_MSG@9 PS13, Line 9: Code
code
Done
https://review.coreboot.org/c/coreboot/+/33253/13//COMMIT_MSG@9 PS13, Line 9: Autogen
autogen
Done
https://review.coreboot.org/c/coreboot/+/33253/13//COMMIT_MSG@10 PS13, Line 10: Code
code
Done
https://review.coreboot.org/c/coreboot/+/33253/14//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/33253/14//COMMIT_MSG@10 PS14, Line 10: the ACPI Code for the AST2400. This is WIP.
Use coreboot’s common Super I/O SSDT generator to generate the SSDT entries for the Super I/O.
Done
https://review.coreboot.org/c/coreboot/+/33253/14//COMMIT_MSG@12 PS14, Line 12: Has been tested w/ AST2400.
How? What entries are now in the SSDT table?
Done
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
Patch Set 22:
(1 comment)
https://review.coreboot.org/c/coreboot/+/33253/14//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/33253/14//COMMIT_MSG@7 PS14, Line 7: src/superio/aspeed/ast2400: Add Autogen ACPI Code
Please remove `src` from the prefix. […]
.
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/33253 )
Change subject: src/superio/aspeed/ast2400: Use new SuperIO acpigen ......................................................................
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 christian.walter@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33253 Reviewed-by: Felix Held felix-coreboot@felixheld.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/superio/aspeed/ast2400/Makefile.inc M src/superio/aspeed/ast2400/superio.c 2 files changed, 35 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved
diff --git a/src/superio/aspeed/ast2400/Makefile.inc b/src/superio/aspeed/ast2400/Makefile.inc index a6f8b20..625390f 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 dcb14fa..54f3f34 100644 --- a/src/superio/aspeed/ast2400/superio.c +++ b/src/superio/aspeed/ast2400/superio.c @@ -22,6 +22,8 @@ #include <console/console.h> #include <string.h> #include <pc80/keyboard.h> +#include <superio/common/ssdt.h> +#include <arch/acpi.h> #include "ast2400.h"
static void ast2400_init(struct device *dev) @@ -36,6 +38,32 @@ } }
+#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 @@ .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[] = {