1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/auxiliary_bus.h>
6 #include <linux/bits.h>
8 #define VSEC_CAP_TELEMETRY BIT(0)
9 #define VSEC_CAP_WATCHER BIT(1)
10 #define VSEC_CAP_CRASHLOG BIT(2)
11 #define VSEC_CAP_SDSI BIT(3)
12 #define VSEC_CAP_TPMI BIT(4)
17 enum intel_vsec_quirks {
18 /* Watcher feature not supported */
19 VSEC_QUIRK_NO_WATCHER = BIT(0),
21 /* Crashlog feature not supported */
22 VSEC_QUIRK_NO_CRASHLOG = BIT(1),
24 /* Use shift instead of mask to read discovery table offset */
25 VSEC_QUIRK_TABLE_SHIFT = BIT(2),
27 /* DVSEC not present (provided in driver data) */
28 VSEC_QUIRK_NO_DVSEC = BIT(3),
30 /* Platforms requiring quirk in the auxiliary driver */
31 VSEC_QUIRK_EARLY_HW = BIT(4),
34 /* Platform specific data */
35 struct intel_vsec_platform_info {
36 struct intel_vsec_header **headers;
41 struct intel_vsec_device {
42 struct auxiliary_device auxdev;
43 struct pci_dev *pcidev;
44 struct resource *resource;
46 struct intel_vsec_platform_info *info;
49 size_t priv_data_size;
52 int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
53 struct intel_vsec_device *intel_vsec_dev,
56 static inline struct intel_vsec_device *dev_to_ivdev(struct device *dev)
58 return container_of(dev, struct intel_vsec_device, auxdev.dev);
61 static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device *auxdev)
63 return container_of(auxdev, struct intel_vsec_device, auxdev);