Skip to content

Commit dbc01b0

Browse files
debox1jwrdegoede
authored andcommitted
platform/x86/intel/vsec: Move structures to header
In preparation for exporting an API to register Intel Vendor Specific Extended Capabilities (VSEC) from other drivers, move needed structures to the header file. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231129222132.2331261-4-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent ace7b6f commit dbc01b0

File tree

2 files changed

+36
-35
lines changed

2 files changed

+36
-35
lines changed

drivers/platform/x86/intel/vsec.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424

2525
#include "vsec.h"
2626

27-
/* Intel DVSEC offsets */
28-
#define INTEL_DVSEC_ENTRIES 0xA
29-
#define INTEL_DVSEC_SIZE 0xB
30-
#define INTEL_DVSEC_TABLE 0xC
31-
#define INTEL_DVSEC_TABLE_BAR(x) ((x) & GENMASK(2, 0))
32-
#define INTEL_DVSEC_TABLE_OFFSET(x) ((x) & GENMASK(31, 3))
33-
#define TABLE_OFFSET_SHIFT 3
3427
#define PMT_XA_START 0
3528
#define PMT_XA_MAX INT_MAX
3629
#define PMT_XA_LIMIT XA_LIMIT(PMT_XA_START, PMT_XA_MAX)
@@ -39,34 +32,6 @@ static DEFINE_IDA(intel_vsec_ida);
3932
static DEFINE_IDA(intel_vsec_sdsi_ida);
4033
static DEFINE_XARRAY_ALLOC(auxdev_array);
4134

42-
/**
43-
* struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers.
44-
* @rev: Revision ID of the VSEC/DVSEC register space
45-
* @length: Length of the VSEC/DVSEC register space
46-
* @id: ID of the feature
47-
* @num_entries: Number of instances of the feature
48-
* @entry_size: Size of the discovery table for each feature
49-
* @tbir: BAR containing the discovery tables
50-
* @offset: BAR offset of start of the first discovery table
51-
*/
52-
struct intel_vsec_header {
53-
u8 rev;
54-
u16 length;
55-
u16 id;
56-
u8 num_entries;
57-
u8 entry_size;
58-
u8 tbir;
59-
u32 offset;
60-
};
61-
62-
enum intel_vsec_id {
63-
VSEC_ID_TELEMETRY = 2,
64-
VSEC_ID_WATCHER = 3,
65-
VSEC_ID_CRASHLOG = 4,
66-
VSEC_ID_SDSI = 65,
67-
VSEC_ID_TPMI = 66,
68-
};
69-
7035
static const char *intel_vsec_name(enum intel_vsec_id id)
7136
{
7237
switch (id) {

drivers/platform/x86/intel/vsec.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,45 @@
1111
#define VSEC_CAP_SDSI BIT(3)
1212
#define VSEC_CAP_TPMI BIT(4)
1313

14+
/* Intel DVSEC offsets */
15+
#define INTEL_DVSEC_ENTRIES 0xA
16+
#define INTEL_DVSEC_SIZE 0xB
17+
#define INTEL_DVSEC_TABLE 0xC
18+
#define INTEL_DVSEC_TABLE_BAR(x) ((x) & GENMASK(2, 0))
19+
#define INTEL_DVSEC_TABLE_OFFSET(x) ((x) & GENMASK(31, 3))
20+
#define TABLE_OFFSET_SHIFT 3
21+
1422
struct pci_dev;
1523
struct resource;
1624

25+
enum intel_vsec_id {
26+
VSEC_ID_TELEMETRY = 2,
27+
VSEC_ID_WATCHER = 3,
28+
VSEC_ID_CRASHLOG = 4,
29+
VSEC_ID_SDSI = 65,
30+
VSEC_ID_TPMI = 66,
31+
};
32+
33+
/**
34+
* struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers.
35+
* @rev: Revision ID of the VSEC/DVSEC register space
36+
* @length: Length of the VSEC/DVSEC register space
37+
* @id: ID of the feature
38+
* @num_entries: Number of instances of the feature
39+
* @entry_size: Size of the discovery table for each feature
40+
* @tbir: BAR containing the discovery tables
41+
* @offset: BAR offset of start of the first discovery table
42+
*/
43+
struct intel_vsec_header {
44+
u8 rev;
45+
u16 length;
46+
u16 id;
47+
u8 num_entries;
48+
u8 entry_size;
49+
u8 tbir;
50+
u32 offset;
51+
};
52+
1753
enum intel_vsec_quirks {
1854
/* Watcher feature not supported */
1955
VSEC_QUIRK_NO_WATCHER = BIT(0),

0 commit comments

Comments
 (0)