Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Andreas Noever | 1660315 | 2014-06-03 22:03:58 +0200 | [diff] [blame] | 2 | /* |
Mika Westerberg | 15c6784 | 2018-10-01 12:31:22 +0300 | [diff] [blame] | 3 | * Thunderbolt driver - NHI driver |
Andreas Noever | 1660315 | 2014-06-03 22:03:58 +0200 | [diff] [blame] | 4 | * |
| 5 | * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com> |
Mika Westerberg | 15c6784 | 2018-10-01 12:31:22 +0300 | [diff] [blame] | 6 | * Copyright (C) 2018, Intel Corporation |
Andreas Noever | 1660315 | 2014-06-03 22:03:58 +0200 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef DSL3510_H_ |
| 10 | #define DSL3510_H_ |
| 11 | |
Mika Westerberg | 3b3d9f4 | 2017-10-02 13:38:37 +0300 | [diff] [blame] | 12 | #include <linux/thunderbolt.h> |
Andreas Noever | 1660315 | 2014-06-03 22:03:58 +0200 | [diff] [blame] | 13 | |
Mika Westerberg | cd446ee2 | 2017-06-06 15:25:12 +0300 | [diff] [blame] | 14 | enum nhi_fw_mode { |
| 15 | NHI_FW_SAFE_MODE, |
| 16 | NHI_FW_AUTH_MODE, |
| 17 | NHI_FW_EP_MODE, |
| 18 | NHI_FW_CM_MODE, |
| 19 | }; |
| 20 | |
| 21 | enum nhi_mailbox_cmd { |
| 22 | NHI_MAILBOX_SAVE_DEVS = 0x05, |
Mika Westerberg | e6b245c | 2017-06-06 15:25:17 +0300 | [diff] [blame] | 23 | NHI_MAILBOX_DISCONNECT_PCIE_PATHS = 0x06, |
Mika Westerberg | cd446ee2 | 2017-06-06 15:25:12 +0300 | [diff] [blame] | 24 | NHI_MAILBOX_DRV_UNLOADS = 0x07, |
Mika Westerberg | d1ff702 | 2017-10-02 13:38:34 +0300 | [diff] [blame] | 25 | NHI_MAILBOX_DISCONNECT_PA = 0x10, |
| 26 | NHI_MAILBOX_DISCONNECT_PB = 0x11, |
Mika Westerberg | cd446ee2 | 2017-06-06 15:25:12 +0300 | [diff] [blame] | 27 | NHI_MAILBOX_ALLOW_ALL_DEVS = 0x23, |
| 28 | }; |
| 29 | |
| 30 | int nhi_mailbox_cmd(struct tb_nhi *nhi, enum nhi_mailbox_cmd cmd, u32 data); |
| 31 | enum nhi_fw_mode nhi_mailbox_mode(struct tb_nhi *nhi); |
| 32 | |
Mika Westerberg | 3cdb944 | 2018-01-16 22:19:00 +0200 | [diff] [blame] | 33 | /** |
| 34 | * struct tb_nhi_ops - NHI specific optional operations |
| 35 | * @init: NHI specific initialization |
| 36 | * @suspend_noirq: NHI specific suspend_noirq hook |
| 37 | * @resume_noirq: NHI specific resume_noirq hook |
| 38 | * @runtime_suspend: NHI specific runtime_suspend hook |
| 39 | * @runtime_resume: NHI specific runtime_resume hook |
| 40 | * @shutdown: NHI specific shutdown |
| 41 | */ |
| 42 | struct tb_nhi_ops { |
| 43 | int (*init)(struct tb_nhi *nhi); |
| 44 | int (*suspend_noirq)(struct tb_nhi *nhi, bool wakeup); |
| 45 | int (*resume_noirq)(struct tb_nhi *nhi); |
| 46 | int (*runtime_suspend)(struct tb_nhi *nhi); |
| 47 | int (*runtime_resume)(struct tb_nhi *nhi); |
| 48 | void (*shutdown)(struct tb_nhi *nhi); |
| 49 | }; |
| 50 | |
| 51 | extern const struct tb_nhi_ops icl_nhi_ops; |
| 52 | |
Mika Westerberg | 5e2781b | 2017-06-06 15:25:11 +0300 | [diff] [blame] | 53 | /* |
| 54 | * PCI IDs used in this driver from Win Ridge forward. There is no |
| 55 | * need for the PCI quirk anymore as we will use ICM also on Apple |
| 56 | * hardware. |
| 57 | */ |
| 58 | #define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_NHI 0x157d |
| 59 | #define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_BRIDGE 0x157e |
| 60 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI 0x15bf |
| 61 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_BRIDGE 0x15c0 |
| 62 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI 0x15d2 |
| 63 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE 0x15d3 |
| 64 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI 0x15d9 |
| 65 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE 0x15da |
| 66 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI 0x15dc |
| 67 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI 0x15dd |
| 68 | #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI 0x15de |
Radion Mirchevsky | 4bac471 | 2017-10-04 16:43:43 +0300 | [diff] [blame] | 69 | #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_BRIDGE 0x15e7 |
| 70 | #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_NHI 0x15e8 |
| 71 | #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_BRIDGE 0x15ea |
| 72 | #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_NHI 0x15eb |
| 73 | #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_BRIDGE 0x15ef |
Mika Westerberg | 3cdb944 | 2018-01-16 22:19:00 +0200 | [diff] [blame] | 74 | #define PCI_DEVICE_ID_INTEL_ICL_NHI1 0x8a0d |
| 75 | #define PCI_DEVICE_ID_INTEL_ICL_NHI0 0x8a17 |
Mika Westerberg | 57d8df6 | 2018-09-14 12:58:37 +0300 | [diff] [blame] | 76 | #define PCI_DEVICE_ID_INTEL_TGL_NHI0 0x9a1b |
| 77 | #define PCI_DEVICE_ID_INTEL_TGL_NHI1 0x9a1d |
Mika Westerberg | f6439c5 | 2020-03-28 11:59:11 +0200 | [diff] [blame] | 78 | #define PCI_DEVICE_ID_INTEL_TGL_H_NHI0 0x9a1f |
| 79 | #define PCI_DEVICE_ID_INTEL_TGL_H_NHI1 0x9a21 |
Mika Westerberg | 5e2781b | 2017-06-06 15:25:11 +0300 | [diff] [blame] | 80 | |
Mika Westerberg | b040798 | 2019-12-17 15:33:40 +0300 | [diff] [blame] | 81 | #define PCI_CLASS_SERIAL_USB_USB4 0x0c0340 |
| 82 | |
Andreas Noever | 1660315 | 2014-06-03 22:03:58 +0200 | [diff] [blame] | 83 | #endif |