1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2022 Intel Corporation
6 #ifndef _XE_GUC_TYPES_H_
7 #define _XE_GUC_TYPES_H_
10 #include <linux/xarray.h>
12 #include "regs/xe_reg_defs.h"
13 #include "xe_guc_ads_types.h"
14 #include "xe_guc_ct_types.h"
15 #include "xe_guc_fwif.h"
16 #include "xe_guc_log_types.h"
17 #include "xe_guc_pc_types.h"
18 #include "xe_guc_relay_types.h"
19 #include "xe_uc_fw_types.h"
22 * struct xe_guc_db_mgr - GuC Doorbells Manager.
24 * Note: GuC Doorbells Manager is relying on &xe_guc::submission_state.lock
25 * to protect its members.
27 struct xe_guc_db_mgr {
28 /** @count: number of doorbells to manage */
30 /** @bitmap: bitmap to track allocated doorbells */
31 unsigned long *bitmap;
35 * struct xe_guc - Graphic micro controller
38 /** @fw: Generic uC firmware management */
41 struct xe_guc_log log;
43 struct xe_guc_ads ads;
46 /** @pc: GuC Power Conservation */
48 /** @dbm: GuC Doorbell Manager */
49 struct xe_guc_db_mgr dbm;
50 /** @submission_state: GuC submission state */
52 /** @exec_queue_lookup: Lookup an xe_engine from guc_id */
53 struct xarray exec_queue_lookup;
54 /** @guc_ids: used to allocate new guc_ids, single-lrc */
56 /** @guc_ids_bitmap: used to allocate new guc_ids, multi-lrc */
57 unsigned long *guc_ids_bitmap;
58 /** @stopped: submissions are stopped */
60 /** @lock: protects submission state */
62 /** @suspend: suspend fence state */
64 /** @lock: suspend fences lock */
66 /** @context: suspend fences context */
68 /** @seqno: suspend fences seqno */
71 #ifdef CONFIG_PROVE_LOCKING
72 #define NUM_SUBMIT_WQ 256
73 /** @submit_wq_pool: submission ordered workqueues pool */
74 struct workqueue_struct *submit_wq_pool[NUM_SUBMIT_WQ];
75 /** @submit_wq_idx: submission ordered workqueue index */
78 /** @enabled: submission is enabled */
81 /** @hwconfig: Hardware config state */
83 /** @bo: buffer object of the hardware config */
85 /** @size: size of the hardware config */
89 /** @relay: GuC Relay Communication used in SR-IOV */
90 struct xe_guc_relay relay;
93 * @notify_reg: Register which is written to notify GuC of H2G messages
95 struct xe_reg notify_reg;
96 /** @params: Control params for fw initialization */
97 u32 params[GUC_CTL_MAX_DWORDS];