Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84990?usp=email )
Change subject: drivers/usb/intel_bluetooth: Relocate BTRK to _SB.PCI0 ......................................................................
drivers/usb/intel_bluetooth: Relocate BTRK to _SB.PCI0
Move BTRK to _SB.PCI0 so that the CNVi driver can correctly access it.
Change-Id: I044b745dce41c9d7a86384b42543ad93485d85ce Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/84990 Reviewed-by: Nicholas Sudsgaard devel+coreboot@nsudsgaard.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/usb/acpi/chip.h M src/drivers/usb/acpi/intel_bluetooth.c M src/drivers/usb/acpi/usb_acpi.c M src/soc/intel/common/block/cnvi/cnvi.c 4 files changed, 38 insertions(+), 36 deletions(-)
Approvals: build bot (Jenkins): Verified Nicholas Sudsgaard: Looks good to me, approved
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h index a27ce44..f5edba4 100644 --- a/src/drivers/usb/acpi/chip.h +++ b/src/drivers/usb/acpi/chip.h @@ -91,6 +91,7 @@ void acpi_device_intel_bt(unsigned int reset_gpio, unsigned int enable_gpio, bool audio_offload); -void acpi_device_intel_bt_common(unsigned int enable_gpio); +void acpi_device_intel_bt_common(unsigned int enable_gpio, + unsigned int reset_gpio);
#endif /* __USB_ACPI_CHIP_H__ */ diff --git a/src/drivers/usb/acpi/intel_bluetooth.c b/src/drivers/usb/acpi/intel_bluetooth.c index 978d6ee..56f31ae 100644 --- a/src/drivers/usb/acpi/intel_bluetooth.c +++ b/src/drivers/usb/acpi/intel_bluetooth.c @@ -117,9 +117,9 @@ * Local0 = Acquire (_SB.PCI0.CNMT, 1000) * If ((Local0 == Zero)) * { - * BTRK (Zero) + * _SB.PCI0.BTRK (Zero) * Sleep (RDLY) - * BTRK (One) + * _SB.PCI0.BTRK (One) * Sleep (RDLY) * Release (_SB.PCI0.CNMT) } @@ -169,13 +169,13 @@
acpigen_write_if_lequal_op_int(LOCAL0_OP, 0); { - acpigen_emit_namestring("BTRK"); + acpigen_emit_namestring("\_SB.PCI0.BTRK"); acpigen_emit_byte(0);
acpigen_emit_ext_op(SLEEP_OP); acpigen_emit_namestring("RDLY");
- acpigen_emit_namestring("BTRK"); + acpigen_emit_namestring("\_SB.PCI0.BTRK"); acpigen_emit_byte(1);
acpigen_emit_ext_op(SLEEP_OP); @@ -191,31 +191,6 @@ acpigen_write_power_res_end();
/* - * Method (BTRK, 1, Serialized) - * { - * If (Arg0 == 1) - * { - * STXS (reset_gpio) - * } Else { - * CTXS (reset_gpio) - * } - * } - */ - acpigen_write_method_serialized("BTRK", 1); - { - acpigen_write_if_lequal_op_int(ARG0_OP, 1); - { - acpigen_soc_set_tx_gpio(reset_gpio); - } - acpigen_write_else(); - { - acpigen_soc_clear_tx_gpio(reset_gpio); - } - acpigen_pop_len(); - } - acpigen_pop_len(); - -/* * Name (_PRR, Package (0x01) * { * BTRT @@ -283,7 +258,7 @@ acpigen_pop_len(); }
-void acpi_device_intel_bt_common(unsigned int enable_gpio) +void acpi_device_intel_bt_common(unsigned int enable_gpio, unsigned int reset_gpio) { acpigen_write_scope("\_SB.PCI0"); /* @@ -335,5 +310,30 @@ } acpigen_pop_len();
+/* + * Method (BTRK, 1, Serialized) + * { + * If (Arg0 == 1) + * { + * STXS (reset_gpio) + * } Else { + * CTXS (reset_gpio) + * } + * } + */ + acpigen_write_method_serialized("BTRK", 1); + { + acpigen_write_if_lequal_op_int(ARG0_OP, 1); + { + acpigen_soc_set_tx_gpio(reset_gpio); + } + acpigen_write_else(); + { + acpigen_soc_clear_tx_gpio(reset_gpio); + } + acpigen_pop_len(); + } + acpigen_pop_len(); + acpigen_pop_len(); } diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index 8960e3d..6408a88 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -119,7 +119,8 @@ * other code to access it i.e. CNVi driver. */ if (config->is_intel_bluetooth) - acpi_device_intel_bt_common(config->enable_gpio.pins[0]); + acpi_device_intel_bt_common(config->enable_gpio.pins[0], + config->reset_gpio.pins[0]);
printk(BIOS_INFO, "%s: %s at %s\n", path, config->desc ? : dev->chip_ops->name, dev_path(dev)); diff --git a/src/soc/intel/common/block/cnvi/cnvi.c b/src/soc/intel/common/block/cnvi/cnvi.c index 591dfd8..b995ef3 100644 --- a/src/soc/intel/common/block/cnvi/cnvi.c +++ b/src/soc/intel/common/block/cnvi/cnvi.c @@ -131,7 +131,7 @@ * Local2 = Zero * If ((GBTE() == One)) * { - * BTRK (Zero) + * _SB.PCI0.BTRK (Zero) * Sleep (105) * Local2 = One * } @@ -143,7 +143,7 @@ * PRRS = CNVI_PLDR_COMPLETE * If ((Local2 == One)) * { - * BTRK (One) + * _SB.PCI0.BTRK (One) * Sleep (105) * } * } @@ -211,7 +211,7 @@ acpigen_write_store_int_to_op(0, LOCAL2_OP); acpigen_write_if_lequal_namestr_int("\_SB.PCI0.GBTE", 1); { - acpigen_emit_namestring("BTRK"); + acpigen_emit_namestring("\_SB.PCI0.BTRK"); acpigen_emit_byte(0);
acpigen_write_sleep(105); @@ -251,7 +251,7 @@
acpigen_write_if_lequal_op_int(LOCAL2_OP, 1); { - acpigen_emit_namestring("BTRK"); + acpigen_emit_namestring("\_SB.PCI0.BTRK"); acpigen_emit_byte(1); acpigen_write_sleep(105); }