1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023-2024 Intel Corporation
4  */
5 
6 #ifndef _XE_GT_SRIOV_VF_TYPES_H_
7 #define _XE_GT_SRIOV_VF_TYPES_H_
8 
9 #include <linux/types.h>
10 
11 /**
12  * struct xe_gt_sriov_vf_guc_version - GuC ABI version details.
13  */
14 struct xe_gt_sriov_vf_guc_version {
15 	/** @branch: branch version. */
16 	u8 branch;
17 	/** @major: major version. */
18 	u8 major;
19 	/** @minor: minor version. */
20 	u8 minor;
21 	/** @patch: patch version. */
22 	u8 patch;
23 };
24 
25 /**
26  * struct xe_gt_sriov_vf_relay_version - PF ABI version details.
27  */
28 struct xe_gt_sriov_vf_relay_version {
29 	/** @major: major version. */
30 	u16 major;
31 	/** @minor: minor version. */
32 	u16 minor;
33 };
34 
35 /**
36  * struct xe_gt_sriov_vf_selfconfig - VF configuration data.
37  */
38 struct xe_gt_sriov_vf_selfconfig {
39 	/** @ggtt_base: assigned base offset of the GGTT region. */
40 	u64 ggtt_base;
41 	/** @ggtt_size: assigned size of the GGTT region. */
42 	u64 ggtt_size;
43 	/** @lmem_size: assigned size of the LMEM. */
44 	u64 lmem_size;
45 	/** @num_ctxs: assigned number of GuC submission context IDs. */
46 	u16 num_ctxs;
47 	/** @num_dbs: assigned number of GuC doorbells IDs. */
48 	u16 num_dbs;
49 };
50 
51 /**
52  * struct xe_gt_sriov_vf_runtime - VF runtime data.
53  */
54 struct xe_gt_sriov_vf_runtime {
55 	/** @gmdid: cached value of the GDMID register. */
56 	u32 gmdid;
57 	/** @regs_size: size of runtime register array. */
58 	u32 regs_size;
59 	/** @num_regs: number of runtime registers in the array. */
60 	u32 num_regs;
61 	/** @regs: pointer to array of register offset/value pairs. */
62 	struct vf_runtime_reg {
63 		/** @regs.offset: register offset. */
64 		u32 offset;
65 		/** @regs.value: register value. */
66 		u32 value;
67 	} *regs;
68 };
69 
70 /**
71  * struct xe_gt_sriov_vf - GT level VF virtualization data.
72  */
73 struct xe_gt_sriov_vf {
74 	/** @guc_version: negotiated GuC ABI version. */
75 	struct xe_gt_sriov_vf_guc_version guc_version;
76 	/** @self_config: resource configurations. */
77 	struct xe_gt_sriov_vf_selfconfig self_config;
78 	/** @pf_version: negotiated VF/PF ABI version. */
79 	struct xe_gt_sriov_vf_relay_version pf_version;
80 	/** @runtime: runtime data retrieved from the PF. */
81 	struct xe_gt_sriov_vf_runtime runtime;
82 };
83 
84 #endif
85