From 7ab33cbe504fb077f508030537d0788e410d5f93 Mon Sep 17 00:00:00 2001 From: Edwin Zhai Date: Wed, 11 Apr 2018 15:11:53 +0800 Subject: [PATCH] VTd: bluetooth passthrough support Adds ACPI tables for 0:18.0(UART) device Signed-off-by: Edwin Zhai Reviewed-by: Zhao Yakui Reviewed-by: Kevin Tian --- hw/pci/passthrough.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/hw/pci/passthrough.c b/hw/pci/passthrough.c index 9182d49ab..f0c47586f 100644 --- a/hw/pci/passthrough.c +++ b/hw/pci/passthrough.c @@ -1807,6 +1807,28 @@ write_dsdt_ipu_i2c(struct pci_vdev *dev) dsdt_line("}"); } +static void +write_dsdt_urt1(struct pci_vdev *dev) +{ + printf("write virt-%x:%x.%x in dsdt for URT1 @ 00:18.0\n", + dev->bus, + dev->slot, + dev->func); + dsdt_line("Device (URT1)"); + dsdt_line("{"); + dsdt_line(" Name (_ADR, 0x%04X%04X)", dev->slot, dev->func); + dsdt_line(" Name (_DDN, \"Intel(R) HS-UART Controller #1\")"); + dsdt_line(" Name (_UID, One)"); + dsdt_line(" Name (RBUF, ResourceTemplate ()"); + dsdt_line(" {"); + dsdt_line(" })"); + dsdt_line(" Method (_CRS, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" Return (RBUF)"); + dsdt_line(" }"); + dsdt_line("}"); +} + static void passthru_write_dsdt(struct pci_vdev *dev) { @@ -1833,6 +1855,9 @@ passthru_write_dsdt(struct pci_vdev *dev) else if (device == 0x5aac) /* i2c @ 00:16.0 for ipu */ write_dsdt_ipu_i2c(dev); + else if (device == 0x5abc) + /* URT1 @ 00:18.0 for bluetooth*/ + write_dsdt_urt1(dev); }