10a8e247dSMichal Wajdeczko /* SPDX-License-Identifier: MIT */ 20a8e247dSMichal Wajdeczko /* 30a8e247dSMichal Wajdeczko * Copyright © 2014-2021 Intel Corporation 40a8e247dSMichal Wajdeczko */ 50a8e247dSMichal Wajdeczko 60a8e247dSMichal Wajdeczko #ifndef _ABI_GUC_ACTIONS_ABI_H 70a8e247dSMichal Wajdeczko #define _ABI_GUC_ACTIONS_ABI_H 80a8e247dSMichal Wajdeczko 9572f2a5cSMichal Wajdeczko /** 10572f2a5cSMichal Wajdeczko * DOC: HOST2GUC_REGISTER_CTB 11572f2a5cSMichal Wajdeczko * 12572f2a5cSMichal Wajdeczko * This message is used as part of the `CTB based communication`_ setup. 13572f2a5cSMichal Wajdeczko * 14572f2a5cSMichal Wajdeczko * This message must be sent as `MMIO HXG Message`_. 15572f2a5cSMichal Wajdeczko * 16572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 17572f2a5cSMichal Wajdeczko * | | Bits | Description | 18572f2a5cSMichal Wajdeczko * +===+=======+==============================================================+ 19572f2a5cSMichal Wajdeczko * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | 20572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 21572f2a5cSMichal Wajdeczko * | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ | 22572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 23572f2a5cSMichal Wajdeczko * | | 27:16 | DATA0 = MBZ | 24572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 25572f2a5cSMichal Wajdeczko * | | 15:0 | ACTION = _`GUC_ACTION_HOST2GUC_REGISTER_CTB` = 0x4505 | 26572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 27572f2a5cSMichal Wajdeczko * | 1 | 31:12 | RESERVED = MBZ | 28572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 29572f2a5cSMichal Wajdeczko * | | 11:8 | **TYPE** - type for the `CT Buffer`_ | 30572f2a5cSMichal Wajdeczko * | | | | 31572f2a5cSMichal Wajdeczko * | | | - _`GUC_CTB_TYPE_HOST2GUC` = 0 | 32572f2a5cSMichal Wajdeczko * | | | - _`GUC_CTB_TYPE_GUC2HOST` = 1 | 33572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 34572f2a5cSMichal Wajdeczko * | | 7:0 | **SIZE** - size of the `CT Buffer`_ in 4K units minus 1 | 35572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 36572f2a5cSMichal Wajdeczko * | 2 | 31:0 | **DESC_ADDR** - GGTT address of the `CTB Descriptor`_ | 37572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 38572f2a5cSMichal Wajdeczko * | 3 | 31:0 | **BUFF_ADDF** - GGTT address of the `CT Buffer`_ | 39572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 40572f2a5cSMichal Wajdeczko * 41572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 42572f2a5cSMichal Wajdeczko * | | Bits | Description | 43572f2a5cSMichal Wajdeczko * +===+=======+==============================================================+ 44572f2a5cSMichal Wajdeczko * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_GUC_ | 45572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 46572f2a5cSMichal Wajdeczko * | | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_ | 47572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 48572f2a5cSMichal Wajdeczko * | | 27:0 | DATA0 = MBZ | 49572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 50572f2a5cSMichal Wajdeczko */ 51572f2a5cSMichal Wajdeczko #define GUC_ACTION_HOST2GUC_REGISTER_CTB 0x4505 52572f2a5cSMichal Wajdeczko 53572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_LEN (GUC_HXG_REQUEST_MSG_MIN_LEN + 3u) 54572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_0_MBZ GUC_HXG_REQUEST_MSG_0_DATA0 55572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_1_MBZ (0xfffff << 12) 56572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_1_TYPE (0xf << 8) 57572f2a5cSMichal Wajdeczko #define GUC_CTB_TYPE_HOST2GUC 0u 58572f2a5cSMichal Wajdeczko #define GUC_CTB_TYPE_GUC2HOST 1u 59572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_1_SIZE (0xff << 0) 60572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_2_DESC_ADDR GUC_HXG_REQUEST_MSG_n_DATAn 61572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_REQUEST_MSG_3_BUFF_ADDR GUC_HXG_REQUEST_MSG_n_DATAn 62572f2a5cSMichal Wajdeczko 63572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_RESPONSE_MSG_LEN GUC_HXG_RESPONSE_MSG_MIN_LEN 64572f2a5cSMichal Wajdeczko #define HOST2GUC_REGISTER_CTB_RESPONSE_MSG_0_MBZ GUC_HXG_RESPONSE_MSG_0_DATA0 65572f2a5cSMichal Wajdeczko 66572f2a5cSMichal Wajdeczko /** 67572f2a5cSMichal Wajdeczko * DOC: HOST2GUC_DEREGISTER_CTB 68572f2a5cSMichal Wajdeczko * 69572f2a5cSMichal Wajdeczko * This message is used as part of the `CTB based communication`_ teardown. 70572f2a5cSMichal Wajdeczko * 71572f2a5cSMichal Wajdeczko * This message must be sent as `MMIO HXG Message`_. 72572f2a5cSMichal Wajdeczko * 73572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 74572f2a5cSMichal Wajdeczko * | | Bits | Description | 75572f2a5cSMichal Wajdeczko * +===+=======+==============================================================+ 76572f2a5cSMichal Wajdeczko * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | 77572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 78572f2a5cSMichal Wajdeczko * | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ | 79572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 80572f2a5cSMichal Wajdeczko * | | 27:16 | DATA0 = MBZ | 81572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 82572f2a5cSMichal Wajdeczko * | | 15:0 | ACTION = _`GUC_ACTION_HOST2GUC_DEREGISTER_CTB` = 0x4506 | 83572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 84572f2a5cSMichal Wajdeczko * | 1 | 31:12 | RESERVED = MBZ | 85572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 86572f2a5cSMichal Wajdeczko * | | 11:8 | **TYPE** - type of the `CT Buffer`_ | 87572f2a5cSMichal Wajdeczko * | | | | 88572f2a5cSMichal Wajdeczko * | | | see `GUC_ACTION_HOST2GUC_REGISTER_CTB`_ | 89572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 90572f2a5cSMichal Wajdeczko * | | 7:0 | RESERVED = MBZ | 91572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 92572f2a5cSMichal Wajdeczko * 93572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 94572f2a5cSMichal Wajdeczko * | | Bits | Description | 95572f2a5cSMichal Wajdeczko * +===+=======+==============================================================+ 96572f2a5cSMichal Wajdeczko * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_GUC_ | 97572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 98572f2a5cSMichal Wajdeczko * | | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_ | 99572f2a5cSMichal Wajdeczko * | +-------+--------------------------------------------------------------+ 100572f2a5cSMichal Wajdeczko * | | 27:0 | DATA0 = MBZ | 101572f2a5cSMichal Wajdeczko * +---+-------+--------------------------------------------------------------+ 102572f2a5cSMichal Wajdeczko */ 103572f2a5cSMichal Wajdeczko #define GUC_ACTION_HOST2GUC_DEREGISTER_CTB 0x4506 104572f2a5cSMichal Wajdeczko 105572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_LEN (GUC_HXG_REQUEST_MSG_MIN_LEN + 1u) 106572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_0_MBZ GUC_HXG_REQUEST_MSG_0_DATA0 107572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_1_MBZ (0xfffff << 12) 108572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_1_TYPE (0xf << 8) 109572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_REQUEST_MSG_1_MBZ2 (0xff << 0) 110572f2a5cSMichal Wajdeczko 111572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_RESPONSE_MSG_LEN GUC_HXG_RESPONSE_MSG_MIN_LEN 112572f2a5cSMichal Wajdeczko #define HOST2GUC_DEREGISTER_CTB_RESPONSE_MSG_0_MBZ GUC_HXG_RESPONSE_MSG_0_DATA0 113572f2a5cSMichal Wajdeczko 114572f2a5cSMichal Wajdeczko /* legacy definitions */ 115572f2a5cSMichal Wajdeczko 1160a8e247dSMichal Wajdeczko enum intel_guc_action { 1170a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_DEFAULT = 0x0, 1180a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_REQUEST_PREEMPTION = 0x2, 1190a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_REQUEST_ENGINE_RESET = 0x3, 1200a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_ALLOCATE_DOORBELL = 0x10, 1210a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_DEALLOCATE_DOORBELL = 0x20, 1220a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE = 0x30, 1230a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING = 0x40, 1240a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH = 0x302, 1250a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_ENTER_S_STATE = 0x501, 1260a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_EXIT_S_STATE = 0x502, 12756bc8874SMatthew Brost INTEL_GUC_ACTION_GLOBAL_SCHED_POLICY_CHANGE = 0x506, 12856bc8874SMatthew Brost INTEL_GUC_ACTION_SCHED_CONTEXT = 0x1000, 12956bc8874SMatthew Brost INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_SET = 0x1001, 13056bc8874SMatthew Brost INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE = 0x1002, 13156bc8874SMatthew Brost INTEL_GUC_ACTION_SCHED_ENGINE_MODE_SET = 0x1003, 13256bc8874SMatthew Brost INTEL_GUC_ACTION_SCHED_ENGINE_MODE_DONE = 0x1004, 13356bc8874SMatthew Brost INTEL_GUC_ACTION_SET_CONTEXT_PRIORITY = 0x1005, 13456bc8874SMatthew Brost INTEL_GUC_ACTION_SET_CONTEXT_EXECUTION_QUANTUM = 0x1006, 13556bc8874SMatthew Brost INTEL_GUC_ACTION_SET_CONTEXT_PREEMPTION_TIMEOUT = 0x1007, 13656bc8874SMatthew Brost INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION = 0x1008, 13756bc8874SMatthew Brost INTEL_GUC_ACTION_ENGINE_FAILURE_NOTIFICATION = 0x1009, 138*216d56c5SVinay Belgaumkar INTEL_GUC_ACTION_SETUP_PC_GUCRC = 0x3004, 1390a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_AUTHENTICATE_HUC = 0x4000, 14056bc8874SMatthew Brost INTEL_GUC_ACTION_REGISTER_CONTEXT = 0x4502, 14156bc8874SMatthew Brost INTEL_GUC_ACTION_DEREGISTER_CONTEXT = 0x4503, 1420a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_REGISTER_COMMAND_TRANSPORT_BUFFER = 0x4505, 1430a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_DEREGISTER_COMMAND_TRANSPORT_BUFFER = 0x4506, 14456bc8874SMatthew Brost INTEL_GUC_ACTION_DEREGISTER_CONTEXT_DONE = 0x4600, 145cad46a33SMatthew Brost INTEL_GUC_ACTION_RESET_CLIENT = 0x5507, 1460a8e247dSMichal Wajdeczko INTEL_GUC_ACTION_LIMIT 1470a8e247dSMichal Wajdeczko }; 1480a8e247dSMichal Wajdeczko 149*216d56c5SVinay Belgaumkar enum intel_guc_rc_options { 150*216d56c5SVinay Belgaumkar INTEL_GUCRC_HOST_CONTROL, 151*216d56c5SVinay Belgaumkar INTEL_GUCRC_FIRMWARE_CONTROL, 152*216d56c5SVinay Belgaumkar }; 153*216d56c5SVinay Belgaumkar 1540a8e247dSMichal Wajdeczko enum intel_guc_preempt_options { 1550a8e247dSMichal Wajdeczko INTEL_GUC_PREEMPT_OPTION_DROP_WORK_Q = 0x4, 1560a8e247dSMichal Wajdeczko INTEL_GUC_PREEMPT_OPTION_DROP_SUBMIT_Q = 0x8, 1570a8e247dSMichal Wajdeczko }; 1580a8e247dSMichal Wajdeczko 1590a8e247dSMichal Wajdeczko enum intel_guc_report_status { 1600a8e247dSMichal Wajdeczko INTEL_GUC_REPORT_STATUS_UNKNOWN = 0x0, 1610a8e247dSMichal Wajdeczko INTEL_GUC_REPORT_STATUS_ACKED = 0x1, 1620a8e247dSMichal Wajdeczko INTEL_GUC_REPORT_STATUS_ERROR = 0x2, 1630a8e247dSMichal Wajdeczko INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4, 1640a8e247dSMichal Wajdeczko }; 1650a8e247dSMichal Wajdeczko 1660a8e247dSMichal Wajdeczko enum intel_guc_sleep_state_status { 1670a8e247dSMichal Wajdeczko INTEL_GUC_SLEEP_STATE_SUCCESS = 0x1, 1680a8e247dSMichal Wajdeczko INTEL_GUC_SLEEP_STATE_PREEMPT_TO_IDLE_FAILED = 0x2, 1690a8e247dSMichal Wajdeczko INTEL_GUC_SLEEP_STATE_ENGINE_RESET_FAILED = 0x3 1700a8e247dSMichal Wajdeczko #define INTEL_GUC_SLEEP_STATE_INVALID_MASK 0x80000000 1710a8e247dSMichal Wajdeczko }; 1720a8e247dSMichal Wajdeczko 1730a8e247dSMichal Wajdeczko #define GUC_LOG_CONTROL_LOGGING_ENABLED (1 << 0) 1740a8e247dSMichal Wajdeczko #define GUC_LOG_CONTROL_VERBOSITY_SHIFT 4 1750a8e247dSMichal Wajdeczko #define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT) 1760a8e247dSMichal Wajdeczko #define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8) 1770a8e247dSMichal Wajdeczko 1780a8e247dSMichal Wajdeczko #endif /* _ABI_GUC_ACTIONS_ABI_H */ 179