From bb3e59051a77abe95c3cde719633998a3bc6aba3 Mon Sep 17 00:00:00 2001 From: Simon Yang Date: Fri, 31 Oct 2025 13:31:32 +0800 Subject: [PATCH] mb/google/brya: Check power state before process _ON method for BT According to ACPI spec, OSPM will not check _STA first and may run the _ON method repeatedly, even if the resource is already on. GPIO CNV_BTEN, CNV_BT_IF_SELECT and BT_RESRT_GPIO are already enabled before entering OS, but OS still try to run method _ON during boot up process. Therefore, try to check the GPIO state first to avoid unnecessary operation and interfere touch enabling sequence. BUG=b:454848201 TEST="rebuild and dump dsdt to check asl code generate as expected" Change-Id: I8bd517c3a5ca46c7c8b8ad436af5e4be2295b631 Signed-off-by: Simon Yang Reviewed-on: https://review.coreboot.org/c/coreboot/+/89849 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- .../google/brya/acpi/cnvi_bt_reset.asl | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mainboard/google/brya/acpi/cnvi_bt_reset.asl b/src/mainboard/google/brya/acpi/cnvi_bt_reset.asl index e2a387aee1..6e84522145 100644 --- a/src/mainboard/google/brya/acpi/cnvi_bt_reset.asl +++ b/src/mainboard/google/brya/acpi/cnvi_bt_reset.asl @@ -8,11 +8,17 @@ #define BT_RESET_GPIO GPP_D4 #endif +/* Delay in milliseconds for BT_RESET */ +#ifndef BT_RESET_DELAY_MS +#define BT_RESET_DELAY_MS 105 +#endif + #define CNV_BTEN GPP_VGPIO_0 #define CNV_BT_IF_SELECT GPP_VGPIO_5 External (\_SB.PCI0.CTXS, MethodObj) External (\_SB.PCI0.STXS, MethodObj) +External (\_SB.PCI0.GTXS, MethodObj) Scope (\_SB.PCI0.XHCI.RHUB.HS10) { @@ -25,18 +31,21 @@ Scope (\_SB.PCI0.XHCI.RHUB.HS10) Method (_ON, 0, NotSerialized) // _ON_: Power On { - \_SB.PCI0.STXS(CNV_BTEN); - \_SB.PCI0.STXS(CNV_BT_IF_SELECT); - \_SB.PCI0.STXS(BT_RESET_GPIO); - Sleep (105) + If (LEqual (\_SB.PCI0.GTXS(BT_RESET_GPIO), 0)) { + \_SB.PCI0.STXS(CNV_BTEN) + \_SB.PCI0.STXS(CNV_BT_IF_SELECT) + \_SB.PCI0.STXS(BT_RESET_GPIO) + } } Method (_OFF, 0, NotSerialized) // _OFF: Power Off { - \_SB.PCI0.CTXS(CNV_BTEN); - \_SB.PCI0.CTXS(CNV_BT_IF_SELECT); - \_SB.PCI0.CTXS(BT_RESET_GPIO); - Sleep (105) + If (LEqual (\_SB.PCI0.GTXS(BT_RESET_GPIO), 1)) { + \_SB.PCI0.CTXS(CNV_BTEN) + \_SB.PCI0.CTXS(CNV_BT_IF_SELECT) + \_SB.PCI0.CTXS(BT_RESET_GPIO) + Sleep (BT_RESET_DELAY_MS) + } } }