162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Thunderbolt driver - NHI driver 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com> 662306a36Sopenharmony_ci * Copyright (C) 2018, Intel Corporation 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef DSL3510_H_ 1062306a36Sopenharmony_ci#define DSL3510_H_ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <linux/thunderbolt.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_cienum nhi_fw_mode { 1562306a36Sopenharmony_ci NHI_FW_SAFE_MODE, 1662306a36Sopenharmony_ci NHI_FW_AUTH_MODE, 1762306a36Sopenharmony_ci NHI_FW_EP_MODE, 1862306a36Sopenharmony_ci NHI_FW_CM_MODE, 1962306a36Sopenharmony_ci}; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_cienum nhi_mailbox_cmd { 2262306a36Sopenharmony_ci NHI_MAILBOX_SAVE_DEVS = 0x05, 2362306a36Sopenharmony_ci NHI_MAILBOX_DISCONNECT_PCIE_PATHS = 0x06, 2462306a36Sopenharmony_ci NHI_MAILBOX_DRV_UNLOADS = 0x07, 2562306a36Sopenharmony_ci NHI_MAILBOX_DISCONNECT_PA = 0x10, 2662306a36Sopenharmony_ci NHI_MAILBOX_DISCONNECT_PB = 0x11, 2762306a36Sopenharmony_ci NHI_MAILBOX_ALLOW_ALL_DEVS = 0x23, 2862306a36Sopenharmony_ci}; 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ciint nhi_mailbox_cmd(struct tb_nhi *nhi, enum nhi_mailbox_cmd cmd, u32 data); 3162306a36Sopenharmony_cienum nhi_fw_mode nhi_mailbox_mode(struct tb_nhi *nhi); 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci/** 3462306a36Sopenharmony_ci * struct tb_nhi_ops - NHI specific optional operations 3562306a36Sopenharmony_ci * @init: NHI specific initialization 3662306a36Sopenharmony_ci * @suspend_noirq: NHI specific suspend_noirq hook 3762306a36Sopenharmony_ci * @resume_noirq: NHI specific resume_noirq hook 3862306a36Sopenharmony_ci * @runtime_suspend: NHI specific runtime_suspend hook 3962306a36Sopenharmony_ci * @runtime_resume: NHI specific runtime_resume hook 4062306a36Sopenharmony_ci * @shutdown: NHI specific shutdown 4162306a36Sopenharmony_ci */ 4262306a36Sopenharmony_cistruct tb_nhi_ops { 4362306a36Sopenharmony_ci int (*init)(struct tb_nhi *nhi); 4462306a36Sopenharmony_ci int (*suspend_noirq)(struct tb_nhi *nhi, bool wakeup); 4562306a36Sopenharmony_ci int (*resume_noirq)(struct tb_nhi *nhi); 4662306a36Sopenharmony_ci int (*runtime_suspend)(struct tb_nhi *nhi); 4762306a36Sopenharmony_ci int (*runtime_resume)(struct tb_nhi *nhi); 4862306a36Sopenharmony_ci void (*shutdown)(struct tb_nhi *nhi); 4962306a36Sopenharmony_ci}; 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ciextern const struct tb_nhi_ops icl_nhi_ops; 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci/* 5462306a36Sopenharmony_ci * PCI IDs used in this driver from Win Ridge forward. There is no 5562306a36Sopenharmony_ci * need for the PCI quirk anymore as we will use ICM also on Apple 5662306a36Sopenharmony_ci * hardware. 5762306a36Sopenharmony_ci */ 5862306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_2C_NHI 0x1134 5962306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_4C_NHI 0x1137 6062306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_NHI 0x157d 6162306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_WIN_RIDGE_2C_BRIDGE 0x157e 6262306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI 0x15bf 6362306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_BRIDGE 0x15c0 6462306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI 0x15d2 6562306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE 0x15d3 6662306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI 0x15d9 6762306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE 0x15da 6862306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI 0x15dc 6962306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI 0x15dd 7062306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI 0x15de 7162306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_BRIDGE 0x15e7 7262306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_NHI 0x15e8 7362306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_BRIDGE 0x15ea 7462306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_NHI 0x15eb 7562306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_BRIDGE 0x15ef 7662306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ADL_NHI0 0x463e 7762306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ADL_NHI1 0x466d 7862306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_80G_NHI 0x5781 7962306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_40G_NHI 0x5784 8062306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HUB_80G_BRIDGE 0x5786 8162306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HUB_40G_BRIDGE 0x57a4 8262306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_MTL_M_NHI0 0x7eb2 8362306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_MTL_P_NHI0 0x7ec2 8462306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_MTL_P_NHI1 0x7ec3 8562306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ICL_NHI1 0x8a0d 8662306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_ICL_NHI0 0x8a17 8762306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TGL_NHI0 0x9a1b 8862306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TGL_NHI1 0x9a1d 8962306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TGL_H_NHI0 0x9a1f 9062306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_TGL_H_NHI1 0x9a21 9162306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_RPL_NHI0 0xa73e 9262306a36Sopenharmony_ci#define PCI_DEVICE_ID_INTEL_RPL_NHI1 0xa76d 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci#define PCI_CLASS_SERIAL_USB_USB4 0x0c0340 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci#endif 97