Duncan Laurie | ce3a974 | 2020-08-13 16:17:57 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #ifndef __DRIVERS_INTEL_USB4_PCIE_H__ |
| 4 | #define __DRIVERS_INTEL_USB4_PCIE_H__ |
| 5 | |
Duncan Laurie | 389cb30 | 2020-10-18 15:01:22 -0700 | [diff] [blame] | 6 | /* |
| 7 | * This virtual generic driver provides the ACPI properties for an |
| 8 | * Intel USB4/TBT PCIe Root Port which is already declared in the DSDT, |
| 9 | * |
| 10 | * The associated USB4 port number is obtained from the generic ID and |
| 11 | * the related host interface (DMA) device is provided by the devicetree. |
| 12 | * |
| 13 | * The "ExternalFacingPort", and "HotPlugSupportInD3" properties are defined at |
| 14 | * https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports |
| 15 | * |
| 16 | * Example: PCIe Root Port 2 via USB4 host interface 1 port 0: |
| 17 | * |
| 18 | * device pci 0d.3 alias tbt_dma1 on end # \_SB.PCI0.TDM1 |
| 19 | * device pci 07.2 alias tbt_pcie_rp2 on # \_SB.PCI0.TRP2 |
| 20 | * chip soc/intel/common/block/usb4 |
| 21 | * use tbt_dma1 as usb4_port # USB4 host interface for this root port |
| 22 | * device generic 0 on end # USB4 port number on this host interface |
| 23 | * end |
| 24 | * end |
| 25 | * |
| 26 | * The host interface and PCIe Root Port are declared in the DSDT: |
| 27 | * |
| 28 | * Scope (\_SB.PCI0) { |
| 29 | * Device (TDM1) { |
| 30 | * Name (_ADR, 0x000d0003) |
| 31 | * } |
| 32 | * Device (TRP2) { |
| 33 | * Name (_ADR, 0x00070002) |
| 34 | * } |
| 35 | * } |
| 36 | * |
| 37 | * This driver will provide the following properties in the SSDT: |
| 38 | * |
| 39 | * Scope (\_SB.PCI0.TRP2) { |
| 40 | * Name (_DSD, Package () { |
| 41 | * ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 42 | * Package () { |
| 43 | * Package () { "usb4-host-interface", \_SB.PCI0.TDM1 }, |
| 44 | * Package () { "usb4-port-number", 0 }, |
| 45 | * }, |
| 46 | * ToUUID ("6211e2c0-58a3-4af3-90e1-927a4e0c55a4"), |
| 47 | * Package () { |
| 48 | * Package () { "HotPlugSupportInD3", 1 }, |
| 49 | * }, |
| 50 | * ToUUID ("efcc06cc-73ac-4bc3-bff0-76143807c389"), |
| 51 | * Package () { |
| 52 | * Package () { "ExternalFacingPort", 1 }, |
| 53 | * }, |
| 54 | * } |
| 55 | * } |
| 56 | */ |
| 57 | |
Duncan Laurie | ce3a974 | 2020-08-13 16:17:57 -0700 | [diff] [blame] | 58 | struct soc_intel_common_block_usb4_config { |
| 59 | const char *desc; |
| 60 | |
Duncan Laurie | 389cb30 | 2020-10-18 15:01:22 -0700 | [diff] [blame] | 61 | /* USB4 host interface (DMA device) that this PCIe root port is routed to. */ |
Duncan Laurie | ce3a974 | 2020-08-13 16:17:57 -0700 | [diff] [blame] | 62 | DEVTREE_CONST struct device *usb4_port; |
| 63 | }; |
| 64 | |
| 65 | #endif /* __DRIVERS_INTEL_USB4_PCIE_H__ */ |