Skip to content

Thunderbolt driver for Apple MacBooks

Andreas Noever linux-pci lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest15 patches 7 repliesIn review
  2. v415 patches 7 repliesSuperseded
  3. v315 patches 8 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v214 patches3 repliesSuperseded
v112 patches7 repliesSuperseded

Changes in v5 from the cover letter

- Changed the PCI quirks to check just for Apple hardware instead of checking against a list of machines. (The PCI id check already restricts this quirk
to the relevant Apple machines).
- Added Falcon Ridge PCI id to the driver and to the "wait_for_thunderbolt" quirk (the "poweroff_thunderbolt" quirk is no longer necessary for Falcon
Ridge devices).
- Fixed plug events for Falcon Ridge hardware.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15thunderbolt: Add initial cactus ridge NHI supportdrivers/Kconfig drivers/Makefile drivers/thunderbolt/Kconfig +4 more+863 -04 replies
2/15thunderbolt: Add control channel interfacedrivers/thunderbolt/Makefile drivers/thunderbolt/ctl.c drivers/thunderbolt/ctl.h+807 -10 replies
3/15thunderbolt: Setup control channeldrivers/thunderbolt/Makefile drivers/thunderbolt/nhi.c drivers/thunderbolt/tb.c +1 more+186 -30 replies
4/15thunderbolt: Add tb_regs.hdrivers/thunderbolt/tb.c drivers/thunderbolt/tb_regs.h+218 -00 replies
5/15thunderbolt: Initialize root switch and portsdrivers/thunderbolt/Makefile drivers/thunderbolt/switch.c drivers/thunderbolt/tb.c +1 more+333 -10 replies
6/15thunderbolt: Add thunderbolt capability handlingdrivers/thunderbolt/Makefile drivers/thunderbolt/cap.c drivers/thunderbolt/tb.h+119 -10 replies
7/15thunderbolt: Enable plug eventsdrivers/thunderbolt/switch.c drivers/thunderbolt/tb.h+53 -00 replies
8/15thunderbolt: Scan for downstream switchesdrivers/thunderbolt/switch.c drivers/thunderbolt/tb.c drivers/thunderbolt/tb.h+157 -00 replies
9/15thunderbolt: Handle hotplug eventsdrivers/thunderbolt/switch.c drivers/thunderbolt/tb.c drivers/thunderbolt/tb.h+89 -20 replies
10/15thunderbolt: Add path setup code.drivers/thunderbolt/Makefile drivers/thunderbolt/path.c drivers/thunderbolt/switch.c +1 more+312 -10 replies
11/15thunderbolt: Add support for simple pci tunnelsdrivers/thunderbolt/Makefile drivers/thunderbolt/tb.c drivers/thunderbolt/tb.h +2 more+399 -10 replies
12/15PCI: Add pci_fixup_suspend_late quirk passdrivers/pci/pci-driver.c drivers/pci/quirks.c include/asm-generic/vmlinux.lds.h +1 more+35 -50 replies
13/15PCI: Suspend/resume quirks for Apple thunderboltdrivers/pci/quirks.c+97 -00 replies
14/15thunderbolt: Read switch uid from EEPROMdrivers/thunderbolt/Makefile drivers/thunderbolt/eeprom.c drivers/thunderbolt/switch.c +1 more+198 -10 replies
15/15thunderbolt: Add suspend/hibernate supportdrivers/thunderbolt/nhi.c drivers/thunderbolt/switch.c drivers/thunderbolt/tb.c +1 more+183 -00 replies

Reviews trailers per patch

1 of 15 patches has a Reviewed-by or Acked-by.

PatchBjorn Helgaas
1/15
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15A-b
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/15] Thunderbolt driver for Apple MacBooks

Hi,

Updated version of the driver. Includes changes by Matthew to make it work on Falcon Ridge hardware (present in the newest Mac(Book)Pro).

Changes since v4 (suggested by Matthew):
- Changed the PCI quirks to check just for Apple hardware instead of checking against a list of machines. (The PCI id check already restricts this quirk
to the relevant Apple machines).
- Added Falcon Ridge PCI id to the driver and to the "wait_for_thunderbolt" quirk (the "poweroff_thunderbolt" quirk is no longer necessary for Falcon
Ridge devices).
- Fixed plug events for Falcon Ridge hardware.

@Matthew: I think that your patch was missing the Falcon Ridge PCI id within the wait_for_thunderbolt quirk (I have added it). If you have time could you verify that suspend/resume works on your MacPro? Thanks!

As before Matthew's ACPI changes (latest version: [1]) are required for this to work properly. Without them you need to boot with a coldplugged TB device to prevent the firmware from disabling the controller.

Thanks,
Andreas

[1]: https://lkml.org/lkml/2014/6/1/165

Andreas Noever (15):
thunderbolt: Add initial cactus ridge NHI support
thunderbolt: Add control channel interface
thunderbolt: Setup control channel
thunderbolt: Add tb_regs.h
thunderbolt: Initialize root switch and ports
thunderbolt: Add thunderbolt capability handling
thunderbolt: Enable plug events
thunderbolt: Scan for downstream switches
thunderbolt: Handle hotplug events
thunderbolt: Add path setup code.
thunderbolt: Add support for simple pci tunnels
PCI: Add pci_fixup_suspend_late quirk pass
PCI: Suspend/resume quirks for Apple thunderbolt
thunderbolt: Read switch uid from EEPROM
thunderbolt: Add suspend/hibernate support

 drivers/Kconfig                   |   2 +
 drivers/Makefile                  |   1 +
 drivers/pci/pci-driver.c          |  18 +-
 drivers/pci/quirks.c              | 104 ++++++
 drivers/thunderbolt/Kconfig       |  12 +
 drivers/thunderbolt/Makefile      |   3 +
 drivers/thunderbolt/cap.c         | 116 ++++++
 drivers/thunderbolt/ctl.c         | 731 ++++++++++++++++++++++++++++++++++++++
 drivers/thunderbolt/ctl.h         |  75 ++++
 drivers/thunderbolt/eeprom.c      | 189 ++++++++++
 drivers/thunderbolt/nhi.c         | 677 +++++++++++++++++++++++++++++++++++
 drivers/thunderbolt/nhi.h         | 114 ++++++
 drivers/thunderbolt/nhi_regs.h    | 101 ++++++
 drivers/thunderbolt/path.c        | 215 +++++++++++
 drivers/thunderbolt/switch.c      | 498 ++++++++++++++++++++++++++
 drivers/thunderbolt/tb.c          | 431 ++++++++++++++++++++++
 drivers/thunderbolt/tb.h          | 266 ++++++++++++++
 drivers/thunderbolt/tb_regs.h     | 213 +++++++++++
 drivers/thunderbolt/tunnel_pci.c  | 232 ++++++++++++
 drivers/thunderbolt/tunnel_pci.h  |  30 ++
 include/asm-generic/vmlinux.lds.h |   3 +
 include/linux/pci.h               |  12 +-
 22 files changed, 4038 insertions(+), 5 deletions(-)
 create mode 100644 drivers/thunderbolt/Kconfig
 create mode 100644 drivers/thunderbolt/Makefile
 create mode 100644 drivers/thunderbolt/cap.c
 create mode 100644 drivers/thunderbolt/ctl.c
 create mode 100644 drivers/thunderbolt/ctl.h
 create mode 100644 drivers/thunderbolt/eeprom.c
 create mode 100644 drivers/thunderbolt/nhi.c
 create mode 100644 drivers/thunderbolt/nhi.h
 create mode 100644 drivers/thunderbolt/nhi_regs.h
 create mode 100644 drivers/thunderbolt/path.c
 create mode 100644 drivers/thunderbolt/switch.c
 create mode 100644 drivers/thunderbolt/tb.c
 create mode 100644 drivers/thunderbolt/tb.h
 create mode 100644 drivers/thunderbolt/tb_regs.h
 create mode 100644 drivers/thunderbolt/tunnel_pci.c
 create mode 100644 drivers/thunderbolt/tunnel_pci.h
Signature · 1 line
2.0.0