mbox series

[v2,0/9] thunderbolt: Add support for USB4

Message ID 20191217123345.31850-1-mika.westerberg@linux.intel.com (mailing list archive)
Headers show
Series thunderbolt: Add support for USB4 | expand

Message

Mika Westerberg Dec. 17, 2019, 12:33 p.m. UTC
Hi all,

USB4 is the public specification of Thunderbolt 3 protocol and can be
downloaded here:

  https://www.usb.org/sites/default/files/USB4%20Specification_1.zip

USB4 is about tunneling different protocols over a single cable (in the
same way as Thunderbolt). The current USB4 spec supports PCIe, Display Port
and USB 3.x, and also software based protocols such as networking between
domains (hosts).

So far PCs have been using firmware based Connection Manager (FW CM, ICM)
and Apple systems have been using software based one (SW CM, ECM). A
Connection Manager is the entity that handles creation of different tunnel
types through the USB4 (and Thunderbolt) fabric. With USB4 the plan is to
have software based Connection Manager everywhere but some early systems
will come with firmware based connection manager.

Current Linux Thunderbolt driver supports both "modes" and can detect which
one to use dynamically.

This series extends the Linux Thunderbolt driver to support USB4 compliant
hosts and devices (this applies to both firmware and software based
connection managers). USB4 Features enabled by this series include:

  - PCIe tunneling
  - Display Port tunneling
  - USB 3.x tunneling
  - P2P networking (implemented in drivers/net/thunderbolt.c)
  - Host and device NVM firmware upgrade

Power management support is still work in progress. It will be submitted
later on once properly tested.

The previous versions of the series can be seen here:

  v1: https://lore.kernel.org/linux-usb/20191023112154.64235-1-mika.westerberg@linux.intel.com/
  RFC: https://lore.kernel.org/lkml/20191001113830.13028-1-mika.westerberg@linux.intel.com/

Changes from v1:

  * Rebased on top of v5.5-rc2.
  * Add a new patch to populate PG field in hotplug ack packet.
  * Rename the networking driver Kconfig symbol to CONFIG_USB4_NET to
    follow the driver itself (CONFIG_USB4).

Changes from the RFC version:

  * Spelled out what are ICM, and SW CM (and ECM)
  * Log warning in tb_switch_add() instead of the caller
  * Use Lukas' suggestion in port walk helper macro and also drop
    tb_switch_for_each_remote_port() and tb_switch_for_each_connected_port()
  * Rework icm.c::add_switch() so that we don't need to pass huge amount of
    parameters to it
  * Add rx/tx versions of link width/speed attributes following convention
    used in USB bus (with the exception that we provide rx_speed and
    tx_speed as well).
  * Spell out DROM and try to clarify what linking in patch [11/25] means.
  * Add a new patch that expands controller name in existing tb_switch_is_xy()
    functions and do the same for tb_switch_is_ar()/tr().
  * Move register name conversion pathes up in the series so that we can
    apply them for v5.5 already.
  * Update changelog of patch [14/25] so that it only mentions Titan Ridge.
  * Rename CONFIG_THUNDERBOLT to CONFIG_USB4, this should be more future
    proof.
  * Check if TMU is enabled in tb_switch_tmu_enable().
  * Use "usb3" and "USB3" in USB 3.x tunneling functionality instead of
    plain "usb".
  * Reword documentation patch [25/25] according to received comments.
  * Introduce icm_firmware_running().

Mika Westerberg (6):
  thunderbolt: Make tb_find_port() available to other files
  thunderbolt: Call tb_eeprom_get_drom_offset() from tb_eeprom_read_n()
  thunderbolt: Populate PG field in hot plug acknowledgment packet
  thunderbolt: Add initial support for USB4
  thunderbolt: Update Kconfig entries to USB4
  thunderbolt: Update documentation with the USB4 information

Rajmohan Mani (3):
  thunderbolt: Make tb_switch_find_cap() available to other files
  thunderbolt: Add support for Time Management Unit
  thunderbolt: Add support for USB 3.x tunnels

 Documentation/admin-guide/thunderbolt.rst |  30 +-
 drivers/Makefile                          |   2 +-
 drivers/net/Kconfig                       |  10 +-
 drivers/net/Makefile                      |   2 +-
 drivers/thunderbolt/Kconfig               |  11 +-
 drivers/thunderbolt/Makefile              |   4 +-
 drivers/thunderbolt/cap.c                 |  11 +-
 drivers/thunderbolt/ctl.c                 |  19 +-
 drivers/thunderbolt/ctl.h                 |   3 +-
 drivers/thunderbolt/eeprom.c              | 137 ++--
 drivers/thunderbolt/nhi.c                 |   3 +
 drivers/thunderbolt/nhi.h                 |   2 +
 drivers/thunderbolt/switch.c              | 439 ++++++++++---
 drivers/thunderbolt/tb.c                  | 227 +++++--
 drivers/thunderbolt/tb.h                  | 101 +++
 drivers/thunderbolt/tb_msgs.h             |   6 +-
 drivers/thunderbolt/tb_regs.h             |  65 +-
 drivers/thunderbolt/tmu.c                 | 383 +++++++++++
 drivers/thunderbolt/tunnel.c              | 169 ++++-
 drivers/thunderbolt/tunnel.h              |   9 +
 drivers/thunderbolt/usb4.c                | 764 ++++++++++++++++++++++
 drivers/thunderbolt/xdomain.c             |   6 +
 22 files changed, 2167 insertions(+), 236 deletions(-)
 create mode 100644 drivers/thunderbolt/tmu.c
 create mode 100644 drivers/thunderbolt/usb4.c

Comments

Greg KH Dec. 18, 2019, 2:43 p.m. UTC | #1
On Tue, Dec 17, 2019 at 03:33:36PM +0300, Mika Westerberg wrote:
> Hi all,
> 
> USB4 is the public specification of Thunderbolt 3 protocol and can be
> downloaded here:
> 
>   https://www.usb.org/sites/default/files/USB4%20Specification_1.zip
> 
> USB4 is about tunneling different protocols over a single cable (in the
> same way as Thunderbolt). The current USB4 spec supports PCIe, Display Port
> and USB 3.x, and also software based protocols such as networking between
> domains (hosts).
> 
> So far PCs have been using firmware based Connection Manager (FW CM, ICM)
> and Apple systems have been using software based one (SW CM, ECM). A
> Connection Manager is the entity that handles creation of different tunnel
> types through the USB4 (and Thunderbolt) fabric. With USB4 the plan is to
> have software based Connection Manager everywhere but some early systems
> will come with firmware based connection manager.
> 
> Current Linux Thunderbolt driver supports both "modes" and can detect which
> one to use dynamically.
> 
> This series extends the Linux Thunderbolt driver to support USB4 compliant
> hosts and devices (this applies to both firmware and software based
> connection managers). USB4 Features enabled by this series include:
> 
>   - PCIe tunneling
>   - Display Port tunneling
>   - USB 3.x tunneling
>   - P2P networking (implemented in drivers/net/thunderbolt.c)
>   - Host and device NVM firmware upgrade
> 
> Power management support is still work in progress. It will be submitted
> later on once properly tested.
> 
> The previous versions of the series can be seen here:
> 
>   v1: https://lore.kernel.org/linux-usb/20191023112154.64235-1-mika.westerberg@linux.intel.com/
>   RFC: https://lore.kernel.org/lkml/20191001113830.13028-1-mika.westerberg@linux.intel.com/
> 
> Changes from v1:
> 
>   * Rebased on top of v5.5-rc2.
>   * Add a new patch to populate PG field in hotplug ack packet.
>   * Rename the networking driver Kconfig symbol to CONFIG_USB4_NET to
>     follow the driver itself (CONFIG_USB4).

At a quick glance, this looks nice and sane, good job.  I've taken all
of these into my tree, let's see if 0-day has any problems with it :)

thanks,

greg k-h
Mika Westerberg Dec. 18, 2019, 3:30 p.m. UTC | #2
On Wed, Dec 18, 2019 at 03:43:16PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Dec 17, 2019 at 03:33:36PM +0300, Mika Westerberg wrote:
> > Hi all,
> > 
> > USB4 is the public specification of Thunderbolt 3 protocol and can be
> > downloaded here:
> > 
> >   https://www.usb.org/sites/default/files/USB4%20Specification_1.zip
> > 
> > USB4 is about tunneling different protocols over a single cable (in the
> > same way as Thunderbolt). The current USB4 spec supports PCIe, Display Port
> > and USB 3.x, and also software based protocols such as networking between
> > domains (hosts).
> > 
> > So far PCs have been using firmware based Connection Manager (FW CM, ICM)
> > and Apple systems have been using software based one (SW CM, ECM). A
> > Connection Manager is the entity that handles creation of different tunnel
> > types through the USB4 (and Thunderbolt) fabric. With USB4 the plan is to
> > have software based Connection Manager everywhere but some early systems
> > will come with firmware based connection manager.
> > 
> > Current Linux Thunderbolt driver supports both "modes" and can detect which
> > one to use dynamically.
> > 
> > This series extends the Linux Thunderbolt driver to support USB4 compliant
> > hosts and devices (this applies to both firmware and software based
> > connection managers). USB4 Features enabled by this series include:
> > 
> >   - PCIe tunneling
> >   - Display Port tunneling
> >   - USB 3.x tunneling
> >   - P2P networking (implemented in drivers/net/thunderbolt.c)
> >   - Host and device NVM firmware upgrade
> > 
> > Power management support is still work in progress. It will be submitted
> > later on once properly tested.
> > 
> > The previous versions of the series can be seen here:
> > 
> >   v1: https://lore.kernel.org/linux-usb/20191023112154.64235-1-mika.westerberg@linux.intel.com/
> >   RFC: https://lore.kernel.org/lkml/20191001113830.13028-1-mika.westerberg@linux.intel.com/
> > 
> > Changes from v1:
> > 
> >   * Rebased on top of v5.5-rc2.
> >   * Add a new patch to populate PG field in hotplug ack packet.
> >   * Rename the networking driver Kconfig symbol to CONFIG_USB4_NET to
> >     follow the driver itself (CONFIG_USB4).
> 
> At a quick glance, this looks nice and sane, good job.  I've taken all
> of these into my tree, let's see if 0-day has any problems with it :)

Thanks :)