Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/76129?usp=email )
Change subject: sb/intel/lynxpoint: Don't generate second SSDT ......................................................................
sb/intel/lynxpoint: Don't generate second SSDT
Move the entries in SSDT to acpi_fill_ssdt(). There is need for a separate table.
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: Ie23d5b5b967de162ea9ac60a64bc92d0b3bee08e --- M src/southbridge/intel/lynxpoint/Makefile.inc D src/southbridge/intel/lynxpoint/acpi.c M src/southbridge/intel/lynxpoint/lpc.c M src/southbridge/intel/lynxpoint/pch.h 4 files changed, 12 insertions(+), 75 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/76129/1
diff --git a/src/southbridge/intel/lynxpoint/Makefile.inc b/src/southbridge/intel/lynxpoint/Makefile.inc index 5088d8b..c09beb6 100644 --- a/src/southbridge/intel/lynxpoint/Makefile.inc +++ b/src/southbridge/intel/lynxpoint/Makefile.inc @@ -23,7 +23,6 @@ endif
ramstage-y += me_status.c -ramstage-y += acpi.c
ramstage-$(CONFIG_ELOG) += elog.c
diff --git a/src/southbridge/intel/lynxpoint/acpi.c b/src/southbridge/intel/lynxpoint/acpi.c deleted file mode 100644 index aa6e650..0000000 --- a/src/southbridge/intel/lynxpoint/acpi.c +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include <acpi/acpi.h> -#include <acpi/acpi_gnvs.h> -#include <acpi/acpigen.h> -#include <string.h> -#include <version.h> -#include <soc/nvs.h> - -#include "pch.h" - -static void acpi_create_serialio_ssdt_entry(int id, struct global_nvs *gnvs) -{ - char sio_name[5] = {}; - snprintf(sio_name, sizeof(sio_name), "S%1uEN", id); - acpigen_write_name_byte(sio_name, gnvs->s0b[id] ? 1 : 0); -} - -void acpi_create_serialio_ssdt(acpi_header_t *ssdt) -{ - unsigned long current = (unsigned long)ssdt + sizeof(acpi_header_t); - struct global_nvs *gnvs = acpi_get_gnvs(); - int id; - - if (!gnvs) - return; - - /* Fill the SSDT header */ - memset((void *)ssdt, 0, sizeof(acpi_header_t)); - memcpy(&ssdt->signature, "SSDT", 4); - ssdt->revision = get_acpi_table_revision(SSDT); - memcpy(&ssdt->oem_id, OEM_ID, 6); - memcpy(&ssdt->oem_table_id, "SERIALIO", 8); - ssdt->oem_revision = 43; - memcpy(&ssdt->asl_compiler_id, ASLC, 4); - ssdt->asl_compiler_revision = asl_revision; - ssdt->length = sizeof(acpi_header_t); - acpigen_set_current((char *)current); - - /* Fill the SSDT with an entry for each SerialIO device */ - for (id = 0; id < 8; id++) - acpi_create_serialio_ssdt_entry(id, gnvs); - - /* (Re)calculate length and checksum. */ - current = (unsigned long)acpigen_get_current(); - ssdt->length = current - (unsigned long)ssdt; - ssdt->checksum = acpi_checksum((void *)ssdt, ssdt->length); -} diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index 67f1e54..680622b 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -752,33 +752,21 @@ return "LPCB"; }
+static void acpi_create_serialio_ssdt_entry(int id, struct global_nvs *gnvs) +{ + char sio_name[5] = {}; + snprintf(sio_name, sizeof(sio_name), "S%1uEN", id); + acpigen_write_name_byte(sio_name, gnvs->s0b[id] ? 1 : 0); +} + static void southbridge_fill_ssdt(const struct device *dev) { intel_acpi_gen_def_acpi_pirq(dev); -} - -static unsigned long southbridge_write_acpi_tables(const struct device *device, - unsigned long start, - struct acpi_rsdp *rsdp) -{ - unsigned long current; - - current = start; - - /* Align ACPI tables to 16byte */ - current = acpi_align_current(current); - - if (pch_is_lp()) { - printk(BIOS_DEBUG, "ACPI: * SSDT2\n"); - acpi_header_t *ssdt = (acpi_header_t *)current; - acpi_create_serialio_ssdt(ssdt); - current += ssdt->length; - acpi_add_table(rsdp, ssdt); - current = acpi_align_current(current); - } - - printk(BIOS_DEBUG, "current = %lx\n", current); - return current; + acpigen_write_scope("\"); + /* Fill the SSDT with an entry for each SerialIO device */ + for (id = 0; id < 8; id++) + acpi_create_serialio_ssdt_entry(id, gnvs); + acpigen_write_scope_end(); }
static void lpc_final(struct device *dev) @@ -798,7 +786,6 @@ .enable_resources = pci_dev_enable_resources, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, - .write_acpi_tables = southbridge_write_acpi_tables, .init = lpc_init, .final = lpc_final, .enable = pch_lpc_enable, diff --git a/src/southbridge/intel/lynxpoint/pch.h b/src/southbridge/intel/lynxpoint/pch.h index 07f4b9d..1162214 100644 --- a/src/southbridge/intel/lynxpoint/pch.h +++ b/src/southbridge/intel/lynxpoint/pch.h @@ -157,7 +157,6 @@ void pch_enable(struct device *dev); void pch_disable_devfn(struct device *dev); void pch_log_state(void); -void acpi_create_serialio_ssdt(acpi_header_t *ssdt);
void enable_usb_bar(void); void early_pch_init(void);