aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReka Norman <rekanorman@google.com>2022-11-30 16:33:16 +1100
committerEric Lai <eric_lai@quanta.corp-partner.google.com>2022-12-12 01:29:27 +0000
commit1d49d3e40b1bc1dcd25e26781277f3fa6409551b (patch)
tree98c4854612f674f4cff667d14b7fda050ee6a5d7 /src
parent122e1dfe5d992788b636e803dd9aa76ba5497220 (diff)
mb/google/brya: Don't add MPTS to both DSDT and SSDT
commit 52ccd293d7 ("mb/google/brya: Implement shutdown function for dGPU") started unconditionally adding MPTS to the SSDT. On variants with HAVE_WWAN_POWER_SEQUENCE selected, MPTS is already added to the DSDT via wwan_power.asl. The duplicate definition results in a kernel error: ERR kernel: [ 0.109237] ACPI BIOS Error (bug): Failure creating named object [\_SB.MPTS], AE_ALREADY_EXISTS (20210730/dswload2-327) ERR kernel: [ 0.109242] ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20210730/psobject-220) Don't add MPTS to the SSDT if HAVE_WWAN_POWER_SEQUENCE is selected. There are no variants which use both, so this should only result in empty MPTS methods being removed. BUG=b:260380268 TEST=On pujjo, the SSDT no longer contains an empty MPTS method, there's no kernel error, and the WWAN power-off sequence is met. Change-Id: I9f411aae81ea87aa9c8fc7754c3709e398771a32 Signed-off-by: Reka Norman <rekanorman@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70146 Reviewed-by: Kangheui Won <khwon@chromium.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/brya/mainboard.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/mainboard/google/brya/mainboard.c b/src/mainboard/google/brya/mainboard.c
index 4e0cf080d2..966f19eef4 100644
--- a/src/mainboard/google/brya/mainboard.c
+++ b/src/mainboard/google/brya/mainboard.c
@@ -132,6 +132,36 @@ static void mainboard_generate_dgpu_shutdown(const struct device *dev)
acpigen_emit_namestring(acpi_device_path_join(parent, "PGPR._OFF"));
}
+static void mainboard_generate_mpts(void)
+{
+ const struct device *wwan = DEV_PTR(rp6_wwan);
+ const struct device *dgpu = DEV_PTR(dgpu);
+
+ /*
+ * If HAVE_WWAN_POWER_SEQUENCE is selected, MPTS will be added to the
+ * DSDT via wwan_power.asl. We can't add MPTS to the SSDT as well,
+ * since the duplicate definition will result in a kernel error.
+ *
+ * This special case can be removed in the future if the power-off
+ * sequences for all WWAN devices used on brya are moved to the SSDT.
+ */
+ if (CONFIG(HAVE_WWAN_POWER_SEQUENCE)) {
+ if (wwan || dgpu)
+ printk(BIOS_ERR, "Skip adding duplicate MPTS entry to SSDT\n");
+ return;
+ }
+
+ acpigen_write_scope("\\_SB");
+ acpigen_write_method_serialized("MPTS", 1);
+ if (wwan)
+ mainboard_generate_wwan_shutdown(wwan);
+ if (dgpu)
+ mainboard_generate_dgpu_shutdown(dgpu);
+
+ acpigen_write_method_end(); /* Method */
+ acpigen_write_scope_end(); /* Scope */
+}
+
static void mainboard_generate_s0ix_hook(void)
{
acpigen_write_if_lequal_op_int(ARG0_OP, 1);
@@ -151,18 +181,7 @@ static void mainboard_generate_s0ix_hook(void)
static void mainboard_fill_ssdt(const struct device *dev)
{
- const struct device *wwan = DEV_PTR(rp6_wwan);
- const struct device *dgpu = DEV_PTR(dgpu);
-
- acpigen_write_scope("\\_SB");
- acpigen_write_method_serialized("MPTS", 1);
- if (wwan)
- mainboard_generate_wwan_shutdown(wwan);
- if (dgpu)
- mainboard_generate_dgpu_shutdown(dgpu);
-
- acpigen_write_method_end(); /* Method */
- acpigen_write_scope_end(); /* Scope */
+ mainboard_generate_mpts();
/* for variant to fill additional SSDT */
variant_fill_ssdt(dev);