2 * Copyright © 2014 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23 #ifndef _INTEL_GUC_FWIF_H
24 #define _INTEL_GUC_FWIF_H
26 #define GUC_CLIENT_PRIORITY_KMD_HIGH 0
27 #define GUC_CLIENT_PRIORITY_HIGH 1
28 #define GUC_CLIENT_PRIORITY_KMD_NORMAL 2
29 #define GUC_CLIENT_PRIORITY_NORMAL 3
30 #define GUC_CLIENT_PRIORITY_NUM 4
32 #define GUC_MAX_STAGE_DESCRIPTORS 1024
33 #define GUC_INVALID_STAGE_ID GUC_MAX_STAGE_DESCRIPTORS
35 #define GUC_RENDER_ENGINE 0
36 #define GUC_VIDEO_ENGINE 1
37 #define GUC_BLITTER_ENGINE 2
38 #define GUC_VIDEOENHANCE_ENGINE 3
39 #define GUC_VIDEO_ENGINE2 4
40 #define GUC_MAX_ENGINES_NUM (GUC_VIDEO_ENGINE2 + 1)
42 #define GUC_DOORBELL_INVALID 256
44 #define GUC_DB_SIZE (PAGE_SIZE)
45 #define GUC_WQ_SIZE (PAGE_SIZE * 2)
47 /* Work queue item header definitions */
48 #define WQ_STATUS_ACTIVE 1
49 #define WQ_STATUS_SUSPENDED 2
50 #define WQ_STATUS_CMD_ERROR 3
51 #define WQ_STATUS_ENGINE_ID_NOT_USED 4
52 #define WQ_STATUS_SUSPENDED_FROM_RESET 5
53 #define WQ_TYPE_SHIFT 0
54 #define WQ_TYPE_BATCH_BUF (0x1 << WQ_TYPE_SHIFT)
55 #define WQ_TYPE_PSEUDO (0x2 << WQ_TYPE_SHIFT)
56 #define WQ_TYPE_INORDER (0x3 << WQ_TYPE_SHIFT)
57 #define WQ_TYPE_NOOP (0x4 << WQ_TYPE_SHIFT)
58 #define WQ_TARGET_SHIFT 10
59 #define WQ_LEN_SHIFT 16
60 #define WQ_NO_WCFLUSH_WAIT (1 << 27)
61 #define WQ_PRESENT_WORKLOAD (1 << 28)
63 #define WQ_RING_TAIL_SHIFT 20
64 #define WQ_RING_TAIL_MAX 0x7FF /* 2^11 QWords */
65 #define WQ_RING_TAIL_MASK (WQ_RING_TAIL_MAX << WQ_RING_TAIL_SHIFT)
67 #define GUC_STAGE_DESC_ATTR_ACTIVE BIT(0)
68 #define GUC_STAGE_DESC_ATTR_PENDING_DB BIT(1)
69 #define GUC_STAGE_DESC_ATTR_KERNEL BIT(2)
70 #define GUC_STAGE_DESC_ATTR_PREEMPT BIT(3)
71 #define GUC_STAGE_DESC_ATTR_RESET BIT(4)
72 #define GUC_STAGE_DESC_ATTR_WQLOCKED BIT(5)
73 #define GUC_STAGE_DESC_ATTR_PCH BIT(6)
74 #define GUC_STAGE_DESC_ATTR_TERMINATED BIT(7)
76 /* The guc control data is 10 DWORDs */
77 #define GUC_CTL_CTXINFO 0
78 #define GUC_CTL_CTXNUM_IN16_SHIFT 0
79 #define GUC_CTL_BASE_ADDR_SHIFT 12
81 #define GUC_CTL_ARAT_HIGH 1
82 #define GUC_CTL_ARAT_LOW 2
84 #define GUC_CTL_DEVICE_INFO 3
86 #define GUC_CTL_LOG_PARAMS 4
87 #define GUC_LOG_VALID (1 << 0)
88 #define GUC_LOG_NOTIFY_ON_HALF_FULL (1 << 1)
89 #define GUC_LOG_ALLOC_IN_MEGABYTE (1 << 3)
90 #define GUC_LOG_CRASH_SHIFT 4
91 #define GUC_LOG_CRASH_MASK (0x1 << GUC_LOG_CRASH_SHIFT)
92 #define GUC_LOG_DPC_SHIFT 6
93 #define GUC_LOG_DPC_MASK (0x7 << GUC_LOG_DPC_SHIFT)
94 #define GUC_LOG_ISR_SHIFT 9
95 #define GUC_LOG_ISR_MASK (0x7 << GUC_LOG_ISR_SHIFT)
96 #define GUC_LOG_BUF_ADDR_SHIFT 12
98 #define GUC_CTL_PAGE_FAULT_CONTROL 5
101 #define GUC_CTL_WA_UK_BY_DRIVER (1 << 3)
103 #define GUC_CTL_FEATURE 7
104 #define GUC_CTL_VCS2_ENABLED (1 << 0)
105 #define GUC_CTL_KERNEL_SUBMISSIONS (1 << 1)
106 #define GUC_CTL_FEATURE2 (1 << 2)
107 #define GUC_CTL_POWER_GATING (1 << 3)
108 #define GUC_CTL_DISABLE_SCHEDULER (1 << 4)
109 #define GUC_CTL_PREEMPTION_LOG (1 << 5)
110 #define GUC_CTL_ENABLE_SLPC (1 << 7)
111 #define GUC_CTL_RESET_ON_PREMPT_FAILURE (1 << 8)
113 #define GUC_CTL_DEBUG 8
114 #define GUC_LOG_VERBOSITY_SHIFT 0
115 #define GUC_LOG_VERBOSITY_LOW (0 << GUC_LOG_VERBOSITY_SHIFT)
116 #define GUC_LOG_VERBOSITY_MED (1 << GUC_LOG_VERBOSITY_SHIFT)
117 #define GUC_LOG_VERBOSITY_HIGH (2 << GUC_LOG_VERBOSITY_SHIFT)
118 #define GUC_LOG_VERBOSITY_ULTRA (3 << GUC_LOG_VERBOSITY_SHIFT)
119 /* Verbosity range-check limits, without the shift */
120 #define GUC_LOG_VERBOSITY_MIN 0
121 #define GUC_LOG_VERBOSITY_MAX 3
122 #define GUC_LOG_VERBOSITY_MASK 0x0000000f
123 #define GUC_LOG_DESTINATION_MASK (3 << 4)
124 #define GUC_LOG_DISABLED (1 << 6)
125 #define GUC_PROFILE_ENABLED (1 << 7)
126 #define GUC_WQ_TRACK_ENABLED (1 << 8)
127 #define GUC_ADS_ENABLED (1 << 9)
128 #define GUC_LOG_DEFAULT_DISABLED (1 << 10)
129 #define GUC_ADS_ADDR_SHIFT 11
130 #define GUC_ADS_ADDR_MASK 0xfffff800
132 #define GUC_CTL_RSRVD 9
134 #define GUC_CTL_MAX_DWORDS (SOFT_SCRATCH_COUNT - 2) /* [1..14] */
137 * DOC: GuC Firmware Layout
139 * The GuC firmware layout looks like this:
141 * +-------------------------------+
144 * | contains major/minor version |
145 * +-------------------------------+
147 * +-------------------------------+
149 * +-------------------------------+
151 * +-------------------------------+
153 * +-------------------------------+
155 * The firmware may or may not have modulus key and exponent data. The header,
156 * uCode and RSA signature are must-have components that will be used by driver.
157 * Length of each components, which is all in dwords, can be found in header.
158 * In the case that modulus and exponent are not present in fw, a.k.a truncated
159 * image, the length value still appears in header.
161 * Driver will do some basic fw size validation based on the following rules:
163 * 1. Header, uCode and RSA are must-have components.
164 * 2. All firmware components, if they present, are in the sequence illustrated
165 * in the layout table above.
166 * 3. Length info of each component can be found in header, in dwords.
167 * 4. Modulus and exponent key are not required by driver. They may not appear
168 * in fw. So driver will load a truncated firmware in this case.
170 * HuC firmware layout is same as GuC firmware.
172 * HuC firmware css header is different. However, the only difference is where
173 * the version information is saved. The uc_css_header is unified to support
174 * both. Driver should get HuC version from uc_css_header.huc_sw_version, while
175 * uc_css_header.guc_sw_version for GuC.
178 struct uc_css_header {
180 /* header_size includes all non-uCode bits, including css_header, rsa
181 * key, modulus key and exponent data. */
194 u32 size_dw; /* uCode plus header_size_dw */
197 u32 exponent_size_dw;
208 char buildnumber[12];
211 u32 branch_client_version;
224 /* Work item for submitting workloads into work queue of GuC. */
228 u32 submit_element_info;
232 struct guc_process_desc {
246 /* engine id and context id is packed into guc_execlist_context.context_id*/
247 #define GUC_ELC_CTXID_OFFSET 0
248 #define GUC_ELC_ENGINE_OFFSET 29
250 /* The execlist context including software and HW information */
251 struct guc_execlist_context {
258 u32 ring_next_free_location;
259 u32 ring_current_tail_pointer_value;
260 u8 engine_state_submit_value;
261 u8 engine_state_wait_value;
263 u16 engine_submit_queue_count;
267 * This structure describes a stage set arranged for a particular communication
268 * between uKernel (GuC) and Driver (KMD). Technically, this is known as a
269 * "GuC Context descriptor" in the specs, but we use the term "stage descriptor"
270 * to avoid confusion with all the other things already named "context" in the
271 * driver. A static pool of these descriptors are stored inside a GEM object
272 * (stage_desc_pool) which is held for the entire lifetime of our interaction
273 * with the GuC, being allocated before the GuC is loaded with its firmware.
275 struct guc_stage_desc {
276 u32 sched_common_area;
285 struct guc_execlist_context lrc[GUC_MAX_ENGINES_NUM];
291 u32 wq_sampled_tail_offset;
292 u32 wq_total_submit_enqueues;
309 * DOC: CTB based communication
311 * The CTB (command transport buffer) communication between Host and GuC
312 * is based on u32 data stream written to the shared buffer. One buffer can
313 * be used to transmit data only in one direction (one-directional channel).
315 * Current status of the each buffer is stored in the buffer descriptor.
316 * Buffer descriptor holds tail and head fields that represents active data
317 * stream. The tail field is updated by the data producer (sender), and head
318 * field is updated by the data consumer (receiver)::
321 * | DESCRIPTOR | +=================+============+========+
322 * +============+ | | MESSAGE(s) | |
323 * | address |--------->+=================+============+========+
325 * | head | ^-----head--------^
327 * | tail | ^---------tail-----------------^
329 * | size | ^---------------size--------------------^
332 * Each message in data stream starts with the single u32 treated as a header,
333 * followed by optional set of u32 data that makes message specific payload::
335 * +------------+---------+---------+---------+
337 * +------------+---------+---------+---------+
338 * | msg[0] | [1] | ... | [n-1] |
339 * +------------+---------+---------+---------+
340 * | MESSAGE | MESSAGE PAYLOAD |
341 * + HEADER +---------+---------+---------+
343 * +======+=====+=========+=========+=========+
344 * | 31:16| code| | | |
345 * +------+-----+ | | |
346 * | 15:5|flags| | | |
347 * +------+-----+ | | |
349 * +------+-----+---------+---------+---------+
351 * ^-------------len-------------^
353 * The message header consists of:
355 * - **len**, indicates length of the message payload (in u32)
356 * - **code**, indicates message code
357 * - **flags**, holds various bits to control message handling
361 * Describes single command transport buffer.
362 * Used by both guc-master and clients.
364 struct guc_ct_buffer_desc {
365 u32 addr; /* gfx address */
366 u64 host_private; /* host private data */
367 u32 size; /* size in bytes */
368 u32 head; /* offset updated by GuC*/
369 u32 tail; /* offset updated by owner */
370 u32 is_in_error; /* error indicator */
371 u32 fence; /* fence updated by GuC */
372 u32 status; /* status updated by GuC */
373 u32 owner; /* id of the channel owner */
374 u32 owner_sub_id; /* owner-defined field for extra tracking */
378 /* Type of command transport buffer */
379 #define INTEL_GUC_CT_BUFFER_TYPE_SEND 0x0u
380 #define INTEL_GUC_CT_BUFFER_TYPE_RECV 0x1u
383 * Definition of the command transport message header (DW0)
385 * bit[4..0] message len (in dwords)
387 * bit[8] write fence to desc
388 * bit[9] write status to H2G buff
389 * bit[10] send status (via G2H)
390 * bit[15..11] reserved
391 * bit[31..16] action code
393 #define GUC_CT_MSG_LEN_SHIFT 0
394 #define GUC_CT_MSG_LEN_MASK 0x1F
395 #define GUC_CT_MSG_WRITE_FENCE_TO_DESC (1 << 8)
396 #define GUC_CT_MSG_WRITE_STATUS_TO_BUFF (1 << 9)
397 #define GUC_CT_MSG_SEND_STATUS (1 << 10)
398 #define GUC_CT_MSG_ACTION_SHIFT 16
399 #define GUC_CT_MSG_ACTION_MASK 0xFFFF
401 #define GUC_FORCEWAKE_RENDER (1 << 0)
402 #define GUC_FORCEWAKE_MEDIA (1 << 1)
404 #define GUC_POWER_UNSPECIFIED 0
405 #define GUC_POWER_D0 1
406 #define GUC_POWER_D1 2
407 #define GUC_POWER_D2 3
408 #define GUC_POWER_D3 4
410 /* Scheduling policy settings */
412 /* Reset engine upon preempt failure */
413 #define POLICY_RESET_ENGINE (1<<0)
414 /* Preempt to idle on quantum expiry */
415 #define POLICY_PREEMPT_TO_IDLE (1<<1)
417 #define POLICY_MAX_NUM_WI 15
418 #define POLICY_DEFAULT_DPC_PROMOTE_TIME_US 500000
419 #define POLICY_DEFAULT_EXECUTION_QUANTUM_US 1000000
420 #define POLICY_DEFAULT_PREEMPTION_TIME_US 500000
421 #define POLICY_DEFAULT_FAULT_TIME_US 250000
424 /* Time for one workload to execute. (in micro seconds) */
425 u32 execution_quantum;
428 /* Time to wait for a preemption request to completed before issuing a
429 * reset. (in micro seconds). */
432 /* How much time to allow to run after the first fault is observed.
433 * Then preempt afterwards. (in micro seconds) */
440 struct guc_policies {
441 struct guc_policy policy[GUC_CLIENT_PRIORITY_NUM][GUC_MAX_ENGINES_NUM];
443 /* In micro seconds. How much time to allow before DPC processing is
444 * called back via interrupt (to prevent DPC queue drain starving).
445 * Typically 1000s of micro seconds (example only, not granularity). */
446 u32 dpc_promote_time;
448 /* Must be set to take these new values. */
451 /* Max number of WIs to process per call. A large value may keep CS
453 u32 max_num_work_items;
458 /* GuC MMIO reg state struct */
460 #define GUC_REGSET_FLAGS_NONE 0x0
461 #define GUC_REGSET_POWERCYCLE 0x1
462 #define GUC_REGSET_MASKED 0x2
463 #define GUC_REGSET_ENGINERESET 0x4
464 #define GUC_REGSET_SAVE_DEFAULT_VALUE 0x8
465 #define GUC_REGSET_SAVE_CURRENT_VALUE 0x10
467 #define GUC_REGSET_MAX_REGISTERS 25
468 #define GUC_MMIO_WHITE_LIST_START 0x24d0
469 #define GUC_MMIO_WHITE_LIST_MAX 12
470 #define GUC_S3_SAVE_SPACE_PAGES 10
472 struct guc_mmio_regset {
477 } registers[GUC_REGSET_MAX_REGISTERS];
480 u32 number_of_registers;
483 /* MMIO registers that are set as non privileged */
484 struct mmio_white_list {
486 u32 offsets[GUC_MMIO_WHITE_LIST_MAX];
490 struct guc_mmio_reg_state {
491 struct guc_mmio_regset global_reg;
492 struct guc_mmio_regset engine_reg[GUC_MAX_ENGINES_NUM];
493 struct mmio_white_list white_list[GUC_MAX_ENGINES_NUM];
496 /* GuC Additional Data Struct */
500 u32 reg_state_buffer;
501 u32 golden_context_lrca;
502 u32 scheduler_policies;
504 u32 eng_state_size[GUC_MAX_ENGINES_NUM];
508 /* GuC logging structures */
510 enum guc_log_buffer_type {
513 GUC_CRASH_DUMP_LOG_BUFFER,
518 * Below state structure is used for coordination of retrieval of GuC firmware
519 * logs. Separate state is maintained for each log buffer type.
520 * read_ptr points to the location where i915 read last in log buffer and
521 * is read only for GuC firmware. write_ptr is incremented by GuC with number
522 * of bytes written for each log entry and is read only for i915.
523 * When any type of log buffer becomes half full, GuC sends a flush interrupt.
524 * GuC firmware expects that while it is writing to 2nd half of the buffer,
525 * first half would get consumed by Host and then get a flush completed
526 * acknowledgment from Host, so that it does not end up doing any overwrite
527 * causing loss of logs. So when buffer gets half filled & i915 has requested
528 * for interrupt, GuC will set flush_to_file field, set the sampled_write_ptr
529 * to the value of write_ptr and raise the interrupt.
530 * On receiving the interrupt i915 should read the buffer, clear flush_to_file
531 * field and also update read_ptr with the value of sample_write_ptr, before
532 * sending an acknowledgment to GuC. marker & version fields are for internal
533 * usage of GuC and opaque to i915. buffer_full_cnt field is incremented every
534 * time GuC detects the log buffer overflow.
536 struct guc_log_buffer_state {
541 u32 sampled_write_ptr;
545 u32 buffer_full_cnt:4;
553 struct guc_ctx_report {
554 u32 report_return_status;
560 /* GuC Shared Context Data Struct */
561 struct guc_shared_ctx_data {
562 u32 addr_of_last_preempted_data_low;
563 u32 addr_of_last_preempted_data_high;
564 u32 addr_of_last_preempted_data_high_tmp;
566 u32 is_mapped_to_proxy;
568 u32 engine_reset_ctx_id;
569 u32 media_reset_count;
571 u32 uk_last_ctx_switch_reason;
576 struct guc_ctx_report preempt_ctx_report[GUC_MAX_ENGINES_NUM];
580 * DOC: MMIO based communication
582 * The MMIO based communication between Host and GuC uses software scratch
583 * registers, where first register holds data treated as message header,
584 * and other registers are used to hold message payload.
586 * For Gen9+, GuC uses software scratch registers 0xC180-0xC1B8,
587 * but no H2G command takes more than 8 parameters and the GuC FW
588 * itself uses an 8-element array to store the H2G message.
590 * +-----------+---------+---------+---------+
591 * | MMIO[0] | MMIO[1] | ... | MMIO[n] |
592 * +-----------+---------+---------+---------+
593 * | header | optional payload |
594 * +======+====+=========+=========+=========+
595 * | 31:28|type| | | |
596 * +------+----+ | | |
597 * | 27:16|data| | | |
598 * +------+----+ | | |
600 * +------+----+---------+---------+---------+
602 * The message header consists of:
604 * - **type**, indicates message type
605 * - **code**, indicates message code, is specific for **type**
606 * - **data**, indicates message data, optional, depends on **code**
608 * The following message **types** are supported:
610 * - **REQUEST**, indicates Host-to-GuC request, requested GuC action code
611 * must be priovided in **code** field. Optional action specific parameters
612 * can be provided in remaining payload registers or **data** field.
614 * - **RESPONSE**, indicates GuC-to-Host response from earlier GuC request,
615 * action response status will be provided in **code** field. Optional
616 * response data can be returned in remaining payload registers or **data**
620 #define GUC_MAX_MMIO_MSG_LEN 8
622 #define INTEL_GUC_MSG_TYPE_SHIFT 28
623 #define INTEL_GUC_MSG_TYPE_MASK (0xF << INTEL_GUC_MSG_TYPE_SHIFT)
624 #define INTEL_GUC_MSG_DATA_SHIFT 16
625 #define INTEL_GUC_MSG_DATA_MASK (0xFFF << INTEL_GUC_MSG_DATA_SHIFT)
626 #define INTEL_GUC_MSG_CODE_SHIFT 0
627 #define INTEL_GUC_MSG_CODE_MASK (0xFFFF << INTEL_GUC_MSG_CODE_SHIFT)
629 #define __INTEL_GUC_MSG_GET(T, m) \
630 (((m) & INTEL_GUC_MSG_ ## T ## _MASK) >> INTEL_GUC_MSG_ ## T ## _SHIFT)
631 #define INTEL_GUC_MSG_TO_TYPE(m) __INTEL_GUC_MSG_GET(TYPE, m)
632 #define INTEL_GUC_MSG_TO_DATA(m) __INTEL_GUC_MSG_GET(DATA, m)
633 #define INTEL_GUC_MSG_TO_CODE(m) __INTEL_GUC_MSG_GET(CODE, m)
635 enum intel_guc_msg_type {
636 INTEL_GUC_MSG_TYPE_REQUEST = 0x0,
637 INTEL_GUC_MSG_TYPE_RESPONSE = 0xF,
640 #define __INTEL_GUC_MSG_TYPE_IS(T, m) \
641 (INTEL_GUC_MSG_TO_TYPE(m) == INTEL_GUC_MSG_TYPE_ ## T)
642 #define INTEL_GUC_MSG_IS_REQUEST(m) __INTEL_GUC_MSG_TYPE_IS(REQUEST, m)
643 #define INTEL_GUC_MSG_IS_RESPONSE(m) __INTEL_GUC_MSG_TYPE_IS(RESPONSE, m)
645 enum intel_guc_action {
646 INTEL_GUC_ACTION_DEFAULT = 0x0,
647 INTEL_GUC_ACTION_REQUEST_PREEMPTION = 0x2,
648 INTEL_GUC_ACTION_REQUEST_ENGINE_RESET = 0x3,
649 INTEL_GUC_ACTION_SAMPLE_FORCEWAKE = 0x6,
650 INTEL_GUC_ACTION_ALLOCATE_DOORBELL = 0x10,
651 INTEL_GUC_ACTION_DEALLOCATE_DOORBELL = 0x20,
652 INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE = 0x30,
653 INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH = 0x302,
654 INTEL_GUC_ACTION_ENTER_S_STATE = 0x501,
655 INTEL_GUC_ACTION_EXIT_S_STATE = 0x502,
656 INTEL_GUC_ACTION_SLPC_REQUEST = 0x3003,
657 INTEL_GUC_ACTION_AUTHENTICATE_HUC = 0x4000,
658 INTEL_GUC_ACTION_REGISTER_COMMAND_TRANSPORT_BUFFER = 0x4505,
659 INTEL_GUC_ACTION_DEREGISTER_COMMAND_TRANSPORT_BUFFER = 0x4506,
660 INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING = 0x0E000,
661 INTEL_GUC_ACTION_LIMIT
664 enum intel_guc_preempt_options {
665 INTEL_GUC_PREEMPT_OPTION_DROP_WORK_Q = 0x4,
666 INTEL_GUC_PREEMPT_OPTION_DROP_SUBMIT_Q = 0x8,
669 enum intel_guc_report_status {
670 INTEL_GUC_REPORT_STATUS_UNKNOWN = 0x0,
671 INTEL_GUC_REPORT_STATUS_ACKED = 0x1,
672 INTEL_GUC_REPORT_STATUS_ERROR = 0x2,
673 INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4,
676 enum intel_guc_sleep_state_status {
677 INTEL_GUC_SLEEP_STATE_SUCCESS = 0x0,
678 INTEL_GUC_SLEEP_STATE_PREEMPT_TO_IDLE_FAILED = 0x1,
679 INTEL_GUC_SLEEP_STATE_ENGINE_RESET_FAILED = 0x2
680 #define INTEL_GUC_SLEEP_STATE_INVALID_MASK 0x80000000
683 #define GUC_LOG_CONTROL_LOGGING_ENABLED (1 << 0)
684 #define GUC_LOG_CONTROL_VERBOSITY_SHIFT 4
685 #define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT)
686 #define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8)
688 enum intel_guc_response_status {
689 INTEL_GUC_RESPONSE_STATUS_SUCCESS = 0x0,
690 INTEL_GUC_RESPONSE_STATUS_GENERIC_FAIL = 0xF000,
693 #define INTEL_GUC_MSG_IS_RESPONSE_SUCCESS(m) \
694 (typecheck(u32, (m)) && \
695 ((m) & (INTEL_GUC_MSG_TYPE_MASK | INTEL_GUC_MSG_CODE_MASK)) == \
696 ((INTEL_GUC_MSG_TYPE_RESPONSE << INTEL_GUC_MSG_TYPE_SHIFT) | \
697 (INTEL_GUC_RESPONSE_STATUS_SUCCESS << INTEL_GUC_MSG_CODE_SHIFT)))
699 /* This action will be programmed in C1BC - SOFT_SCRATCH_15_REG */
700 enum intel_guc_recv_message {
701 INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED = BIT(1),
702 INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER = BIT(3)