10

I'd guess lspci would be the tool to do this but I can't seem to find any identifying output. Is there a way to know from the command line whether a Thunderbolt port is present on a machine?

I have one computer that I know has a Thunderbolt port and lspci shows this:

00:00.0 Host bridge: Intel Corporation Device 3ec2 (rev 07)
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
00:08.0 System peripheral: Intel Corporation Skylake Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Device a379 (rev 10)
00:14.0 USB controller: Intel Corporation Device a36d (rev 10)
00:14.2 RAM memory: Intel Corporation Device a36f (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Device a368 (rev 10)
00:16.0 Communication controller: Intel Corporation Device a360 (rev 10)
00:17.0 SATA controller: Intel Corporation Device a352 (rev 10)
00:1d.0 PCI bridge: Intel Corporation Device a330 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device a306 (rev 10)
00:1f.3 Audio device: Intel Corporation Device a348 (rev 10)
00:1f.4 SMBus: Intel Corporation Device a323 (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device a324 (rev 10)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-LM (rev 10)
01:00.0 Multimedia video controller: Blackmagic Design DeckLink Mini Recorder
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)

I have remotely logged into another machine, and would like to know if it has a Thunderbolt port, and lspci shows the following:

00:00.0 Host bridge: Intel Corporation Device 191f (rev 07)
00:01.0 PCI bridge: Intel Corporation Device 1901 (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 1912 (rev 06)
00:14.0 USB controller: Intel Corporation Device a12f (rev 31)
00:14.2 Signal processing controller: Intel Corporation Device a131 (rev 31)
00:16.0 Communication controller: Intel Corporation Device a13a (rev 31)
00:16.3 Serial controller: Intel Corporation Device a13d (rev 31)
00:17.0 RAID bus controller: Intel Corporation 82801 SATA Controller [RAID mode] (rev 31)
00:1d.0 PCI bridge: Intel Corporation Device a118 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Device a146 (rev 31)
00:1f.2 Memory controller: Intel Corporation Device a121 (rev 31)
00:1f.3 Audio device: Intel Corporation Device a170 (rev 31)
00:1f.4 SMBus: Intel Corporation Device a123 (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
01:00.0 Multimedia video controller: Blackmagic Design DeckLink Mini Recorder
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5722 Gigabit Ethernet PCI Express
mpr
  • 1,124
  • 1
    lspci | grep -i thunder shows 'em all on my machine (mid-2011 27" iMac w/ Mint 19 on it) – ivanivan Sep 11 '18 at 17:10
  • I think that may be specific to your machine though. "thunder" doesn't show up on a machine I have here that clearly has a Thunderbolt port. – mpr Sep 11 '18 at 17:12
  • 1
    Doesn't answer your question, but for those looking to list thunderbolt devices, there is boltctl. – DustWolf Oct 19 '22 at 09:21

3 Answers3

11

On my system, at least, with Thunderbolt 3 it's invisible to lshw & lsusb if nothing's plugged into it (I do see the USB3 port). I have a Clevo N131WU laptop, which you can buy from vendors such as System76 and Tuxedo.

That said, the modules are loaded:

[tara@tuxmonster ~]$ lsmod | grep thund
intel_wmi_thunderbolt    16384  0
wmi                    28672  1 intel_wmi_thunderbolt
[tara@tuxmonster ~]$

And I double checked on my desktop computer, which does not have thunderbolt but is running the same distribution & kernel (Arch, on 4.18), and the thunderbolt driver is not loaded on the desktop.

TaraF
  • 126
6

On Mac hardware, Thunderbolt hot-plugging is primarily managed by OS and so the Thunderbolt controller is always visible.

But on x86 PC hardware, Thunderbolt (at least Thunderbolt 1) tends to be managed by ACPI firmware, and hotplugging is dealt with like a standard PCIe hotplug event. As a result, the Thunderbolt bus can be completely invisible to the OS if nothing is connected to it. But when you connect something to it, a number of bridge devices will, from the viewpoint of Linux, just pop into existence: you will see a lot of output in dmesg as resources are allocated for the Thunderbolt bus and devices within it.

Thunderbolt 3 might be possible to detect, as it coexists with USB Type-C connectors and so might be visible in Type-C configuration data. However, I don't have access to any system with Thunderbolt 3 at the moment, so I cannot verify this right now.

telcoM
  • 96,466
  • Hm, that means one should be able to detect Thunderbolt by looking closely at the ACPI information (which won't be trivial, but should be doable). – dirkt Sep 12 '18 at 06:51
1

The Thunderbolt controller might not be completely hidden. lspci doesn't list the Thunderbolt controller because its vendor and device ID are FFFF:FFFF. My fork of pciutils detects such hidden PCI devices by examining other registers.

To determine that the device is a Thunderbolt controller, look for a vendor specific PCIe extended capability with ID=1234. I'm not sure if non-Intel Thunderbolt or USB4 controllers will have ID=1234.

sudo lspci -nnvvv | perl -0777 -nE 'while (/^([^\t\n].*\n)(\t.*\n)*?(\tCapabilities.* Express .*\n)(\t.*\n)*?(\t.*ID=1234.*\n)/mg) { print $1 . $3 }'
03:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Upstream Port, MSI 00
04:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
04:01.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
04:02.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
04:04.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
05:00.0 System peripheral [0880]: Intel Corporation JHL7540 Thunderbolt 3 NHI [Titan Ridge 4C 2018] [8086:15eb] (rev 06)    Capabilities: [c0] Express (v2) Endpoint, MSI 00
07:00.0 USB controller [0c03]: Intel Corporation JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] [8086:15ec] (rev 06) (prog-if 30 [XHCI])    Capabilities: [c0] Express (v2) Endpoint, MSI 00
09:00.0 PCI bridge [0604]: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] [8086:1136] (rev 02) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Upstream Port, MSI 00
0a:00.0 PCI bridge [0604]: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] [8086:1136] (rev 02) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
0a:01.0 PCI bridge [0604]: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] [8086:1136] (rev 02) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
0a:02.0 PCI bridge [0604]: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] [8086:1136] (rev 02) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
0a:03.0 PCI bridge [0604]: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] [8086:1136] (rev 02) (prog-if 00 [Normal decode])   Capabilities: [c0] Express (v2) Downstream Port (Slot+), MSI 00
0b:00.0 USB controller [0c03]: Intel Corporation Thunderbolt 4 NHI [Maple Ridge 4C 2020] [8086:1137] (prog-if 40 [USB4 Host Interface])     Capabilities: [c0] Express (v2) Endpoint, MSI 00
10:00.0 PCI bridge [0604]: Illegal Vendor ID Device [ffff:ffff] (prog-if 00 [Normal decode])    Capabilities: [c0] Express (v2) Upstream Port, MSI 00

You can change the command to remove downstream and endpoint devices. The last device listed in the above results is from a hidden GC-ALPINE RIDGE. For an Alpine Ridge based Thunderbolt 3 add-in card in a PC that doesn't have any support for Thunderbolt in firmware, the following commands in UEFI Shell can unhide the Thunderbolt controller's USB controller. The commands assumes the Thunderbolt controller has PCI bus 0x10.

mm 0010000054C 00 -w 1 -PCIE -n
mm 0010000054C 0D -w 1 -PCIE -n
mm 00100000548 -w 1 -PCIE -n

Of course the OS needs to reenumerate PCI devices since the hidden devices were not enumerated by UEFI. For Titan Ridge based Thunderbolt 3 add-in cards, the USB controller is not hidden by default. Usually a Thunderbolt controller should unhide itself if a USB-C device is connected.

AdminBee
  • 22,803
joevt
  • 11