1 // SPDX-License-Identifier: GPL-2.0+
2 // Copyright 2017 IBM Corp.
4 #include <asm/pnv-ocxl.h>
6 #include <misc/ocxl-config.h>
8 #define EXTRACT_BIT(val, bit) (!!(val & BIT(bit)))
9 #define EXTRACT_BITS(val, s, e) ((val & GENMASK(e, s)) >> s)
11 #define OCXL_DVSEC_AFU_IDX_MASK GENMASK(5, 0)
12 #define OCXL_DVSEC_ACTAG_MASK GENMASK(11, 0)
13 #define OCXL_DVSEC_PASID_MASK GENMASK(19, 0)
14 #define OCXL_DVSEC_PASID_LOG_MASK GENMASK(4, 0)
16 #define OCXL_DVSEC_TEMPL_VERSION 0x0
17 #define OCXL_DVSEC_TEMPL_NAME 0x4
18 #define OCXL_DVSEC_TEMPL_AFU_VERSION 0x1C
19 #define OCXL_DVSEC_TEMPL_MMIO_GLOBAL 0x20
20 #define OCXL_DVSEC_TEMPL_MMIO_GLOBAL_SZ 0x28
21 #define OCXL_DVSEC_TEMPL_MMIO_PP 0x30
22 #define OCXL_DVSEC_TEMPL_MMIO_PP_SZ 0x38
23 #define OCXL_DVSEC_TEMPL_MEM_SZ 0x3C
24 #define OCXL_DVSEC_TEMPL_WWID 0x40
26 #define OCXL_MAX_AFU_PER_FUNCTION 64
27 #define OCXL_TEMPL_LEN 0x58
28 #define OCXL_TEMPL_NAME_LEN 24
29 #define OCXL_CFG_TIMEOUT 3
31 static int find_dvsec(struct pci_dev
*dev
, int dvsec_id
)
36 while ((vsec
= pci_find_next_ext_capability(dev
, vsec
,
37 OCXL_EXT_CAP_ID_DVSEC
))) {
38 pci_read_config_word(dev
, vsec
+ OCXL_DVSEC_VENDOR_OFFSET
,
40 pci_read_config_word(dev
, vsec
+ OCXL_DVSEC_ID_OFFSET
, &id
);
41 if (vendor
== PCI_VENDOR_ID_IBM
&& id
== dvsec_id
)
47 static int find_dvsec_afu_ctrl(struct pci_dev
*dev
, u8 afu_idx
)
53 while ((vsec
= pci_find_next_ext_capability(dev
, vsec
,
54 OCXL_EXT_CAP_ID_DVSEC
))) {
55 pci_read_config_word(dev
, vsec
+ OCXL_DVSEC_VENDOR_OFFSET
,
57 pci_read_config_word(dev
, vsec
+ OCXL_DVSEC_ID_OFFSET
, &id
);
59 if (vendor
== PCI_VENDOR_ID_IBM
&&
60 id
== OCXL_DVSEC_AFU_CTRL_ID
) {
61 pci_read_config_byte(dev
,
62 vsec
+ OCXL_DVSEC_AFU_CTRL_AFU_IDX
,
71 static int read_pasid(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
76 pos
= pci_find_ext_capability(dev
, PCI_EXT_CAP_ID_PASID
);
79 * PASID capability is not mandatory, but there
80 * shouldn't be any AFU
82 dev_dbg(&dev
->dev
, "Function doesn't require any PASID\n");
83 fn
->max_pasid_log
= -1;
86 pci_read_config_word(dev
, pos
+ PCI_PASID_CAP
, &val
);
87 fn
->max_pasid_log
= EXTRACT_BITS(val
, 8, 12);
90 dev_dbg(&dev
->dev
, "PASID capability:\n");
91 dev_dbg(&dev
->dev
, " Max PASID log = %d\n", fn
->max_pasid_log
);
95 static int read_dvsec_tl(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
99 pos
= find_dvsec(dev
, OCXL_DVSEC_TL_ID
);
100 if (!pos
&& PCI_FUNC(dev
->devfn
) == 0) {
101 dev_err(&dev
->dev
, "Can't find TL DVSEC\n");
104 if (pos
&& PCI_FUNC(dev
->devfn
) != 0) {
105 dev_err(&dev
->dev
, "TL DVSEC is only allowed on function 0\n");
108 fn
->dvsec_tl_pos
= pos
;
112 static int read_dvsec_function(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
114 int pos
, afu_present
;
117 pos
= find_dvsec(dev
, OCXL_DVSEC_FUNC_ID
);
119 dev_err(&dev
->dev
, "Can't find function DVSEC\n");
122 fn
->dvsec_function_pos
= pos
;
124 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_FUNC_OFF_INDEX
, &val
);
125 afu_present
= EXTRACT_BIT(val
, 31);
127 fn
->max_afu_index
= -1;
128 dev_dbg(&dev
->dev
, "Function doesn't define any AFU\n");
131 fn
->max_afu_index
= EXTRACT_BITS(val
, 24, 29);
134 dev_dbg(&dev
->dev
, "Function DVSEC:\n");
135 dev_dbg(&dev
->dev
, " Max AFU index = %d\n", fn
->max_afu_index
);
139 static int read_dvsec_afu_info(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
143 if (fn
->max_afu_index
< 0) {
144 fn
->dvsec_afu_info_pos
= -1;
148 pos
= find_dvsec(dev
, OCXL_DVSEC_AFU_INFO_ID
);
150 dev_err(&dev
->dev
, "Can't find AFU information DVSEC\n");
153 fn
->dvsec_afu_info_pos
= pos
;
157 static int read_dvsec_vendor(struct pci_dev
*dev
)
163 * vendor specific DVSEC is optional
165 * It's currently only used on function 0 to specify the
166 * version of some logic blocks. Some older images may not
167 * even have it so we ignore any errors
169 if (PCI_FUNC(dev
->devfn
) != 0)
172 pos
= find_dvsec(dev
, OCXL_DVSEC_VENDOR_ID
);
176 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_VENDOR_CFG_VERS
, &cfg
);
177 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_VENDOR_TLX_VERS
, &tlx
);
178 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_VENDOR_DLX_VERS
, &dlx
);
180 dev_dbg(&dev
->dev
, "Vendor specific DVSEC:\n");
181 dev_dbg(&dev
->dev
, " CFG version = 0x%x\n", cfg
);
182 dev_dbg(&dev
->dev
, " TLX version = 0x%x\n", tlx
);
183 dev_dbg(&dev
->dev
, " DLX version = 0x%x\n", dlx
);
187 static int validate_function(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
189 if (fn
->max_pasid_log
== -1 && fn
->max_afu_index
>= 0) {
191 "AFUs are defined but no PASIDs are requested\n");
195 if (fn
->max_afu_index
> OCXL_MAX_AFU_PER_FUNCTION
) {
197 "Max AFU index out of architectural limit (%d vs %d)\n",
198 fn
->max_afu_index
, OCXL_MAX_AFU_PER_FUNCTION
);
204 int ocxl_config_read_function(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
)
208 rc
= read_pasid(dev
, fn
);
210 dev_err(&dev
->dev
, "Invalid PASID configuration: %d\n", rc
);
214 rc
= read_dvsec_tl(dev
, fn
);
217 "Invalid Transaction Layer DVSEC configuration: %d\n",
222 rc
= read_dvsec_function(dev
, fn
);
225 "Invalid Function DVSEC configuration: %d\n", rc
);
229 rc
= read_dvsec_afu_info(dev
, fn
);
231 dev_err(&dev
->dev
, "Invalid AFU configuration: %d\n", rc
);
235 rc
= read_dvsec_vendor(dev
);
238 "Invalid vendor specific DVSEC configuration: %d\n",
243 rc
= validate_function(dev
, fn
);
246 EXPORT_SYMBOL_GPL(ocxl_config_read_function
);
248 static int read_afu_info(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
,
249 int offset
, u32
*data
)
252 unsigned long timeout
= jiffies
+ (HZ
* OCXL_CFG_TIMEOUT
);
253 int pos
= fn
->dvsec_afu_info_pos
;
255 /* Protect 'data valid' bit */
256 if (EXTRACT_BIT(offset
, 31)) {
257 dev_err(&dev
->dev
, "Invalid offset in AFU info DVSEC\n");
261 pci_write_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_INFO_OFF
, offset
);
262 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_INFO_OFF
, &val
);
263 while (!EXTRACT_BIT(val
, 31)) {
264 if (time_after_eq(jiffies
, timeout
)) {
266 "Timeout while reading AFU info DVSEC (offset=%d)\n",
271 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_INFO_OFF
, &val
);
273 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_INFO_DATA
, data
);
277 int ocxl_config_check_afu_index(struct pci_dev
*dev
,
278 struct ocxl_fn_config
*fn
, int afu_idx
)
281 int rc
, templ_major
, templ_minor
, len
;
283 pci_write_config_word(dev
, fn
->dvsec_afu_info_pos
, afu_idx
);
284 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_VERSION
, &val
);
288 /* AFU index map can have holes */
292 templ_major
= EXTRACT_BITS(val
, 8, 15);
293 templ_minor
= EXTRACT_BITS(val
, 0, 7);
294 dev_dbg(&dev
->dev
, "AFU descriptor template version %d.%d\n",
295 templ_major
, templ_minor
);
297 len
= EXTRACT_BITS(val
, 16, 31);
298 if (len
!= OCXL_TEMPL_LEN
) {
300 "Unexpected template length in AFU information (%#x)\n",
305 EXPORT_SYMBOL_GPL(ocxl_config_check_afu_index
);
307 static int read_afu_name(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
,
308 struct ocxl_afu_config
*afu
)
313 BUILD_BUG_ON(OCXL_AFU_NAME_SZ
< OCXL_TEMPL_NAME_LEN
);
314 for (i
= 0; i
< OCXL_TEMPL_NAME_LEN
; i
+= 4) {
315 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_NAME
+ i
, &val
);
318 ptr
= (u32
*) &afu
->name
[i
];
321 afu
->name
[OCXL_AFU_NAME_SZ
- 1] = '\0'; /* play safe */
325 static int read_afu_mmio(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
,
326 struct ocxl_afu_config
*afu
)
334 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_GLOBAL
, &val
);
337 afu
->global_mmio_bar
= EXTRACT_BITS(val
, 0, 2);
338 afu
->global_mmio_offset
= EXTRACT_BITS(val
, 16, 31) << 16;
340 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_GLOBAL
+ 4, &val
);
343 afu
->global_mmio_offset
+= (u64
) val
<< 32;
345 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_GLOBAL_SZ
, &val
);
348 afu
->global_mmio_size
= val
;
353 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_PP
, &val
);
356 afu
->pp_mmio_bar
= EXTRACT_BITS(val
, 0, 2);
357 afu
->pp_mmio_offset
= EXTRACT_BITS(val
, 16, 31) << 16;
359 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_PP
+ 4, &val
);
362 afu
->pp_mmio_offset
+= (u64
) val
<< 32;
364 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MMIO_PP_SZ
, &val
);
367 afu
->pp_mmio_stride
= val
;
372 static int read_afu_control(struct pci_dev
*dev
, struct ocxl_afu_config
*afu
)
378 pos
= find_dvsec_afu_ctrl(dev
, afu
->idx
);
380 dev_err(&dev
->dev
, "Can't find AFU control DVSEC for AFU %d\n",
384 afu
->dvsec_afu_control_pos
= pos
;
386 pci_read_config_byte(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_PASID_SUP
, &val8
);
387 afu
->pasid_supported_log
= EXTRACT_BITS(val8
, 0, 4);
389 pci_read_config_word(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_ACTAG_SUP
, &val16
);
390 afu
->actag_supported
= EXTRACT_BITS(val16
, 0, 11);
394 static bool char_allowed(int c
)
397 * Permitted Characters : Alphanumeric, hyphen, underscore, comma
399 if ((c
>= 0x30 && c
<= 0x39) /* digits */ ||
400 (c
>= 0x41 && c
<= 0x5A) /* upper case */ ||
401 (c
>= 0x61 && c
<= 0x7A) /* lower case */ ||
410 static int validate_afu(struct pci_dev
*dev
, struct ocxl_afu_config
*afu
)
415 dev_err(&dev
->dev
, "Empty AFU name\n");
418 for (i
= 0; i
< OCXL_TEMPL_NAME_LEN
; i
++) {
419 if (!char_allowed(afu
->name
[i
])) {
421 "Invalid character in AFU name\n");
426 if (afu
->global_mmio_bar
!= 0 &&
427 afu
->global_mmio_bar
!= 2 &&
428 afu
->global_mmio_bar
!= 4) {
429 dev_err(&dev
->dev
, "Invalid global MMIO bar number\n");
432 if (afu
->pp_mmio_bar
!= 0 &&
433 afu
->pp_mmio_bar
!= 2 &&
434 afu
->pp_mmio_bar
!= 4) {
435 dev_err(&dev
->dev
, "Invalid per-process MMIO bar number\n");
441 int ocxl_config_read_afu(struct pci_dev
*dev
, struct ocxl_fn_config
*fn
,
442 struct ocxl_afu_config
*afu
, u8 afu_idx
)
448 * First, we need to write the AFU idx for the AFU we want to
451 WARN_ON((afu_idx
& OCXL_DVSEC_AFU_IDX_MASK
) != afu_idx
);
453 pci_write_config_byte(dev
,
454 fn
->dvsec_afu_info_pos
+ OCXL_DVSEC_AFU_INFO_AFU_IDX
,
457 rc
= read_afu_name(dev
, fn
, afu
);
461 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_AFU_VERSION
, &val32
);
464 afu
->version_major
= EXTRACT_BITS(val32
, 24, 31);
465 afu
->version_minor
= EXTRACT_BITS(val32
, 16, 23);
466 afu
->afuc_type
= EXTRACT_BITS(val32
, 14, 15);
467 afu
->afum_type
= EXTRACT_BITS(val32
, 12, 13);
468 afu
->profile
= EXTRACT_BITS(val32
, 0, 7);
470 rc
= read_afu_mmio(dev
, fn
, afu
);
474 rc
= read_afu_info(dev
, fn
, OCXL_DVSEC_TEMPL_MEM_SZ
, &val32
);
477 afu
->log_mem_size
= EXTRACT_BITS(val32
, 0, 7);
479 rc
= read_afu_control(dev
, afu
);
483 dev_dbg(&dev
->dev
, "AFU configuration:\n");
484 dev_dbg(&dev
->dev
, " name = %s\n", afu
->name
);
485 dev_dbg(&dev
->dev
, " version = %d.%d\n", afu
->version_major
,
487 dev_dbg(&dev
->dev
, " global mmio bar = %hhu\n", afu
->global_mmio_bar
);
488 dev_dbg(&dev
->dev
, " global mmio offset = %#llx\n",
489 afu
->global_mmio_offset
);
490 dev_dbg(&dev
->dev
, " global mmio size = %#x\n", afu
->global_mmio_size
);
491 dev_dbg(&dev
->dev
, " pp mmio bar = %hhu\n", afu
->pp_mmio_bar
);
492 dev_dbg(&dev
->dev
, " pp mmio offset = %#llx\n", afu
->pp_mmio_offset
);
493 dev_dbg(&dev
->dev
, " pp mmio stride = %#x\n", afu
->pp_mmio_stride
);
494 dev_dbg(&dev
->dev
, " mem size (log) = %hhu\n", afu
->log_mem_size
);
495 dev_dbg(&dev
->dev
, " pasid supported (log) = %u\n",
496 afu
->pasid_supported_log
);
497 dev_dbg(&dev
->dev
, " actag supported = %u\n",
498 afu
->actag_supported
);
500 rc
= validate_afu(dev
, afu
);
503 EXPORT_SYMBOL_GPL(ocxl_config_read_afu
);
505 int ocxl_config_get_actag_info(struct pci_dev
*dev
, u16
*base
, u16
*enabled
,
511 * This is really a simple wrapper for the kernel API, to
512 * avoid an external driver using ocxl as a library to call
513 * platform-dependent code
515 rc
= pnv_ocxl_get_actag(dev
, base
, enabled
, supported
);
517 dev_err(&dev
->dev
, "Can't get actag for device: %d\n", rc
);
522 EXPORT_SYMBOL_GPL(ocxl_config_get_actag_info
);
524 void ocxl_config_set_afu_actag(struct pci_dev
*dev
, int pos
, int actag_base
,
529 val
= actag_count
& OCXL_DVSEC_ACTAG_MASK
;
530 pci_write_config_byte(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_ACTAG_EN
, val
);
532 val
= actag_base
& OCXL_DVSEC_ACTAG_MASK
;
533 pci_write_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_ACTAG_BASE
, val
);
535 EXPORT_SYMBOL_GPL(ocxl_config_set_afu_actag
);
537 int ocxl_config_get_pasid_info(struct pci_dev
*dev
, int *count
)
539 return pnv_ocxl_get_pasid_count(dev
, count
);
541 EXPORT_SYMBOL_GPL(ocxl_config_get_pasid_info
);
543 void ocxl_config_set_afu_pasid(struct pci_dev
*dev
, int pos
, int pasid_base
,
549 val8
= pasid_count_log
& OCXL_DVSEC_PASID_LOG_MASK
;
550 pci_write_config_byte(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_PASID_EN
, val8
);
552 pci_read_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_PASID_BASE
,
554 val32
&= ~OCXL_DVSEC_PASID_MASK
;
555 val32
|= pasid_base
& OCXL_DVSEC_PASID_MASK
;
556 pci_write_config_dword(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_PASID_BASE
,
559 EXPORT_SYMBOL_GPL(ocxl_config_set_afu_pasid
);
561 void ocxl_config_set_afu_state(struct pci_dev
*dev
, int pos
, int enable
)
565 pci_read_config_byte(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_ENABLE
, &val
);
570 pci_write_config_byte(dev
, pos
+ OCXL_DVSEC_AFU_CTRL_ENABLE
, val
);
572 EXPORT_SYMBOL_GPL(ocxl_config_set_afu_state
);
574 int ocxl_config_set_TL(struct pci_dev
*dev
, int tl_dvsec
)
584 * Skip on function != 0, as the TL can only be defined on 0
586 if (PCI_FUNC(dev
->devfn
) != 0)
589 recv_rate
= kzalloc(PNV_OCXL_TL_RATE_BUF_SIZE
, GFP_KERNEL
);
593 * The spec defines 64 templates for messages in the
594 * Transaction Layer (TL).
596 * The host and device each support a subset, so we need to
597 * configure the transmitters on each side to send only
598 * templates the receiver understands, at a rate the receiver
599 * can process. Per the spec, template 0 must be supported by
600 * everybody. That's the template which has been used by the
601 * host and device so far.
603 * The sending rate limit must be set before the template is
610 rc
= pnv_ocxl_get_tl_cap(dev
, &recv_cap
, recv_rate
,
611 PNV_OCXL_TL_RATE_BUF_SIZE
);
615 for (i
= 0; i
< PNV_OCXL_TL_RATE_BUF_SIZE
; i
+= 4) {
616 be32ptr
= (__be32
*) &recv_rate
[i
];
617 pci_write_config_dword(dev
,
618 tl_dvsec
+ OCXL_DVSEC_TL_SEND_RATE
+ i
,
619 be32_to_cpu(*be32ptr
));
621 val
= recv_cap
>> 32;
622 pci_write_config_dword(dev
, tl_dvsec
+ OCXL_DVSEC_TL_SEND_CAP
, val
);
623 val
= recv_cap
& GENMASK(31, 0);
624 pci_write_config_dword(dev
, tl_dvsec
+ OCXL_DVSEC_TL_SEND_CAP
+ 4, val
);
629 for (i
= 0; i
< PNV_OCXL_TL_RATE_BUF_SIZE
; i
+= 4) {
630 pci_read_config_dword(dev
,
631 tl_dvsec
+ OCXL_DVSEC_TL_RECV_RATE
+ i
,
633 be32ptr
= (__be32
*) &recv_rate
[i
];
634 *be32ptr
= cpu_to_be32(val
);
636 pci_read_config_dword(dev
, tl_dvsec
+ OCXL_DVSEC_TL_RECV_CAP
, &val
);
637 recv_cap
= (long) val
<< 32;
638 pci_read_config_dword(dev
, tl_dvsec
+ OCXL_DVSEC_TL_RECV_CAP
+ 4, &val
);
641 rc
= pnv_ocxl_set_tl_conf(dev
, recv_cap
, __pa(recv_rate
),
642 PNV_OCXL_TL_RATE_BUF_SIZE
);
647 * Opencapi commands needing to be retried are classified per
648 * the TL in 2 groups: short and long commands.
650 * The short back off timer it not used for now. It will be
653 * The long back off timer is typically used when an AFU hits
654 * a page fault but the NPU is already processing one. So the
655 * AFU needs to wait before it can resubmit. Having a value
656 * too low doesn't break anything, but can generate extra
657 * traffic on the link.
658 * We set it to 1.6 us for now. It's shorter than, but in the
659 * same order of magnitude as the time spent to process a page
662 timers
= 0x2 << 4; /* long timer = 1.6 us */
663 pci_write_config_byte(dev
, tl_dvsec
+ OCXL_DVSEC_TL_BACKOFF_TIMERS
,
671 EXPORT_SYMBOL_GPL(ocxl_config_set_TL
);
673 int ocxl_config_terminate_pasid(struct pci_dev
*dev
, int afu_control
, int pasid
)
676 unsigned long timeout
;
678 pci_read_config_dword(dev
, afu_control
+ OCXL_DVSEC_AFU_CTRL_TERM_PASID
,
680 if (EXTRACT_BIT(val
, 20)) {
682 "Can't terminate PASID %#x, previous termination didn't complete\n",
687 val
&= ~OCXL_DVSEC_PASID_MASK
;
688 val
|= pasid
& OCXL_DVSEC_PASID_MASK
;
690 pci_write_config_dword(dev
,
691 afu_control
+ OCXL_DVSEC_AFU_CTRL_TERM_PASID
,
694 timeout
= jiffies
+ (HZ
* OCXL_CFG_TIMEOUT
);
695 pci_read_config_dword(dev
, afu_control
+ OCXL_DVSEC_AFU_CTRL_TERM_PASID
,
697 while (EXTRACT_BIT(val
, 20)) {
698 if (time_after_eq(jiffies
, timeout
)) {
700 "Timeout while waiting for AFU to terminate PASID %#x\n",
705 pci_read_config_dword(dev
,
706 afu_control
+ OCXL_DVSEC_AFU_CTRL_TERM_PASID
,
711 EXPORT_SYMBOL_GPL(ocxl_config_terminate_pasid
);
713 void ocxl_config_set_actag(struct pci_dev
*dev
, int func_dvsec
, u32 tag_first
,
718 val
= (tag_first
& OCXL_DVSEC_ACTAG_MASK
) << 16;
719 val
|= tag_count
& OCXL_DVSEC_ACTAG_MASK
;
720 pci_write_config_dword(dev
, func_dvsec
+ OCXL_DVSEC_FUNC_OFF_ACTAG
,
723 EXPORT_SYMBOL_GPL(ocxl_config_set_actag
);