• Kranthi Kuntala's avatar
    thunderbolt: Add support for on-board retimers · dacb1287
    Kranthi Kuntala authored
    USB4 spec specifies standard access to retimers (both on-board and
    cable) through USB4 port sideband access. This makes it possible to
    upgrade their firmware in the same way than we already do with the
    routers.
    
    This enumerates on-board retimers under each USB4 port when the link
    comes up and adds them to the bus under the router the retimer belongs
    to. Retimers are exposed in sysfs with name like <device>:<port>.<index>
    where device is the router the retimer belongs to, port is the USB4 port
    the retimer is connected to and index is the retimer index under that
    port (starting from 1). This applies to the upstream USB4 port as well
    so if there is on-board retimer between the port and the router it is
    also added accordingly.
    
    At this time we do not add cable retimers but there is no techincal
    restriction to do so in the future if needed. It is not clear whether it
    makes sense to upgrade their firmwares and at least Thunderbolt 3 cables
    it has not been done outside of lab environments.
    
    The sysfs interface is made to follow the router NVM upgrade to make it
    easy to extend the existing userspace (fwupd) to handle these as well.
    Signed-off-by: default avatarKranthi Kuntala <kranthi.kuntala@intel.com>
    Co-developed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    dacb1287
tb.c 31.6 KB