€•1Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ+/translations/zh_CN/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/zh_TW/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/it_IT/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ja_JP/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ko_KR/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/pt_BR/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/sp_SP/admin-guide/thunderbolt”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒE/var/lib/git/docbuild/linux/Documentation/admin-guide/thunderbolt.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒUSB4 and Thunderbolt”h]”hŒUSB4 and Thunderbolt”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hX1USB4 is the public specification based on Thunderbolt 3 protocol with some differences at the register level among other things. Connection manager is an entity running on the host router (host controller) responsible for enumerating routers and establishing tunnels. A connection manager can be implemented either in firmware or software. Typically PCs come with a firmware connection manager for Thunderbolt 3 and early USB4 capable systems. Apple systems on the other hand use software connection manager and the later USB4 compliant devices follow the suit.”h]”hX1USB4 is the public specification based on Thunderbolt 3 protocol with some differences at the register level among other things. Connection manager is an entity running on the host router (host controller) responsible for enumerating routers and establishing tunnels. A connection manager can be implemented either in firmware or software. Typically PCs come with a firmware connection manager for Thunderbolt 3 and early USB4 capable systems. Apple systems on the other hand use software connection manager and the later USB4 compliant devices follow the suit.”…”�”}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hXòThe Linux Thunderbolt driver supports both and can detect at runtime which connection manager implementation is to be used. To be on the safe side the software connection manager in Linux also advertises security level ``user`` which means PCIe tunneling is disabled by default. The documentation below applies to both implementations with the exception that the software connection manager only supports ``user`` security level and is expected to be accompanied with an IOMMU based DMA protection.”h]”(hŒÛThe Linux Thunderbolt driver supports both and can detect at runtime which connection manager implementation is to be used. To be on the safe side the software connection manager in Linux also advertises security level ”…”�”}”(hhíh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ² which means PCIe tunneling is disabled by default. The documentation below applies to both implementations with the exception that the software connection manager only supports ”…”�”}”(hhíh²hh³Nh´Nubhö)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒU security level and is expected to be accompanied with an IOMMU based DMA protection.”…”�”}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ#Security levels and how to use them”h]”hŒ#Security levels and how to use them”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj!h²hh³hÇh´KubhÞ)�”}”(hŒÛThe interface presented here is not meant for end users. Instead there should be a userspace tool that handles all the low-level details, keeps a database of the authorized devices and prompts users for new connections.”h]”hŒÛThe interface presented here is not meant for end users. Instead there should be a userspace tool that handles all the low-level details, keeps a database of the authorized devices and prompts users for new connections.”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj!h²hubhÞ)�”}”(hŒMore details about the sysfs interface for Thunderbolt devices can be found in Documentation/ABI/testing/sysfs-bus-thunderbolt.”h]”hŒMore details about the sysfs interface for Thunderbolt devices can be found in Documentation/ABI/testing/sysfs-bus-thunderbolt.”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj!h²hubhÞ)�”}”(hŒ�Those users who just want to connect any device without any sort of manual work can add following line to ``/etc/udev/rules.d/99-local.rules``::”h]”(hŒjThose users who just want to connect any device without any sort of manual work can add following line to ”…”�”}”(hjNh²hh³Nh´Nubhö)�”}”(hŒ$``/etc/udev/rules.d/99-local.rules``”h]”hŒ /etc/udev/rules.d/99-local.rules”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjNubhŒ:”…”�”}”(hjNh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K!hj!h²hubhŒ literal_block”“”)�”}”(hŒTACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"”h]”hŒTACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"”…”�”}”hjpsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´K%hj!h²hubhÞ)�”}”(hŒ¬This will authorize all devices automatically when they appear. However, keep in mind that this bypasses the security levels and makes the system vulnerable to DMA attacks.”h]”hŒ¬This will authorize all devices automatically when they appear. However, keep in mind that this bypasses the security levels and makes the system vulnerable to DMA attacks.”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K'hj!h²hubhÞ)�”}”(hX¡Starting with Intel Falcon Ridge Thunderbolt controller there are 4 security levels available. Intel Titan Ridge added one more security level (usbonly). The reason for these is the fact that the connected devices can be DMA masters and thus read contents of the host memory without CPU and OS knowing about it. There are ways to prevent this by setting up an IOMMU but it is not always available for various reasons.”h]”hX¡Starting with Intel Falcon Ridge Thunderbolt controller there are 4 security levels available. Intel Titan Ridge added one more security level (usbonly). The reason for these is the fact that the connected devices can be DMA masters and thus read contents of the host memory without CPU and OS knowing about it. There are ways to prevent this by setting up an IOMMU but it is not always available for various reasons.”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K+hj!h²hubhÞ)�”}”(hŒtSome USB4 systems have a BIOS setting to disable PCIe tunneling. This is treated as another security level (nopcie).”h]”hŒtSome USB4 systems have a BIOS setting to disable PCIe tunneling. This is treated as another security level (nopcie).”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K2hj!h²hubhÞ)�”}”(hŒ#The security levels are as follows:”h]”hŒ#The security levels are as follows:”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K5hj!h²hubhŒ block_quote”“”)�”}”(hX“none All devices are automatically connected by the firmware. No user approval is needed. In BIOS settings this is typically called *Legacy mode*. user User is asked whether the device is allowed to be connected. Based on the device identification information available through ``/sys/bus/thunderbolt/devices``, the user then can make the decision. In BIOS settings this is typically called *Unique ID*. secure User is asked whether the device is allowed to be connected. In addition to UUID the device (if it supports secure connect) is sent a challenge that should match the expected one based on a random key written to the ``key`` sysfs attribute. In BIOS settings this is typically called *One time saved key*. dponly The firmware automatically creates tunnels for Display Port and USB. No PCIe tunneling is done. In BIOS settings this is typically called *Display Port Only*. usbonly The firmware automatically creates tunnels for the USB controller and Display Port in a dock. All PCIe links downstream of the dock are removed. nopcie PCIe tunneling is disabled/forbidden from the BIOS. Available in some USB4 systems. ”h]”hŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ“none All devices are automatically connected by the firmware. No user approval is needed. In BIOS settings this is typically called *Legacy mode*. ”h]”(hŒterm”“”)�”}”(hŒnone”h]”hŒnone”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´K:hjÃubhŒ definition”“”)�”}”(hhh]”hÞ)�”}”(hŒ�All devices are automatically connected by the firmware. No user approval is needed. In BIOS settings this is typically called *Legacy mode*.”h]”(hŒAll devices are automatically connected by the firmware. No user approval is needed. In BIOS settings this is typically called ”…”�”}”(hjÜh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ *Legacy mode*”h]”hŒ Legacy mode”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÜubhŒ.”…”�”}”(hjÜh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K8hjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hjÃubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´K:hj¾ubjÂ)�”}”(hXuser User is asked whether the device is allowed to be connected. Based on the device identification information available through ``/sys/bus/thunderbolt/devices``, the user then can make the decision. In BIOS settings this is typically called *Unique ID*. ”h]”(jÈ)�”}”(hŒuser”h]”hŒuser”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´K@hj ubjØ)�”}”(hhh]”hÞ)�”}”(hŒûUser is asked whether the device is allowed to be connected. Based on the device identification information available through ``/sys/bus/thunderbolt/devices``, the user then can make the decision. In BIOS settings this is typically called *Unique ID*.”h]”(hŒ~User is asked whether the device is allowed to be connected. Based on the device identification information available through ”…”�”}”(hjh²hh³Nh´Nubhö)�”}”(hŒ ``/sys/bus/thunderbolt/devices``”h]”hŒ/sys/bus/thunderbolt/devices”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒQ, the user then can make the decision. In BIOS settings this is typically called ”…”�”}”(hjh²hh³Nh´Nubjå)�”}”(hŒ *Unique ID*”h]”hŒ Unique ID”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K=hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´K@hj¾ubjÂ)�”}”(hX8secure User is asked whether the device is allowed to be connected. In addition to UUID the device (if it supports secure connect) is sent a challenge that should match the expected one based on a random key written to the ``key`` sysfs attribute. In BIOS settings this is typically called *One time saved key*. ”h]”(jÈ)�”}”(hŒsecure”h]”hŒsecure”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´KGhj]ubjØ)�”}”(hhh]”hÞ)�”}”(hX0User is asked whether the device is allowed to be connected. In addition to UUID the device (if it supports secure connect) is sent a challenge that should match the expected one based on a random key written to the ``key`` sysfs attribute. In BIOS settings this is typically called *One time saved key*.”h]”(hŒØUser is asked whether the device is allowed to be connected. In addition to UUID the device (if it supports secure connect) is sent a challenge that should match the expected one based on a random key written to the ”…”�”}”(hjrh²hh³Nh´Nubhö)�”}”(hŒ``key``”h]”hŒkey”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjrubhŒ< sysfs attribute. In BIOS settings this is typically called ”…”�”}”(hjrh²hh³Nh´Nubjå)�”}”(hŒ*One time saved key*”h]”hŒOne time saved key”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjrubhŒ.”…”�”}”(hjrh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KChjoubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj]ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´KGhj¾ubjÂ)�”}”(hŒ¦dponly The firmware automatically creates tunnels for Display Port and USB. No PCIe tunneling is done. In BIOS settings this is typically called *Display Port Only*. ”h]”(jÈ)�”}”(hŒdponly”h]”hŒdponly”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´KLhj°ubjØ)�”}”(hhh]”hÞ)�”}”(hŒžThe firmware automatically creates tunnels for Display Port and USB. No PCIe tunneling is done. In BIOS settings this is typically called *Display Port Only*.”h]”(hŒŠThe firmware automatically creates tunnels for Display Port and USB. No PCIe tunneling is done. In BIOS settings this is typically called ”…”�”}”(hjÅh²hh³Nh´Nubjå)�”}”(hŒ*Display Port Only*”h]”hŒDisplay Port Only”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjÅubhŒ.”…”�”}”(hjÅh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KJhjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´KLhj¾ubjÂ)�”}”(hŒ™usbonly The firmware automatically creates tunnels for the USB controller and Display Port in a dock. All PCIe links downstream of the dock are removed. ”h]”(jÈ)�”}”(hŒusbonly”h]”hŒusbonly”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´KQhjñubjØ)�”}”(hhh]”hÞ)�”}”(hŒ�The firmware automatically creates tunnels for the USB controller and Display Port in a dock. All PCIe links downstream of the dock are removed.”h]”hŒ�The firmware automatically creates tunnels for the USB controller and Display Port in a dock. All PCIe links downstream of the dock are removed.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KOhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hjñubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´KQhj¾ubjÂ)�”}”(hŒ[nopcie PCIe tunneling is disabled/forbidden from the BIOS. Available in some USB4 systems. ”h]”(jÈ)�”}”(hŒnopcie”h]”hŒnopcie”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´KUhj ubjØ)�”}”(hhh]”hÞ)�”}”(hŒSPCIe tunneling is disabled/forbidden from the BIOS. Available in some USB4 systems.”h]”hŒSPCIe tunneling is disabled/forbidden from the BIOS. Available in some USB4 systems.”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KThj2ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´KUhj¾ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¼hj¸ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¶h³hÇh´K7hj!h²hubhÞ)�”}”(hŒåThe current security level can be read from ``/sys/bus/thunderbolt/devices/domainX/security`` where ``domainX`` is the Thunderbolt domain the host controller manages. There is typically one domain per Thunderbolt host controller.”h]”(hŒ,The current security level can be read from ”…”�”}”(hj[h²hh³Nh´Nubhö)�”}”(hŒ1``/sys/bus/thunderbolt/devices/domainX/security``”h]”hŒ-/sys/bus/thunderbolt/devices/domainX/security”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj[ubhŒ where ”…”�”}”(hj[h²hh³Nh´Nubhö)�”}”(hŒ ``domainX``”h]”hŒdomainX”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj[ubhŒv is the Thunderbolt domain the host controller manages. There is typically one domain per Thunderbolt host controller.”…”�”}”(hj[h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KWhj!h²hubhÞ)�”}”(hŒ¨If the security level reads as ``user`` or ``secure`` the connected device must be authorized by the user before PCIe tunnels are created (e.g the PCIe device appears).”h]”(hŒIf the security level reads as ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒ or ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ ``secure``”h]”hŒsecure”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒs the connected device must be authorized by the user before PCIe tunnels are created (e.g the PCIe device appears).”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K\hj!h²hubhÞ)�”}”(hŒÙEach Thunderbolt device plugged in will appear in sysfs under ``/sys/bus/thunderbolt/devices``. The device directory carries information that can be used to identify the particular device, including its name and UUID.”h]”(hŒ>Each Thunderbolt device plugged in will appear in sysfs under ”…”�”}”(hj¿h²hh³Nh´Nubhö)�”}”(hŒ ``/sys/bus/thunderbolt/devices``”h]”hŒ/sys/bus/thunderbolt/devices”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¿ubhŒ{. The device directory carries information that can be used to identify the particular device, including its name and UUID.”…”�”}”(hj¿h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K`hj!h²hubeh}”(h]”Œ#security-levels-and-how-to-use-them”ah ]”h"]”Œ#security levels and how to use them”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒAAuthorizing devices when security level is ``user`` or ``secure``”h]”(hŒ+Authorizing devices when security level is ”…”�”}”(hjêh²hh³Nh´Nubhö)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjêubhŒ or ”…”�”}”(hjêh²hh³Nh´Nubhö)�”}”(hŒ ``secure``”h]”hŒsecure”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjêubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjçh²hh³hÇh´KfubhÞ)�”}”(hŒ@When a device is plugged in it will appear in sysfs as follows::”h]”hŒ?When a device is plugged in it will appear in sysfs as follows:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kghjçh²hubjo)�”}”(hX}/sys/bus/thunderbolt/devices/0-1/authorized - 0 /sys/bus/thunderbolt/devices/0-1/device - 0x8004 /sys/bus/thunderbolt/devices/0-1/device_name - Thunderbolt to FireWire Adapter /sys/bus/thunderbolt/devices/0-1/vendor - 0x1 /sys/bus/thunderbolt/devices/0-1/vendor_name - Apple, Inc. /sys/bus/thunderbolt/devices/0-1/unique_id - e0376f00-0300-0100-ffff-ffffffffffff”h]”hX}/sys/bus/thunderbolt/devices/0-1/authorized - 0 /sys/bus/thunderbolt/devices/0-1/device - 0x8004 /sys/bus/thunderbolt/devices/0-1/device_name - Thunderbolt to FireWire Adapter /sys/bus/thunderbolt/devices/0-1/vendor - 0x1 /sys/bus/thunderbolt/devices/0-1/vendor_name - Apple, Inc. /sys/bus/thunderbolt/devices/0-1/unique_id - e0376f00-0300-0100-ffff-ffffffffffff”…”�”}”hj&sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´Kihjçh²hubhÞ)�”}”(hŒˆThe ``authorized`` attribute reads 0 which means no PCIe tunnels are created yet. The user can authorize the device by simply entering::”h]”(hŒThe ”…”�”}”(hj4h²hh³Nh´Nubhö)�”}”(hŒ``authorized``”h]”hŒ authorized”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj4ubhŒu attribute reads 0 which means no PCIe tunnels are created yet. The user can authorize the device by simply entering:”…”�”}”(hj4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kphjçh²hubjo)�”}”(hŒ6# echo 1 > /sys/bus/thunderbolt/devices/0-1/authorized”h]”hŒ6# echo 1 > /sys/bus/thunderbolt/devices/0-1/authorized”…”�”}”hjTsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´Kshjçh²hubhÞ)�”}”(hŒBThis will create the PCIe tunnels and the device is now connected.”h]”hŒBThis will create the PCIe tunnels and the device is now connected.”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kuhjçh²hubhÞ)�”}”(hŒîIf the device supports secure connect, and the domain security level is set to ``secure``, it has an additional attribute ``key`` which can hold a random 32-byte value used for authorization and challenging the device in future connects::”h]”(hŒOIf the device supports secure connect, and the domain security level is set to ”…”�”}”(hjph²hh³Nh´Nubhö)�”}”(hŒ ``secure``”h]”hŒsecure”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjpubhŒ!, it has an additional attribute ”…”�”}”(hjph²hh³Nh´Nubhö)�”}”(hŒ``key``”h]”hŒkey”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjpubhŒl which can hold a random 32-byte value used for authorization and challenging the device in future connects:”…”�”}”(hjph²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kwhjçh²hubjo)�”}”(hX¢/sys/bus/thunderbolt/devices/0-3/authorized - 0 /sys/bus/thunderbolt/devices/0-3/device - 0x305 /sys/bus/thunderbolt/devices/0-3/device_name - AKiTiO Thunder3 PCIe Box /sys/bus/thunderbolt/devices/0-3/key - /sys/bus/thunderbolt/devices/0-3/vendor - 0x41 /sys/bus/thunderbolt/devices/0-3/vendor_name - inXtron /sys/bus/thunderbolt/devices/0-3/unique_id - dc010000-0000-8508-a22d-32ca6421cb16”h]”hX¢/sys/bus/thunderbolt/devices/0-3/authorized - 0 /sys/bus/thunderbolt/devices/0-3/device - 0x305 /sys/bus/thunderbolt/devices/0-3/device_name - AKiTiO Thunder3 PCIe Box /sys/bus/thunderbolt/devices/0-3/key - /sys/bus/thunderbolt/devices/0-3/vendor - 0x41 /sys/bus/thunderbolt/devices/0-3/vendor_name - inXtron /sys/bus/thunderbolt/devices/0-3/unique_id - dc010000-0000-8508-a22d-32ca6421cb16”…”�”}”hj¢sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´K|hjçh²hubhÞ)�”}”(hŒ#Notice the key is empty by default.”h]”hŒ#Notice the key is empty by default.”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K„hjçh²hubhÞ)�”}”(hŒÀIf the user does not want to use secure connect they can just ``echo 1`` to the ``authorized`` attribute and the PCIe tunnels will be created in the same way as in the ``user`` security level.”h]”(hŒ>If the user does not want to use secure connect they can just ”…”�”}”(hj¾h²hh³Nh´Nubhö)�”}”(hŒ ``echo 1``”h]”hŒecho 1”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¾ubhŒ to the ”…”�”}”(hj¾h²hh³Nh´Nubhö)�”}”(hŒ``authorized``”h]”hŒ authorized”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¾ubhŒJ attribute and the PCIe tunnels will be created in the same way as in the ”…”�”}”(hj¾h²hh³Nh´Nubhö)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¾ubhŒ security level.”…”�”}”(hj¾h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K†hjçh²hubhÞ)�”}”(hŒ€If the user wants to use secure connect, the first time the device is plugged a key needs to be created and sent to the device::”h]”hŒIf the user wants to use secure connect, the first time the device is plugged a key needs to be created and sent to the device:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŠhjçh²hubjo)�”}”(hŒ‡# key=$(openssl rand -hex 32) # echo $key > /sys/bus/thunderbolt/devices/0-3/key # echo 1 > /sys/bus/thunderbolt/devices/0-3/authorized”h]”hŒ‡# key=$(openssl rand -hex 32) # echo $key > /sys/bus/thunderbolt/devices/0-3/key # echo 1 > /sys/bus/thunderbolt/devices/0-3/authorized”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´K�hjçh²hubhÞ)�”}”(hŒkNow the device is connected (PCIe tunnels are created) and in addition the key is stored on the device NVM.”h]”hŒkNow the device is connected (PCIe tunnels are created) and in addition the key is stored on the device NVM.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‘hjçh²hubhÞ)�”}”(hŒbNext time the device is plugged in the user can verify (challenge) the device using the same key::”h]”hŒaNext time the device is plugged in the user can verify (challenge) the device using the same key:”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K”hjçh²hubjo)�”}”(hŒi# echo $key > /sys/bus/thunderbolt/devices/0-3/key # echo 2 > /sys/bus/thunderbolt/devices/0-3/authorized”h]”hŒi# echo $key > /sys/bus/thunderbolt/devices/0-3/key # echo 2 > /sys/bus/thunderbolt/devices/0-3/authorized”…”�”}”hj:sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´K—hjçh²hubhÞ)�”}”(hŒèIf the challenge the device returns back matches the one we expect based on the key, the device is connected and the PCIe tunnels are created. However, if the challenge fails no tunnels are created and error is returned to the user.”h]”hŒèIf the challenge the device returns back matches the one we expect based on the key, the device is connected and the PCIe tunnels are created. However, if the challenge fails no tunnels are created and error is returned to the user.”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kšhjçh²hubhÞ)�”}”(hŒÅIf the user still wants to connect the device they can either approve the device without a key or write a new key and write 1 to the ``authorized`` file to get the new key stored on the device NVM.”h]”(hŒ…If the user still wants to connect the device they can either approve the device without a key or write a new key and write 1 to the ”…”�”}”(hjVh²hh³Nh´Nubhö)�”}”(hŒ``authorized``”h]”hŒ authorized”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjVubhŒ2 file to get the new key stored on the device NVM.”…”�”}”(hjVh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŸhjçh²hubeh}”(h]”Œ9authorizing-devices-when-security-level-is-user-or-secure”ah ]”h"]”Œ9authorizing devices when security level is user or secure”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KfubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒDe-authorizing devices”h]”hŒDe-authorizing devices”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj~h²hh³hÇh´K¤ubhÞ)�”}”(hXIt is possible to de-authorize devices by writing ``0`` to their ``authorized`` attribute. This requires support from the connection manager implementation and can be checked by reading domain ``deauthorization`` attribute. If it reads ``1`` then the feature is supported.”h]”(hŒ2It is possible to de-authorize devices by writing ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ``0``”h]”hŒ0”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒ to their ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ``authorized``”h]”hŒ authorized”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒr attribute. This requires support from the connection manager implementation and can be checked by reading domain ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ``deauthorization``”h]”hŒdeauthorization”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒ attribute. If it reads ”…”�”}”(hj�h²hh³Nh´Nubhö)�”}”(hŒ``1``”h]”hŒ1”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj�ubhŒ then the feature is supported.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¥hj~h²hubhÞ)�”}”(hXÖWhen a device is de-authorized the PCIe tunnel from the parent device PCIe downstream (or root) port to the device PCIe upstream port is torn down. This is essentially the same thing as PCIe hot-remove and the PCIe toplogy in question will not be accessible anymore until the device is authorized again. If there is storage such as NVMe or similar involved, there is a risk for data loss if the filesystem on that storage is not properly shut down. You have been warned!”h]”hXÖWhen a device is de-authorized the PCIe tunnel from the parent device PCIe downstream (or root) port to the device PCIe upstream port is torn down. This is essentially the same thing as PCIe hot-remove and the PCIe toplogy in question will not be accessible anymore until the device is authorized again. If there is storage such as NVMe or similar involved, there is a risk for data loss if the filesystem on that storage is not properly shut down. You have been warned!”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K«hj~h²hubeh}”(h]”Œde-authorizing-devices”ah ]”h"]”Œde-authorizing devices”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K¤ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒDMA protection utilizing IOMMU”h]”hŒDMA protection utilizing IOMMU”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjûh²hh³hÇh´K´ubhÞ)�”}”(hXÞRecent systems from 2018 and forward with Thunderbolt ports may natively support IOMMU. This means that Thunderbolt security is handled by an IOMMU so connected devices cannot access memory regions outside of what is allocated for them by drivers. When Linux is running on such system it automatically enables IOMMU if not enabled by the user already. These systems can be identified by reading ``1`` from ``/sys/bus/thunderbolt/devices/domainX/iommu_dma_protection`` attribute.”h]”(hX‹Recent systems from 2018 and forward with Thunderbolt ports may natively support IOMMU. This means that Thunderbolt security is handled by an IOMMU so connected devices cannot access memory regions outside of what is allocated for them by drivers. When Linux is running on such system it automatically enables IOMMU if not enabled by the user already. These systems can be identified by reading ”…”�”}”(hj h²hh³Nh´Nubhö)�”}”(hŒ``1``”h]”hŒ1”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ from ”…”�”}”(hj h²hh³Nh´Nubhö)�”}”(hŒ=``/sys/bus/thunderbolt/devices/domainX/iommu_dma_protection``”h]”hŒ9/sys/bus/thunderbolt/devices/domainX/iommu_dma_protection”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ attribute.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kµhjûh²hubhÞ)�”}”(hX´The driver does not do anything special in this case but because DMA protection is handled by the IOMMU, security levels (if set) are redundant. For this reason some systems ship with security level set to ``none``. Other systems have security level set to ``user`` in order to support downgrade to older OS, so users who want to automatically authorize devices when IOMMU DMA protection is enabled can use the following ``udev`` rule::”h]”(hŒÎThe driver does not do anything special in this case but because DMA protection is handled by the IOMMU, security levels (if set) are redundant. For this reason some systems ship with security level set to ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ``none``”h]”hŒnone”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒ+. Other systems have security level set to ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ``user``”h]”hŒuser”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒœ in order to support downgrade to older OS, so users who want to automatically authorize devices when IOMMU DMA protection is enabled can use the following ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ``udev``”h]”hŒudev”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒ rule:”…”�”}”(hj>h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K½hjûh²hubjo)�”}”(hŒvACTION=="add", SUBSYSTEM=="thunderbolt", ATTRS{iommu_dma_protection}=="1", ATTR{authorized}=="0", ATTR{authorized}="1"”h]”hŒvACTION=="add", SUBSYSTEM=="thunderbolt", ATTRS{iommu_dma_protection}=="1", ATTR{authorized}=="0", ATTR{authorized}="1"”…”�”}”hj‚sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´KÅhjûh²hubeh}”(h]”Œdma-protection-utilizing-iommu”ah ]”h"]”Œdma protection utilizing iommu”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K´ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ4Upgrading NVM on Thunderbolt device, host or retimer”h]”hŒ4Upgrading NVM on Thunderbolt device, host or retimer”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj˜h²hh³hÇh´KÈubhÞ)�”}”(hX Since most of the functionality is handled in firmware running on a host controller or a device, it is important that the firmware can be upgraded to the latest where possible bugs in it have been fixed. Typically OEMs provide this firmware from their support site.”h]”hX Since most of the functionality is handled in firmware running on a host controller or a device, it is important that the firmware can be upgraded to the latest where possible bugs in it have been fixed. Typically OEMs provide this firmware from their support site.”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÉhj˜h²hubhÞ)�”}”(hX$Currently, recommended method of updating firmware is through "fwupd" tool. It uses LVFS (Linux Vendor Firmware Service) portal by default to get the latest firmware from hardware vendors and updates connected devices if found compatible. For details refer to: https://github.com/fwupd/fwupd.”h]”(hX Currently, recommended method of updating firmware is through “fwupdâ€� tool. It uses LVFS (Linux Vendor Firmware Service) portal by default to get the latest firmware from hardware vendors and updates connected devices if found compatible. For details refer to: ”…”�”}”(hj·h²hh³Nh´NubhŒ reference”“”)�”}”(hŒhttps://github.com/fwupd/fwupd”h]”hŒhttps://github.com/fwupd/fwupd”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÃuh1j¿hj·ubhŒ.”…”�”}”(hj·h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÎhj˜h²hubhÞ)�”}”(hŒØBefore you upgrade firmware on a device, host or retimer, please make sure it is a suitable upgrade. Failing to do that may render the device in a state where it cannot be used properly anymore without special tools!”h]”hŒØBefore you upgrade firmware on a device, host or retimer, please make sure it is a suitable upgrade. Failing to do that may render the device in a state where it cannot be used properly anymore without special tools!”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÓhj˜h²hubhÞ)�”}”(hŒ0Host NVM upgrade on Apple Macs is not supported.”h]”hŒ0Host NVM upgrade on Apple Macs is not supported.”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KØhj˜h²hubhÞ)�”}”(hŒuFwupd is installed by default. If you don't have it on your system, simply use your distro package manager to get it.”h]”hŒwFwupd is installed by default. If you don’t have it on your system, simply use your distro package manager to get it.”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÚhj˜h²hubhÞ)�”}”(hŒÿTo see possible updates through fwupd, you need to plug in a Thunderbolt device so that the host controller appears. It does not matter which device is connected (unless you are upgrading NVM on a device - then you need to connect that particular device).”h]”hŒÿTo see possible updates through fwupd, you need to plug in a Thunderbolt device so that the host controller appears. It does not matter which device is connected (unless you are upgrading NVM on a device - then you need to connect that particular device).”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÝhj˜h²hubhÞ)�”}”(hŒ§Note an OEM-specific method to power the controller up ("force power") may be available for your system in which case there is no need to plug in a Thunderbolt device.”h]”hŒ«Note an OEM-specific method to power the controller up (“force powerâ€�) may be available for your system in which case there is no need to plug in a Thunderbolt device.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kâhj˜h²hubhÞ)�”}”(hŒ\Updating firmware using fwupd is straightforward - refer to official readme on fwupd github.”h]”hŒ\Updating firmware using fwupd is straightforward - refer to official readme on fwupd github.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kæhj˜h²hubhÞ)�”}”(hŒåIf firmware image is written successfully, the device shortly disappears. Once it comes back, the driver notices it and initiates a full power cycle. After a while device appears again and this time it should be fully functional.”h]”hŒåIf firmware image is written successfully, the device shortly disappears. Once it comes back, the driver notices it and initiates a full power cycle. After a while device appears again and this time it should be fully functional.”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kéhj˜h²hubhÞ)�”}”(hŒwDevice of interest should display new version under "Current version" and "Update State: Success" in fwupd's interface.”h]”hŒ�Device of interest should display new version under “Current versionâ€� and “Update State: Successâ€� in fwupd’s interface.”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kîhj˜h²hubeh}”(h]”Œ3upgrading-nvm-on-thunderbolt-device-host-or-retimer”ah ]”h"]”Œ4upgrading nvm on thunderbolt device, host or retimer”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÈubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒUpgrading firmware manually”h]”hŒUpgrading firmware manually”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjRh²hh³hÇh´KòubhÞ)�”}”(hŒßIf possible, use fwupd to updated the firmware. However, if your device OEM has not uploaded the firmware to LVFS, but it is available for download from their side, you can use method below to directly upgrade the firmware.”h]”hŒßIf possible, use fwupd to updated the firmware. However, if your device OEM has not uploaded the firmware to LVFS, but it is available for download from their side, you can use method below to directly upgrade the firmware.”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KóhjRh²hubhÞ)�”}”(hŒøManual firmware update can be done with 'dd' tool. To update firmware using this method, you need to write it to the non-active parts of NVM of the host or device. Example on how to update Intel NUC6i7KYK (Skull Canyon) Thunderbolt controller NVM::”h]”hŒûManual firmware update can be done with ‘dd’ tool. To update firmware using this method, you need to write it to the non-active parts of NVM of the host or device. Example on how to update Intel NUC6i7KYK (Skull Canyon) Thunderbolt controller NVM:”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KøhjRh²hubjo)�”}”(hŒU# dd if=KYK_TBT_FW_0018.bin of=/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem”h]”hŒU# dd if=KYK_TBT_FW_0018.bin of=/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´KýhjRh²hubhÞ)�”}”(hŒ_Once the operation completes we can trigger NVM authentication and upgrade process as follows::”h]”hŒ^Once the operation completes we can trigger NVM authentication and upgrade process as follows:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÿhjRh²hubjo)�”}”(hŒ<# echo 1 > /sys/bus/thunderbolt/devices/0-0/nvm_authenticate”h]”hŒ<# echo 1 > /sys/bus/thunderbolt/devices/0-0/nvm_authenticate”…”�”}”hj›sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´MhjRh²hubhÞ)�”}”(hŒQIf no errors are returned, device should behave as described in previous section.”h]”hŒQIf no errors are returned, device should behave as described in previous section.”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjRh²hubhÞ)�”}”(hŒUWe can verify that the new NVM firmware is active by running the following commands::”h]”hŒTWe can verify that the new NVM firmware is active by running the following commands:”…”�”}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjRh²hubjo)�”}”(hŒs# cat /sys/bus/thunderbolt/devices/0-0/nvm_authenticate 0x0 # cat /sys/bus/thunderbolt/devices/0-0/nvm_version 18.0”h]”hŒs# cat /sys/bus/thunderbolt/devices/0-0/nvm_authenticate 0x0 # cat /sys/bus/thunderbolt/devices/0-0/nvm_version 18.0”…”�”}”hjÅsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M hjRh²hubhÞ)�”}”(hŒ©If ``nvm_authenticate`` contains anything other than 0x0 it is the error code from the last authentication cycle, which means the authentication of the NVM image failed.”h]”(hŒIf ”…”�”}”(hjÓh²hh³Nh´Nubhö)�”}”(hŒ``nvm_authenticate``”h]”hŒnvm_authenticate”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÓubhŒ’ contains anything other than 0x0 it is the error code from the last authentication cycle, which means the authentication of the NVM image failed.”…”�”}”(hjÓh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjRh²hubhÞ)�”}”(hŒÅNote names of the NVMem devices ``nvm_activeN`` and ``nvm_non_activeN`` depend on the order they are registered in the NVMem subsystem. N in the name is the identifier added by the NVMem subsystem.”h]”(hŒ Note names of the NVMem devices ”…”�”}”(hjóh²hh³Nh´Nubhö)�”}”(hŒ``nvm_activeN``”h]”hŒ nvm_activeN”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjóubhŒ and ”…”�”}”(hjóh²hh³Nh´Nubhö)�”}”(hŒ``nvm_non_activeN``”h]”hŒnvm_non_activeN”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjóubhŒ~ depend on the order they are registered in the NVMem subsystem. N in the name is the identifier added by the NVMem subsystem.”…”�”}”(hjóh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjRh²hubeh}”(h]”Œupgrading-firmware-manually”ah ]”h"]”Œupgrading firmware manually”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KòubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ?Upgrading on-board retimer NVM when there is no cable connected”h]”hŒ?Upgrading on-board retimer NVM when there is no cable connected”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj-h²hh³hÇh´MubhÞ)�”}”(hXDIf the platform supports, it may be possible to upgrade the retimer NVM firmware even when there is nothing connected to the USB4 ports. When this is the case the ``usb4_portX`` devices have two special attributes: ``offline`` and ``rescan``. The way to upgrade the firmware is to first put the USB4 port into offline mode::”h]”(hŒ£If the platform supports, it may be possible to upgrade the retimer NVM firmware even when there is nothing connected to the USB4 ports. When this is the case the ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ``usb4_portX``”h]”hŒ usb4_portX”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒ& devices have two special attributes: ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ ``offline``”h]”hŒoffline”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒ and ”…”�”}”(hj>h²hh³Nh´Nubhö)�”}”(hŒ ``rescan``”h]”hŒrescan”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj>ubhŒR. The way to upgrade the firmware is to first put the USB4 port into offline mode:”…”�”}”(hj>h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj-h²hubjo)�”}”(hŒ># echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline”h]”hŒ># echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline”…”�”}”hj‚sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´Mhj-h²hubhÞ)�”}”(hŒŸThis step makes sure the port does not respond to any hotplug events, and also ensures the retimers are powered on. The next step is to scan for the retimers::”h]”hŒžThis step makes sure the port does not respond to any hotplug events, and also ensures the retimers are powered on. The next step is to scan for the retimers:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M!hj-h²hubjo)�”}”(hŒ=# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan”h]”hŒ=# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan”…”�”}”hjžsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M%hj-h²hubhÞ)�”}”(hXHThis enumerates and adds the on-board retimers. Now retimer NVM can be upgraded in the same way than with cable connected (see previous section). However, the retimer is not disconnected as we are in offline mode, so after writing ``1`` to ``nvm_authenticate`` one should wait for 5 or more seconds before running rescan again::”h]”(hŒçThis enumerates and adds the on-board retimers. Now retimer NVM can be upgraded in the same way than with cable connected (see previous section). However, the retimer is not disconnected as we are in offline mode, so after writing ”…”�”}”(hj¬h²hh³Nh´Nubhö)�”}”(hŒ``1``”h]”hŒ1”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¬ubhŒ to ”…”�”}”(hj¬h²hh³Nh´Nubhö)�”}”(hŒ``nvm_authenticate``”h]”hŒnvm_authenticate”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¬ubhŒC one should wait for 5 or more seconds before running rescan again:”…”�”}”(hj¬h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M'hj-h²hubjo)�”}”(hŒ=# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan”h]”hŒ=# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan”…”�”}”hjÞsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M-hj-h²hubhÞ)�”}”(hŒXThis point if everything went fine, the port can be put back to functional state again::”h]”hŒWThis point if everything went fine, the port can be put back to functional state again:”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M/hj-h²hubjo)�”}”(hŒ># echo 0 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline”h]”hŒ># echo 0 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline”…”�”}”hjúsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M2hj-h²hubeh}”(h]”Œ?upgrading-on-board-retimer-nvm-when-there-is-no-cable-connected”ah ]”h"]”Œ?upgrading on-board retimer nvm when there is no cable connected”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ2Upgrading NVM when host controller is in safe mode”h]”hŒ2Upgrading NVM when host controller is in safe mode”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj h²hh³hÇh´M5ubhÞ)�”}”(hX0If the existing NVM is not properly authenticated (or is missing) the host controller goes into safe mode which means that the only available functionality is flashing a new NVM image. When in this mode, reading ``nvm_version`` fails with ``ENODATA`` and the device identification information is missing.”h]”(hŒÔIf the existing NVM is not properly authenticated (or is missing) the host controller goes into safe mode which means that the only available functionality is flashing a new NVM image. When in this mode, reading ”…”�”}”(hj! h²hh³Nh´Nubhö)�”}”(hŒ``nvm_version``”h]”hŒ nvm_version”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj! ubhŒ fails with ”…”�”}”(hj! h²hh³Nh´Nubhö)�”}”(hŒ ``ENODATA``”h]”hŒENODATA”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj! ubhŒ6 and the device identification information is missing.”…”�”}”(hj! h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M6hj h²hubhÞ)�”}”(hŒŠTo recover from this mode, one needs to flash a valid NVM image to the host controller in the same way it is done in the previous chapter.”h]”hŒŠTo recover from this mode, one needs to flash a valid NVM image to the host controller in the same way it is done in the previous chapter.”…”�”}”(hjS h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M<hj h²hubeh}”(h]”Œ2upgrading-nvm-when-host-controller-is-in-safe-mode”ah ]”h"]”Œ2upgrading nvm when host controller is in safe mode”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M5ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒTunneling events”h]”hŒTunneling events”…”�”}”(hjl h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhji h²hh³hÇh´M@ubhÞ)�”}”(hŒ¯The driver sends ``KOBJ_CHANGE`` events to userspace when there is a tunneling change in the ``thunderbolt_domain``. The notification carries following environment variables::”h]”(hŒThe driver sends ”…”�”}”(hjz h²hh³Nh´Nubhö)�”}”(hŒ``KOBJ_CHANGE``”h]”hŒ KOBJ_CHANGE”…”�”}”(hj‚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjz ubhŒ= events to userspace when there is a tunneling change in the ”…”�”}”(hjz h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt_domain``”h]”hŒthunderbolt_domain”…”�”}”(hj” h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjz ubhŒ;. The notification carries following environment variables:”…”�”}”(hjz h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MAhji h²hubjo)�”}”(hŒ8TUNNEL_EVENT= TUNNEL_DETAILS=0:12 <-> 1:20 (USB3)”h]”hŒ8TUNNEL_EVENT= TUNNEL_DETAILS=0:12 <-> 1:20 (USB3)”…”�”}”hj¬ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´MEhji h²hubhÞ)�”}”(hŒ$Possible values for ```` are:”h]”(hŒPossible values for ”…”�”}”(hjº h²hh³Nh´Nubhö)�”}”(hŒ ````”h]”hŒ”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjº ubhŒ are:”…”�”}”(hjº h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MHhji h²hubj·)�”}”(hXQactivated The tunnel was activated (created). changed There is a change in this tunnel. For example bandwidth allocation was changed. deactivated The tunnel was torn down. low bandwidth The tunnel is not getting optimal bandwidth. insufficient bandwidth There is not enough bandwidth for the current tunnel requirements. ”h]”j½)�”}”(hhh]”(jÂ)�”}”(hŒ.activated The tunnel was activated (created). ”h]”(jÈ)�”}”(hŒ activated”h]”hŒ activated”…”�”}”(hjå h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´MKhjá ubjØ)�”}”(hhh]”hÞ)�”}”(hŒ#The tunnel was activated (created).”h]”hŒ#The tunnel was activated (created).”…”�”}”(hjö h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MKhjó ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hjá ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´MKhjÞ ubjÂ)�”}”(hŒXchanged There is a change in this tunnel. For example bandwidth allocation was changed. ”h]”(jÈ)�”}”(hŒchanged”h]”hŒchanged”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´MOhj ubjØ)�”}”(hhh]”hÞ)�”}”(hŒOThere is a change in this tunnel. For example bandwidth allocation was changed.”h]”hŒOThere is a change in this tunnel. For example bandwidth allocation was changed.”…”�”}”(hj% h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MNhj" ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´MOhjÞ ubjÂ)�”}”(hŒ&deactivated The tunnel was torn down. ”h]”(jÈ)�”}”(hŒ deactivated”h]”hŒ deactivated”…”�”}”(hjC h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´MRhj? ubjØ)�”}”(hhh]”hÞ)�”}”(hŒThe tunnel was torn down.”h]”hŒThe tunnel was torn down.”…”�”}”(hjT h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MRhjQ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj? ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´MRhjÞ ubjÂ)�”}”(hŒ;low bandwidth The tunnel is not getting optimal bandwidth. ”h]”(jÈ)�”}”(hŒ low bandwidth”h]”hŒ low bandwidth”…”�”}”(hjr h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´MUhjn ubjØ)�”}”(hhh]”hÞ)�”}”(hŒ,The tunnel is not getting optimal bandwidth.”h]”hŒ,The tunnel is not getting optimal bandwidth.”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MUhj€ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hjn ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´MUhjÞ ubjÂ)�”}”(hŒZinsufficient bandwidth There is not enough bandwidth for the current tunnel requirements. ”h]”(jÈ)�”}”(hŒinsufficient bandwidth”h]”hŒinsufficient bandwidth”…”�”}”(hj¡ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÇh³hÇh´MXhj� ubjØ)�”}”(hhh]”hÞ)�”}”(hŒBThere is not enough bandwidth for the current tunnel requirements.”h]”hŒBThere is not enough bandwidth for the current tunnel requirements.”…”�”}”(hj² h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MXhj¯ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j×hj� ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÁh³hÇh´MXhjÞ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¼hjÚ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¶h³hÇh´MJhji h²hubhÞ)�”}”(hXUThe ``TUNNEL_DETAILS`` is only provided if the tunnel is known. For example, in case of Firmware Connection Manager this is missing or does not provide full tunnel information. In case of Software Connection Manager this includes full tunnel details. The format currently matches what the driver uses when logging. This may change over time.”h]”(hŒThe ”…”�”}”(hjØ h²hh³Nh´Nubhö)�”}”(hŒ``TUNNEL_DETAILS``”h]”hŒTUNNEL_DETAILS”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjØ ubhX? is only provided if the tunnel is known. For example, in case of Firmware Connection Manager this is missing or does not provide full tunnel information. In case of Software Connection Manager this includes full tunnel details. The format currently matches what the driver uses when logging. This may change over time.”…”�”}”(hjØ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MZhji h²hubeh}”(h]”Œtunneling-events”ah ]”h"]”Œtunneling events”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M@ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ!Networking over Thunderbolt cable”h]”hŒ!Networking over Thunderbolt cable”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj h²hh³hÇh´MaubhÞ)�”}”(hŒhThunderbolt technology allows software communication between two hosts connected by a Thunderbolt cable.”h]”hŒhThunderbolt technology allows software communication between two hosts connected by a Thunderbolt cable.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mbhj h²hubhÞ)�”}”(hŒ€It is possible to tunnel any kind of traffic over a Thunderbolt link but currently we only support Apple ThunderboltIP protocol.”h]”hŒ€It is possible to tunnel any kind of traffic over a Thunderbolt link but currently we only support Apple ThunderboltIP protocol.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mehj h²hubhÞ)�”}”(hX7If the other host is running Windows or macOS, the only thing you need to do is to connect a Thunderbolt cable between the two hosts; the ``thunderbolt-net`` driver is loaded automatically. If the other host is also Linux you should load ``thunderbolt-net`` manually on one host (it does not matter which one)::”h]”(hŒŠIf the other host is running Windows or macOS, the only thing you need to do is to connect a Thunderbolt cable between the two hosts; the ”…”�”}”(hj- h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt-net``”h]”hŒthunderbolt-net”…”�”}”(hj5 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj- ubhŒQ driver is loaded automatically. If the other host is also Linux you should load ”…”�”}”(hj- h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt-net``”h]”hŒthunderbolt-net”…”�”}”(hjG h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj- ubhŒ5 manually on one host (it does not matter which one):”…”�”}”(hj- h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhhj h²hubjo)�”}”(hŒ# modprobe thunderbolt-net”h]”hŒ# modprobe thunderbolt-net”…”�”}”hj_ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´Mnhj h²hubhÞ)�”}”(hŒŠThis triggers module load on the other host automatically. If the driver is built-in to the kernel image, there is no need to do anything.”h]”hŒŠThis triggers module load on the other host automatically. If the driver is built-in to the kernel image, there is no need to do anything.”…”�”}”(hjm h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mphj h²hubhÞ)�”}”(hXThe driver will create one virtual ethernet interface per Thunderbolt port which are named like ``thunderbolt0`` and so on. From this point you can either use standard userspace tools like ``ip`` to configure the interface or let your GUI handle it automatically.”h]”(hŒ`The driver will create one virtual ethernet interface per Thunderbolt port which are named like ”…”�”}”(hj{ h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt0``”h]”hŒ thunderbolt0”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj{ ubhŒM and so on. From this point you can either use standard userspace tools like ”…”�”}”(hj{ h²hh³Nh´Nubhö)�”}”(hŒ``ip``”h]”hŒip”…”�”}”(hj• h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj{ ubhŒD to configure the interface or let your GUI handle it automatically.”…”�”}”(hj{ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mshj h²hubeh}”(h]”Œ!networking-over-thunderbolt-cable”ah ]”h"]”Œ!networking over thunderbolt cable”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MaubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ.Streaming data directly over Thunderbolt cable”h]”hŒ.Streaming data directly over Thunderbolt cable”…”�”}”(hj¸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjµ h²hh³hÇh´MyubhÞ)�”}”(hŒ»In addition to Thunderbolt networking (aka. USB4NET) Linux supports streaming data directly over a cable as well (aka. USB4STREAM). This is possible through ``thunderbolt-stream`` driver.”h]”(hŒ�In addition to Thunderbolt networking (aka. USB4NET) Linux supports streaming data directly over a cable as well (aka. USB4STREAM). This is possible through ”…”�”}”(hjÆ h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt-stream``”h]”hŒthunderbolt-stream”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÆ ubhŒ driver.”…”�”}”(hjÆ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mzhjµ h²hubhÞ)�”}”(hŒGSimilarly to ``thunderbolt-net`` you load the driver first on one end::”h]”(hŒ Similarly to ”…”�”}”(hjæ h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt-net``”h]”hŒthunderbolt-net”…”�”}”(hjî h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjæ ubhŒ& you load the driver first on one end:”…”�”}”(hjæ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M~hjµ h²hubjo)�”}”(hŒ#host1 # modprobe thunderbolt-stream”h]”hŒ#host1 # modprobe thunderbolt-stream”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M€hjµ h²hubhÞ)�”}”(hŒ(Then you configure it via ``ConfigFS``::”h]”(hŒThen you configure it via ”…”�”}”(hj h²hh³Nh´Nubhö)�”}”(hŒ ``ConfigFS``”h]”hŒConfigFS”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ:”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M‚hjµ h²hubjo)�”}”(hŒžhost1 # cd /sys/kernel/config/thunderbolt/stream host1 # mkdir -p 0-1.0/data host1 # cd 0-1.0 host1 # echo -1 > data/in_hopid host1 # echo -1 > data/out_hopid”h]”hŒžhost1 # cd /sys/kernel/config/thunderbolt/stream host1 # mkdir -p 0-1.0/data host1 # cd 0-1.0 host1 # echo -1 > data/in_hopid host1 # echo -1 > data/out_hopid”…”�”}”hj4 sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M„hjµ h²hubhÞ)�”}”(hŒåThis information is automatically announced to the other side via XDomain properties so if you have cable connected the other side knows that there is a stream named ``data`` available and can configure it for you automatically::”h]”(hŒ¦This information is automatically announced to the other side via XDomain properties so if you have cable connected the other side knows that there is a stream named ”…”�”}”(hjB h²hh³Nh´Nubhö)�”}”(hŒ``data``”h]”hŒdata”…”�”}”(hjJ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjB ubhŒ6 available and can configure it for you automatically:”…”�”}”(hjB h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MŠhjµ h²hubjo)�”}”(hŒLhost2 # cd /sys/kernel/config/thunderbolt/stream host2 # mkdir -p 0-3.0/data”h]”hŒLhost2 # cd /sys/kernel/config/thunderbolt/stream host2 # mkdir -p 0-3.0/data”…”�”}”hjb sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M�hjµ h²hubhÞ)�”}”(hŒìHere we used auto-configuration but you can configure it manually too. In that case you need to fill ``in_hopid`` and ``out_hopid`` accordingly. If you set them to ``-1`` the next available HopID is used which is typically what we want.”h]”(hŒeHere we used auto-configuration but you can configure it manually too. In that case you need to fill ”…”�”}”(hjp h²hh³Nh´Nubhö)�”}”(hŒ ``in_hopid``”h]”hŒin_hopid”…”�”}”(hjx h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjp ubhŒ and ”…”�”}”(hjp h²hh³Nh´Nubhö)�”}”(hŒ ``out_hopid``”h]”hŒ out_hopid”…”�”}”(hjŠ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjp ubhŒ! accordingly. If you set them to ”…”�”}”(hjp h²hh³Nh´Nubhö)�”}”(hŒ``-1``”h]”hŒ-1”…”�”}”(hjœ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjp ubhŒB the next available HopID is used which is typically what we want.”…”�”}”(hjp h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M’hjµ h²hubhÞ)�”}”(hŒXOnce they are configured you can use ``/dev/tbstreamX`` on both sides to transfer data::”h]”(hŒ%Once they are configured you can use ”…”�”}”(hj´ h²hh³Nh´Nubhö)�”}”(hŒ``/dev/tbstreamX``”h]”hŒ/dev/tbstreamX”…”�”}”(hj¼ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj´ ubhŒ on both sides to transfer data:”…”�”}”(hj´ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M—hjµ h²hubjo)�”}”(hŒ9host2 # cat /dev/tbstream0 host1 # dmesg > /dev/tbstream0”h]”hŒ9host2 # cat /dev/tbstream0 host1 # dmesg > /dev/tbstream0”…”�”}”hjÔ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´Mšhjµ h²hubhÞ)�”}”(hŒ7Once you are done with the stream you can remove them::”h]”hŒ6Once you are done with the stream you can remove them:”…”�”}”(hjâ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M�hjµ h²hubjo)�”}”(hŒ™host2 # cd /sys/kernel/config/thunderbolt/stream host2 # rmdir -p 0-1.0/data host1 # cd /sys/kernel/config/thunderbolt/stream host1 # rmdir -p 0-3.0/data”h]”hŒ™host2 # cd /sys/kernel/config/thunderbolt/stream host2 # rmdir -p 0-1.0/data host1 # cd /sys/kernel/config/thunderbolt/stream host1 # rmdir -p 0-3.0/data”…”�”}”hjð sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´MŸhjµ h²hubhÞ)�”}”(hŒ�Since streams are essentially files you can use any existing application that supports ``read(2)`` and ``write(2)`` in some form.”h]”(hŒWSince streams are essentially files you can use any existing application that supports ”…”�”}”(hjþ h²hh³Nh´Nubhö)�”}”(hŒ ``read(2)``”h]”hŒread(2)”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjþ ubhŒ and ”…”�”}”(hjþ h²hh³Nh´Nubhö)�”}”(hŒ ``write(2)``”h]”hŒwrite(2)”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjþ ubhŒ in some form.”…”�”}”(hjþ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M¤hjµ h²hubhÞ)�”}”(hŒÌIt is possible to have more than one stream and you can have both stream and ``thunderbolt-net`` in use simultaneously. For example we can create two streams with name ``control`` and ``data`` like this::”h]”(hŒMIt is possible to have more than one stream and you can have both stream and ”…”�”}”(hj0 h²hh³Nh´Nubhö)�”}”(hŒ``thunderbolt-net``”h]”hŒthunderbolt-net”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj0 ubhŒH in use simultaneously. For example we can create two streams with name ”…”�”}”(hj0 h²hh³Nh´Nubhö)�”}”(hŒ ``control``”h]”hŒcontrol”…”�”}”(hjJ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj0 ubhŒ and ”…”�”}”(hj0 h²hh³Nh´Nubhö)�”}”(hŒ``data``”h]”hŒdata”…”�”}”(hj\ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj0 ubhŒ like this:”…”�”}”(hj0 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M§hjµ h²hubjo)�”}”(hŒ~host1 # cd /sys/kernel/config/thunderbolt/stream host1 # mkdir 0-1.0 host1 # cd 0-1.0 host1 # mkdir control host1 # mkdir data”h]”hŒ~host1 # cd /sys/kernel/config/thunderbolt/stream host1 # mkdir 0-1.0 host1 # cd 0-1.0 host1 # mkdir control host1 # mkdir data”…”�”}”hjt sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jnh³hÇh´M«hjµ h²hubhÞ)�”}”(hŒ°Then you have ``/dev/tbstream0`` for ``control`` and ``/dev/tbstream1`` for ``data``. Before you can use them you need to configure them as shown above for the one stream case.”h]”(hŒThen you have ”…”�”}”(hj‚ h²hh³Nh´Nubhö)�”}”(hŒ``/dev/tbstream0``”h]”hŒ/dev/tbstream0”…”�”}”(hjŠ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj‚ ubhŒ for ”…”�”}”(hj‚ h²hh³Nh´Nubhö)�”}”(hŒ ``control``”h]”hŒcontrol”…”�”}”(hjœ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj‚ ubhŒ and ”…”�”}”(hj‚ h²hh³Nh´Nubhö)�”}”(hŒ``/dev/tbstream1``”h]”hŒ/dev/tbstream1”…”�”}”(hj® h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj‚ ubhŒ for ”…”�”}”(hj‚ h²hh³Nh´Nubhö)�”}”(hŒ``data``”h]”hŒdata”…”�”}”(hjÀ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj‚ ubhŒ\. Before you can use them you need to configure them as shown above for the one stream case.”…”�”}”(hj‚ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M±hjµ h²hubeh}”(h]”Œ.streaming-data-directly-over-thunderbolt-cable”ah ]”h"]”Œ.streaming data directly over thunderbolt cable”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MyubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Forcing power”h]”hŒ Forcing power”…”�”}”(hjã h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjà h²hh³hÇh´M¶ubhÞ)�”}”(hXGMany OEMs include a method that can be used to force the power of a Thunderbolt controller to an "On" state even if nothing is connected. If supported by your machine this will be exposed by the WMI bus with a sysfs attribute called "force_power", see Documentation/ABI/testing/sysfs-platform-intel-wmi-thunderbolt for details.”•R h]”hXOMany OEMs include a method that can be used to force the power of a Thunderbolt controller to an “Onâ€� state even if nothing is connected. If supported by your machine this will be exposed by the WMI bus with a sysfs attribute called “force_powerâ€�, see Documentation/ABI/testing/sysfs-platform-intel-wmi-thunderbolt for details.”…”�”}”(hjñ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M·hjà h²hubhÞ)�”}”(hŒONote: it's currently not possible to query the force power state of a platform.”h]”hŒQNote: it’s currently not possible to query the force power state of a platform.”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M½hjà h²hubeh}”(h]”Œ forcing-power”ah ]”h"]”Œ forcing power”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M¶ubeh}”(h]”Œusb4-and-thunderbolt”ah ]”h"]”Œusb4 and thunderbolt”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j@Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jjjäjáj{jxjøjõj•j’jOjLj*j'j j jf jc jý jú j² j¯ jÝ jÚ jjuŒ nametypes”}”(j‰jä‰j{‰jø‰j•‰jO‰j*‰j ‰jf ‰jý ‰j² ‰jÝ ‰j‰uh}”(jhÊjáj!jxjçjõj~j’jûjLj˜j'jRj j-jc j jú ji j¯ j jÚ jµ jjà uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.