26 Aug, 2019

1 commit

  • The Thunderbolt controller is integrated into the Ice Lake CPU itself
    and requires special flows to power it on and off using force power bit
    in NHI VSEC registers. Runtime PM (RTD3) and Sx flows also differ from
    the discrete solutions. Now the firmware notifies the driver whether
    RTD3 entry or exit are possible. The driver is responsible of sending
    Go2Sx command through link controller mailbox when system enters Sx
    states (suspend-to-mem/disk). Rest of the ICM firwmare flows follow
    Titan Ridge.

    Signed-off-by: Raanan Avargil
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Tested-by: Mario Limonciello

    Mika Westerberg
     

03 Oct, 2018

1 commit

  • Intel has done pretty major changes to the driver and we continue to do
    so in the future as well. Add Intel as copyright holder of the files we
    have done changes.

    While there drop "Cactus Ridge" from the headers because this driver
    works also with other Thunderbolt controllers.

    No functional changes intended.

    Signed-off-by: Mika Westerberg
    Acked-by: Yehezkel Bernat
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     

04 Nov, 2017

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Oct, 2017

3 commits

  • A Thunderbolt service driver might need to check if there was an error
    with the descriptor when in frame mode. We also add two Rx specific
    error flags RING_DESC_CRC_ERROR and RING_DESC_BUFFER_OVERRUN.

    Signed-off-by: Mika Westerberg
    Reviewed-by: Michael Jamet
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Mika Westerberg
     
  • When high-speed DMA paths are used to transfer arbitrary data over a
    Thunderbolt link, DMA rings should be in frame mode instead of raw mode.
    The latter is used by the control channel (ring 0). In frame mode each
    data frame can hold up to 4kB payload.

    This patch modifies the DMA ring code to allow configuring a ring to be
    in frame mode by passing a new flag (RING_FLAG_FRAME) to the ring when
    it is allocated. In addition there might be need to enable end-to-end
    (E2E) workaround for the ring to prevent losing Rx frames in certain
    situations. We add another flag (RING_FLAG_E2E) that can be used for
    this purpose.

    This code is based on the work done by Amir Levy and Michael Jamet.

    Signed-off-by: Michael Jamet
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Mika Westerberg
     
  • This will keep the interrupt delivery rate reasonable. The value used
    here (128 us) is a recommendation from the hardware people.

    This code is based on the work done by Amir Levy and Michael Jamet.

    Signed-off-by: Michael Jamet
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Mika Westerberg
     

09 Jun, 2017

3 commits

  • Starting from Intel Falcon Ridge the internal connection manager running
    on the Thunderbolt host controller has been supporting 4 security
    levels. One reason for this is to prevent DMA attacks and only allow
    connecting devices the user trusts.

    The internal connection manager (ICM) is the preferred way of connecting
    Thunderbolt devices over software only implementation typically used on
    Macs. The driver communicates with ICM using special Thunderbolt ring 0
    (control channel) messages. In order to handle these messages we add
    support for the ICM messages to the control channel.

    The security levels are as follows:

    none - No security, all tunnels are created automatically
    user - User needs to approve the device before tunnels are created
    secure - User need to approve the device before tunnels are created.
    The device is sent a challenge on future connects to be able
    to verify it is actually the approved device.
    dponly - Only Display Port and USB tunnels can be created and those
    are created automatically.

    The security levels are typically configurable from the system BIOS and
    by default it is set to "user" on many systems.

    In this patch each Thunderbolt device will have either one or two new
    sysfs attributes: authorized and key. The latter appears for devices
    that support secure connect.

    In order to identify the device the user can read identication
    information, including UUID and name of the device from sysfs and based
    on that make a decision to authorize the device. The device is
    authorized by simply writing 1 to the "authorized" sysfs attribute. This
    is following the USB bus device authorization mechanism. The secure
    connect requires an additional challenge step (writing 2 to the
    "authorized" attribute) in future connects when the key has already been
    stored to the NVM of the device.

    Non-ICM systems (before Alpine Ridge) continue to use the existing
    functionality and the security level is set to none. For systems with
    Alpine Ridge, even on Apple hardware, we will use ICM.

    This code is based on the work done by Amir Levy and Michael Jamet.

    Signed-off-by: Michael Jamet
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Andreas Noever
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     
  • The host controller includes two sets of registers that are used to
    communicate with the firmware. Add functions that can be used to access
    these registers.

    This code is based on the work done by Amir Levy and Michael Jamet.

    Signed-off-by: Michael Jamet
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Andreas Noever
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     
  • Intel Thunderbolt controllers support up to 16 MSI-X vectors. Using
    MSI-X is preferred over MSI or legacy interrupt and may bring additional
    performance because there is no need to check the status registers which
    interrupt was triggered.

    While there we convert comments in structs tb_ring and tb_nhi to follow
    kernel-doc format more closely.

    This code is based on the work done by Amir Levy and Michael Jamet.

    Signed-off-by: Michael Jamet
    Signed-off-by: Mika Westerberg
    Reviewed-by: Yehezkel Bernat
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Andreas Noever
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     

09 Nov, 2016

1 commit

  • This first patch updates the NHI Thunderbolt controller registers file to
    reflect that it is not only for Cactus Ridge.
    No functional change intended.

    Signed-off-by: Amir Levy
    Signed-off-by: Andreas Noever
    Signed-off-by: Greg Kroah-Hartman

    Amir Levy
     

20 Jun, 2014

1 commit

  • Thunderbolt hotplug is supposed to be handled by the firmware. But Apple
    decided to implement thunderbolt at the operating system level. The
    firmare only initializes thunderbolt devices that are present at boot
    time. This driver enables hotplug of thunderbolt of non-chained
    thunderbolt devices on Apple systems with a cactus ridge controller.

    This first patch adds the Kconfig file as well the parts of the driver
    which talk directly to the hardware (that is pci device setup, interrupt
    handling and RX/TX ring management).

    Signed-off-by: Andreas Noever
    Signed-off-by: Greg Kroah-Hartman

    Andreas Noever