162306a36Sopenharmony_ci/* SPDX-License-Identifier: MIT */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2020-2023 Intel Corporation
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci/**
762306a36Sopenharmony_ci * @file
862306a36Sopenharmony_ci * @brief JSM shared definitions
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * @ingroup Jsm
1162306a36Sopenharmony_ci * @brief JSM shared definitions
1262306a36Sopenharmony_ci * @{
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#ifndef VPU_JSM_API_H
1562306a36Sopenharmony_ci#define VPU_JSM_API_H
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci/*
1862306a36Sopenharmony_ci * Major version changes that break backward compatibility
1962306a36Sopenharmony_ci */
2062306a36Sopenharmony_ci#define VPU_JSM_API_VER_MAJOR 3
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/*
2362306a36Sopenharmony_ci * Minor version changes when API backward compatibility is preserved.
2462306a36Sopenharmony_ci */
2562306a36Sopenharmony_ci#define VPU_JSM_API_VER_MINOR 0
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/*
2862306a36Sopenharmony_ci * API header changed (field names, documentation, formatting) but API itself has not been changed
2962306a36Sopenharmony_ci */
3062306a36Sopenharmony_ci#define VPU_JSM_API_VER_PATCH 1
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci/*
3362306a36Sopenharmony_ci * Index in the API version table
3462306a36Sopenharmony_ci */
3562306a36Sopenharmony_ci#define VPU_JSM_API_VER_INDEX 4
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/*
3862306a36Sopenharmony_ci * Number of Priority Bands for Hardware Scheduling
3962306a36Sopenharmony_ci * Bands: RealTime, Focus, Normal, Idle
4062306a36Sopenharmony_ci */
4162306a36Sopenharmony_ci#define VPU_HWS_NUM_PRIORITY_BANDS 4
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/* Max number of impacted contexts that can be dealt with the engine reset command */
4462306a36Sopenharmony_ci#define VPU_MAX_ENGINE_RESET_IMPACTED_CONTEXTS 3
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/** Pack the API structures for now, once alignment issues are fixed this can be removed */
4762306a36Sopenharmony_ci#pragma pack(push, 1)
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci/*
5062306a36Sopenharmony_ci * Engine indexes.
5162306a36Sopenharmony_ci */
5262306a36Sopenharmony_ci#define VPU_ENGINE_COMPUTE 0
5362306a36Sopenharmony_ci#define VPU_ENGINE_COPY	   1
5462306a36Sopenharmony_ci#define VPU_ENGINE_NB	   2
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci/*
5762306a36Sopenharmony_ci * VPU status values.
5862306a36Sopenharmony_ci */
5962306a36Sopenharmony_ci#define VPU_JSM_STATUS_SUCCESS				 0x0U
6062306a36Sopenharmony_ci#define VPU_JSM_STATUS_PARSING_ERR			 0x1U
6162306a36Sopenharmony_ci#define VPU_JSM_STATUS_PROCESSING_ERR			 0x2U
6262306a36Sopenharmony_ci#define VPU_JSM_STATUS_PREEMPTED			 0x3U
6362306a36Sopenharmony_ci#define VPU_JSM_STATUS_ABORTED				 0x4U
6462306a36Sopenharmony_ci#define VPU_JSM_STATUS_USER_CTX_VIOL_ERR		 0x5U
6562306a36Sopenharmony_ci#define VPU_JSM_STATUS_GLOBAL_CTX_VIOL_ERR		 0x6U
6662306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_WRONG_INPUT_FORMAT		 0x7U
6762306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_UNSUPPORTED_NETWORK_ELEMENT 0x8U
6862306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_INVALID_HANDLE		 0x9U
6962306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_OUT_OF_RESOURCES		 0xAU
7062306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_NOT_IMPLEMENTED		 0xBU
7162306a36Sopenharmony_ci#define VPU_JSM_STATUS_MVNCI_INTERNAL_ERROR		 0xCU
7262306a36Sopenharmony_ci/* Job status returned when the job was preempted mid-inference */
7362306a36Sopenharmony_ci#define VPU_JSM_STATUS_PREEMPTED_MID_INFERENCE		 0xDU
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci/*
7662306a36Sopenharmony_ci * Host <-> VPU IPC channels.
7762306a36Sopenharmony_ci * ASYNC commands use a high priority channel, other messages use low-priority ones.
7862306a36Sopenharmony_ci */
7962306a36Sopenharmony_ci#define VPU_IPC_CHAN_ASYNC_CMD 0
8062306a36Sopenharmony_ci#define VPU_IPC_CHAN_GEN_CMD   10
8162306a36Sopenharmony_ci#define VPU_IPC_CHAN_JOB_RET   11
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci/*
8462306a36Sopenharmony_ci * Job flags bit masks.
8562306a36Sopenharmony_ci */
8662306a36Sopenharmony_ci#define VPU_JOB_FLAGS_NULL_SUBMISSION_MASK 0x00000001
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci/*
8962306a36Sopenharmony_ci * Sizes of the reserved areas in jobs, in bytes.
9062306a36Sopenharmony_ci */
9162306a36Sopenharmony_ci#define VPU_JOB_RESERVED_BYTES	     16
9262306a36Sopenharmony_ci/*
9362306a36Sopenharmony_ci * Sizes of the reserved areas in job queues, in bytes.
9462306a36Sopenharmony_ci */
9562306a36Sopenharmony_ci#define VPU_JOB_QUEUE_RESERVED_BYTES 52
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci/*
9862306a36Sopenharmony_ci * Max length (including trailing NULL char) of trace entity name (e.g., the
9962306a36Sopenharmony_ci * name of a logging destination or a loggable HW component).
10062306a36Sopenharmony_ci */
10162306a36Sopenharmony_ci#define VPU_TRACE_ENTITY_NAME_MAX_LEN 32
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci/*
10462306a36Sopenharmony_ci * Max length (including trailing NULL char) of a dyndbg command.
10562306a36Sopenharmony_ci *
10662306a36Sopenharmony_ci * NOTE: 96 is used so that the size of 'struct vpu_ipc_msg' in the JSM API is
10762306a36Sopenharmony_ci * 128 bytes (multiple of 64 bytes, the cache line size).
10862306a36Sopenharmony_ci */
10962306a36Sopenharmony_ci#define VPU_DYNDBG_CMD_MAX_LEN 96
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci/*
11262306a36Sopenharmony_ci * Job format.
11362306a36Sopenharmony_ci */
11462306a36Sopenharmony_cistruct vpu_job_queue_entry {
11562306a36Sopenharmony_ci	u64 batch_buf_addr; /**< Address of VPU commands batch buffer */
11662306a36Sopenharmony_ci	u32 job_id;	  /**< Job ID */
11762306a36Sopenharmony_ci	u32 flags; /**< Flags bit field, see VPU_JOB_FLAGS_* above */
11862306a36Sopenharmony_ci	u64 root_page_table_addr; /**< Address of root page table to use for this job */
11962306a36Sopenharmony_ci	u64 root_page_table_update_counter; /**< Page tables update events counter */
12062306a36Sopenharmony_ci	u64 preemption_buffer_address; /**< Address of the preemption buffer to use for this job */
12162306a36Sopenharmony_ci	u64 preemption_buffer_size; /**< Size of the preemption buffer to use for this job */
12262306a36Sopenharmony_ci	u8 reserved_0[VPU_JOB_RESERVED_BYTES];
12362306a36Sopenharmony_ci};
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci/*
12662306a36Sopenharmony_ci * Job queue control registers.
12762306a36Sopenharmony_ci */
12862306a36Sopenharmony_cistruct vpu_job_queue_header {
12962306a36Sopenharmony_ci	u32 engine_idx;
13062306a36Sopenharmony_ci	u32 head;
13162306a36Sopenharmony_ci	u32 tail;
13262306a36Sopenharmony_ci	u8 reserved_0[VPU_JOB_QUEUE_RESERVED_BYTES];
13362306a36Sopenharmony_ci};
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci/*
13662306a36Sopenharmony_ci * Job queue format.
13762306a36Sopenharmony_ci */
13862306a36Sopenharmony_cistruct vpu_job_queue {
13962306a36Sopenharmony_ci	struct vpu_job_queue_header header;
14062306a36Sopenharmony_ci	struct vpu_job_queue_entry job[];
14162306a36Sopenharmony_ci};
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci/**
14462306a36Sopenharmony_ci * Logging entity types.
14562306a36Sopenharmony_ci *
14662306a36Sopenharmony_ci * This enum defines the different types of entities involved in logging.
14762306a36Sopenharmony_ci */
14862306a36Sopenharmony_cienum vpu_trace_entity_type {
14962306a36Sopenharmony_ci	/** Logging destination (entity where logs can be stored / printed). */
15062306a36Sopenharmony_ci	VPU_TRACE_ENTITY_TYPE_DESTINATION = 1,
15162306a36Sopenharmony_ci	/** Loggable HW component (HW entity that can be logged). */
15262306a36Sopenharmony_ci	VPU_TRACE_ENTITY_TYPE_HW_COMPONENT = 2,
15362306a36Sopenharmony_ci};
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci/*
15662306a36Sopenharmony_ci * Host <-> VPU IPC messages types.
15762306a36Sopenharmony_ci */
15862306a36Sopenharmony_cienum vpu_ipc_msg_type {
15962306a36Sopenharmony_ci	VPU_JSM_MSG_UNKNOWN = 0xFFFFFFFF,
16062306a36Sopenharmony_ci	/* IPC Host -> Device, Async commands */
16162306a36Sopenharmony_ci	VPU_JSM_MSG_ASYNC_CMD = 0x1100,
16262306a36Sopenharmony_ci	VPU_JSM_MSG_ENGINE_RESET = VPU_JSM_MSG_ASYNC_CMD,
16362306a36Sopenharmony_ci	VPU_JSM_MSG_ENGINE_PREEMPT = 0x1101,
16462306a36Sopenharmony_ci	VPU_JSM_MSG_REGISTER_DB = 0x1102,
16562306a36Sopenharmony_ci	VPU_JSM_MSG_UNREGISTER_DB = 0x1103,
16662306a36Sopenharmony_ci	VPU_JSM_MSG_QUERY_ENGINE_HB = 0x1104,
16762306a36Sopenharmony_ci	VPU_JSM_MSG_GET_POWER_LEVEL_COUNT = 0x1105,
16862306a36Sopenharmony_ci	VPU_JSM_MSG_GET_POWER_LEVEL = 0x1106,
16962306a36Sopenharmony_ci	VPU_JSM_MSG_SET_POWER_LEVEL = 0x1107,
17062306a36Sopenharmony_ci	/* @deprecated */
17162306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_OPEN = 0x1108,
17262306a36Sopenharmony_ci	/* @deprecated */
17362306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_CLOSE = 0x1109,
17462306a36Sopenharmony_ci	/** Configure logging (used to modify configuration passed in boot params). */
17562306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_SET_CONFIG = 0x110a,
17662306a36Sopenharmony_ci	/** Return current logging configuration. */
17762306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_CONFIG = 0x110b,
17862306a36Sopenharmony_ci	/**
17962306a36Sopenharmony_ci	 * Get masks of destinations and HW components supported by the firmware
18062306a36Sopenharmony_ci	 * (may vary between HW generations and FW compile
18162306a36Sopenharmony_ci	 * time configurations)
18262306a36Sopenharmony_ci	 */
18362306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_CAPABILITY = 0x110c,
18462306a36Sopenharmony_ci	/** Get the name of a destination or HW component. */
18562306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_NAME = 0x110d,
18662306a36Sopenharmony_ci	/**
18762306a36Sopenharmony_ci	 * Release resource associated with host ssid . All jobs that belong to the host_ssid
18862306a36Sopenharmony_ci	 * aborted and removed from internal scheduling queues. All doorbells assigned
18962306a36Sopenharmony_ci	 * to the host_ssid are unregistered and any internal FW resources belonging to
19062306a36Sopenharmony_ci	 * the host_ssid are released.
19162306a36Sopenharmony_ci	 */
19262306a36Sopenharmony_ci	VPU_JSM_MSG_SSID_RELEASE = 0x110e,
19362306a36Sopenharmony_ci	/**
19462306a36Sopenharmony_ci	 * Start collecting metric data.
19562306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_start
19662306a36Sopenharmony_ci	 */
19762306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_START = 0x110f,
19862306a36Sopenharmony_ci	/**
19962306a36Sopenharmony_ci	 * Stop collecting metric data. This command will return success if it is called
20062306a36Sopenharmony_ci	 * for a metric stream that has already been stopped or was never started.
20162306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_stop
20262306a36Sopenharmony_ci	 */
20362306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_STOP = 0x1110,
20462306a36Sopenharmony_ci	/**
20562306a36Sopenharmony_ci	 * Update current and next buffer for metric data collection. This command can
20662306a36Sopenharmony_ci	 * also be used to request information about the number of collected samples
20762306a36Sopenharmony_ci	 * and the amount of data written to the buffer.
20862306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_update
20962306a36Sopenharmony_ci	 */
21062306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_UPDATE = 0x1111,
21162306a36Sopenharmony_ci	/**
21262306a36Sopenharmony_ci	 * Request description of selected metric groups and metric counters within
21362306a36Sopenharmony_ci	 * each group. The VPU will write the description of groups and counters to
21462306a36Sopenharmony_ci	 * the buffer specified in the command structure.
21562306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_start
21662306a36Sopenharmony_ci	 */
21762306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_INFO = 0x1112,
21862306a36Sopenharmony_ci	/** Control command: Priority band setup */
21962306a36Sopenharmony_ci	VPU_JSM_MSG_SET_PRIORITY_BAND_SETUP = 0x1113,
22062306a36Sopenharmony_ci	/** Control command: Create command queue */
22162306a36Sopenharmony_ci	VPU_JSM_MSG_CREATE_CMD_QUEUE = 0x1114,
22262306a36Sopenharmony_ci	/** Control command: Destroy command queue */
22362306a36Sopenharmony_ci	VPU_JSM_MSG_DESTROY_CMD_QUEUE = 0x1115,
22462306a36Sopenharmony_ci	/** Control command: Set context scheduling properties */
22562306a36Sopenharmony_ci	VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES = 0x1116,
22662306a36Sopenharmony_ci	/*
22762306a36Sopenharmony_ci	 * Register a doorbell to notify VPU of new work. The doorbell may later be
22862306a36Sopenharmony_ci	 * deallocated or reassigned to another context.
22962306a36Sopenharmony_ci	 */
23062306a36Sopenharmony_ci	VPU_JSM_MSG_HWS_REGISTER_DB = 0x1117,
23162306a36Sopenharmony_ci	/* IPC Host -> Device, General commands */
23262306a36Sopenharmony_ci	VPU_JSM_MSG_GENERAL_CMD = 0x1200,
23362306a36Sopenharmony_ci	VPU_JSM_MSG_BLOB_DEINIT = VPU_JSM_MSG_GENERAL_CMD,
23462306a36Sopenharmony_ci	/**
23562306a36Sopenharmony_ci	 * Control dyndbg behavior by executing a dyndbg command; equivalent to
23662306a36Sopenharmony_ci	 * Linux command: `echo '<dyndbg_cmd>' > <debugfs>/dynamic_debug/control`.
23762306a36Sopenharmony_ci	 */
23862306a36Sopenharmony_ci	VPU_JSM_MSG_DYNDBG_CONTROL = 0x1201,
23962306a36Sopenharmony_ci	/* IPC Device -> Host, Job completion */
24062306a36Sopenharmony_ci	VPU_JSM_MSG_JOB_DONE = 0x2100,
24162306a36Sopenharmony_ci	/* IPC Device -> Host, Async command completion */
24262306a36Sopenharmony_ci	VPU_JSM_MSG_ASYNC_CMD_DONE = 0x2200,
24362306a36Sopenharmony_ci	VPU_JSM_MSG_ENGINE_RESET_DONE = VPU_JSM_MSG_ASYNC_CMD_DONE,
24462306a36Sopenharmony_ci	VPU_JSM_MSG_ENGINE_PREEMPT_DONE = 0x2201,
24562306a36Sopenharmony_ci	VPU_JSM_MSG_REGISTER_DB_DONE = 0x2202,
24662306a36Sopenharmony_ci	VPU_JSM_MSG_UNREGISTER_DB_DONE = 0x2203,
24762306a36Sopenharmony_ci	VPU_JSM_MSG_QUERY_ENGINE_HB_DONE = 0x2204,
24862306a36Sopenharmony_ci	VPU_JSM_MSG_GET_POWER_LEVEL_COUNT_DONE = 0x2205,
24962306a36Sopenharmony_ci	VPU_JSM_MSG_GET_POWER_LEVEL_DONE = 0x2206,
25062306a36Sopenharmony_ci	VPU_JSM_MSG_SET_POWER_LEVEL_DONE = 0x2207,
25162306a36Sopenharmony_ci	/* @deprecated */
25262306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_OPEN_DONE = 0x2208,
25362306a36Sopenharmony_ci	/* @deprecated */
25462306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_CLOSE_DONE = 0x2209,
25562306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_TRACE_SET_CONFIG. */
25662306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_SET_CONFIG_RSP = 0x220a,
25762306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_TRACE_GET_CONFIG. */
25862306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_CONFIG_RSP = 0x220b,
25962306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_TRACE_GET_CAPABILITY. */
26062306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_CAPABILITY_RSP = 0x220c,
26162306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_TRACE_GET_NAME. */
26262306a36Sopenharmony_ci	VPU_JSM_MSG_TRACE_GET_NAME_RSP = 0x220d,
26362306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_SSID_RELEASE. */
26462306a36Sopenharmony_ci	VPU_JSM_MSG_SSID_RELEASE_DONE = 0x220e,
26562306a36Sopenharmony_ci	/**
26662306a36Sopenharmony_ci	 * Response to VPU_JSM_MSG_METRIC_STREAMER_START.
26762306a36Sopenharmony_ci	 * VPU will return an error result if metric collection cannot be started,
26862306a36Sopenharmony_ci	 * e.g. when the specified metric mask is invalid.
26962306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_done
27062306a36Sopenharmony_ci	 */
27162306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_START_DONE = 0x220f,
27262306a36Sopenharmony_ci	/**
27362306a36Sopenharmony_ci	 * Response to VPU_JSM_MSG_METRIC_STREAMER_STOP.
27462306a36Sopenharmony_ci	 * Returns information about collected metric data.
27562306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_done
27662306a36Sopenharmony_ci	 */
27762306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_STOP_DONE = 0x2210,
27862306a36Sopenharmony_ci	/**
27962306a36Sopenharmony_ci	 * Response to VPU_JSM_MSG_METRIC_STREAMER_UPDATE.
28062306a36Sopenharmony_ci	 * Returns information about collected metric data.
28162306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_done
28262306a36Sopenharmony_ci	 */
28362306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_UPDATE_DONE = 0x2211,
28462306a36Sopenharmony_ci	/**
28562306a36Sopenharmony_ci	 * Response to VPU_JSM_MSG_METRIC_STREAMER_INFO.
28662306a36Sopenharmony_ci	 * Returns a description of the metric groups and metric counters.
28762306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_done
28862306a36Sopenharmony_ci	 */
28962306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_INFO_DONE = 0x2212,
29062306a36Sopenharmony_ci	/**
29162306a36Sopenharmony_ci	 * Asynchronous event sent from the VPU to the host either when the current
29262306a36Sopenharmony_ci	 * metric buffer is full or when the VPU has collected a multiple of
29362306a36Sopenharmony_ci	 * @notify_sample_count samples as indicated through the start command
29462306a36Sopenharmony_ci	 * (VPU_JSM_MSG_METRIC_STREAMER_START). Returns information about collected
29562306a36Sopenharmony_ci	 * metric data.
29662306a36Sopenharmony_ci	 * @see vpu_jsm_metric_streamer_done
29762306a36Sopenharmony_ci	 */
29862306a36Sopenharmony_ci	VPU_JSM_MSG_METRIC_STREAMER_NOTIFICATION = 0x2213,
29962306a36Sopenharmony_ci	/** Response to control command: Priority band setup */
30062306a36Sopenharmony_ci	VPU_JSM_MSG_SET_PRIORITY_BAND_SETUP_RSP = 0x2214,
30162306a36Sopenharmony_ci	/** Response to control command: Create command queue */
30262306a36Sopenharmony_ci	VPU_JSM_MSG_CREATE_CMD_QUEUE_RSP = 0x2215,
30362306a36Sopenharmony_ci	/** Response to control command: Destroy command queue */
30462306a36Sopenharmony_ci	VPU_JSM_MSG_DESTROY_CMD_QUEUE_RSP = 0x2216,
30562306a36Sopenharmony_ci	/** Response to control command: Set context scheduling properties */
30662306a36Sopenharmony_ci	VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES_RSP = 0x2217,
30762306a36Sopenharmony_ci	/* IPC Device -> Host, General command completion */
30862306a36Sopenharmony_ci	VPU_JSM_MSG_GENERAL_CMD_DONE = 0x2300,
30962306a36Sopenharmony_ci	VPU_JSM_MSG_BLOB_DEINIT_DONE = VPU_JSM_MSG_GENERAL_CMD_DONE,
31062306a36Sopenharmony_ci	/** Response to VPU_JSM_MSG_DYNDBG_CONTROL. */
31162306a36Sopenharmony_ci	VPU_JSM_MSG_DYNDBG_CONTROL_RSP = 0x2301,
31262306a36Sopenharmony_ci};
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_cienum vpu_ipc_msg_status { VPU_JSM_MSG_FREE, VPU_JSM_MSG_ALLOCATED };
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci/*
31762306a36Sopenharmony_ci * Host <-> LRT IPC message payload definitions
31862306a36Sopenharmony_ci */
31962306a36Sopenharmony_cistruct vpu_ipc_msg_payload_engine_reset {
32062306a36Sopenharmony_ci	/* Engine to be reset. */
32162306a36Sopenharmony_ci	u32 engine_idx;
32262306a36Sopenharmony_ci	/* Reserved */
32362306a36Sopenharmony_ci	u32 reserved_0;
32462306a36Sopenharmony_ci};
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_cistruct vpu_ipc_msg_payload_engine_preempt {
32762306a36Sopenharmony_ci	/* Engine to be preempted. */
32862306a36Sopenharmony_ci	u32 engine_idx;
32962306a36Sopenharmony_ci	/* ID of the preemption request. */
33062306a36Sopenharmony_ci	u32 preempt_id;
33162306a36Sopenharmony_ci};
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ci/*
33462306a36Sopenharmony_ci * @brief Register doorbell command structure.
33562306a36Sopenharmony_ci * This structure supports doorbell registration for only OS scheduling.
33662306a36Sopenharmony_ci * @see VPU_JSM_MSG_REGISTER_DB
33762306a36Sopenharmony_ci */
33862306a36Sopenharmony_cistruct vpu_ipc_msg_payload_register_db {
33962306a36Sopenharmony_ci	/* Index of the doorbell to register. */
34062306a36Sopenharmony_ci	u32 db_idx;
34162306a36Sopenharmony_ci	/* Reserved */
34262306a36Sopenharmony_ci	u32 reserved_0;
34362306a36Sopenharmony_ci	/* Virtual address in Global GTT pointing to the start of job queue. */
34462306a36Sopenharmony_ci	u64 jobq_base;
34562306a36Sopenharmony_ci	/* Size of the job queue in bytes. */
34662306a36Sopenharmony_ci	u32 jobq_size;
34762306a36Sopenharmony_ci	/* Host sub-stream ID for the context assigned to the doorbell. */
34862306a36Sopenharmony_ci	u32 host_ssid;
34962306a36Sopenharmony_ci};
35062306a36Sopenharmony_ci
35162306a36Sopenharmony_ci/**
35262306a36Sopenharmony_ci * @brief Unregister doorbell command structure.
35362306a36Sopenharmony_ci * Request structure to unregister a doorbell for both HW and OS scheduling.
35462306a36Sopenharmony_ci * @see VPU_JSM_MSG_UNREGISTER_DB
35562306a36Sopenharmony_ci */
35662306a36Sopenharmony_cistruct vpu_ipc_msg_payload_unregister_db {
35762306a36Sopenharmony_ci	/* Index of the doorbell to unregister. */
35862306a36Sopenharmony_ci	u32 db_idx;
35962306a36Sopenharmony_ci	/* Reserved */
36062306a36Sopenharmony_ci	u32 reserved_0;
36162306a36Sopenharmony_ci};
36262306a36Sopenharmony_ci
36362306a36Sopenharmony_cistruct vpu_ipc_msg_payload_query_engine_hb {
36462306a36Sopenharmony_ci	/* Engine to return heartbeat value. */
36562306a36Sopenharmony_ci	u32 engine_idx;
36662306a36Sopenharmony_ci	/* Reserved */
36762306a36Sopenharmony_ci	u32 reserved_0;
36862306a36Sopenharmony_ci};
36962306a36Sopenharmony_ci
37062306a36Sopenharmony_cistruct vpu_ipc_msg_payload_power_level {
37162306a36Sopenharmony_ci	/**
37262306a36Sopenharmony_ci	 * Requested power level. The power level value is in the
37362306a36Sopenharmony_ci	 * range [0, power_level_count-1] where power_level_count
37462306a36Sopenharmony_ci	 * is the number of available power levels as returned by
37562306a36Sopenharmony_ci	 * the get power level count command. A power level of 0
37662306a36Sopenharmony_ci	 * corresponds to the maximum possible power level, while
37762306a36Sopenharmony_ci	 * power_level_count-1 corresponds to the minimum possible
37862306a36Sopenharmony_ci	 * power level. Values outside of this range are not
37962306a36Sopenharmony_ci	 * considered to be valid.
38062306a36Sopenharmony_ci	 */
38162306a36Sopenharmony_ci	u32 power_level;
38262306a36Sopenharmony_ci	/* Reserved */
38362306a36Sopenharmony_ci	u32 reserved_0;
38462306a36Sopenharmony_ci};
38562306a36Sopenharmony_ci
38662306a36Sopenharmony_cistruct vpu_ipc_msg_payload_ssid_release {
38762306a36Sopenharmony_ci	/* Host sub-stream ID for the context to be released. */
38862306a36Sopenharmony_ci	u32 host_ssid;
38962306a36Sopenharmony_ci	/* Reserved */
39062306a36Sopenharmony_ci	u32 reserved_0;
39162306a36Sopenharmony_ci};
39262306a36Sopenharmony_ci
39362306a36Sopenharmony_ci/**
39462306a36Sopenharmony_ci * @brief Metric streamer start command structure.
39562306a36Sopenharmony_ci * This structure is also used with VPU_JSM_MSG_METRIC_STREAMER_INFO to request metric
39662306a36Sopenharmony_ci * groups and metric counters description from the firmware.
39762306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_START
39862306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_INFO
39962306a36Sopenharmony_ci */
40062306a36Sopenharmony_cistruct vpu_jsm_metric_streamer_start {
40162306a36Sopenharmony_ci	/**
40262306a36Sopenharmony_ci	 * Bitmask to select the desired metric groups.
40362306a36Sopenharmony_ci	 * A metric group can belong only to one metric streamer instance at a time.
40462306a36Sopenharmony_ci	 * Since each metric streamer instance has a unique set of metric groups, it
40562306a36Sopenharmony_ci	 * can also identify a metric streamer instance if more than one instance was
40662306a36Sopenharmony_ci	 * started. If the VPU device does not support multiple metric streamer instances,
40762306a36Sopenharmony_ci	 * then VPU_JSM_MSG_METRIC_STREAMER_START will return an error even if the second
40862306a36Sopenharmony_ci	 * instance has different groups to the first.
40962306a36Sopenharmony_ci	 */
41062306a36Sopenharmony_ci	u64 metric_group_mask;
41162306a36Sopenharmony_ci	/** Sampling rate in nanoseconds. */
41262306a36Sopenharmony_ci	u64 sampling_rate;
41362306a36Sopenharmony_ci	/**
41462306a36Sopenharmony_ci	 * If > 0 the VPU will send a VPU_JSM_MSG_METRIC_STREAMER_NOTIFICATION message
41562306a36Sopenharmony_ci	 * after every @notify_sample_count samples is collected or dropped by the VPU.
41662306a36Sopenharmony_ci	 * If set to UINT_MAX the VPU will only generate a notification when the metric
41762306a36Sopenharmony_ci	 * buffer is full. If set to 0 the VPU will never generate a notification.
41862306a36Sopenharmony_ci	 */
41962306a36Sopenharmony_ci	u32 notify_sample_count;
42062306a36Sopenharmony_ci	u32 reserved_0;
42162306a36Sopenharmony_ci	/**
42262306a36Sopenharmony_ci	 * Address and size of the buffer where the VPU will write metric data. The
42362306a36Sopenharmony_ci	 * VPU writes all counters from enabled metric groups one after another. If
42462306a36Sopenharmony_ci	 * there is no space left to write data at the next sample period the VPU
42562306a36Sopenharmony_ci	 * will switch to the next buffer (@see next_buffer_addr) and will optionally
42662306a36Sopenharmony_ci	 * send a notification to the host driver if @notify_sample_count is non-zero.
42762306a36Sopenharmony_ci	 * If @next_buffer_addr is NULL the VPU will stop collecting metric data.
42862306a36Sopenharmony_ci	 */
42962306a36Sopenharmony_ci	u64 buffer_addr;
43062306a36Sopenharmony_ci	u64 buffer_size;
43162306a36Sopenharmony_ci	/**
43262306a36Sopenharmony_ci	 * Address and size of the next buffer to write metric data to after the initial
43362306a36Sopenharmony_ci	 * buffer is full. If the address is NULL the VPU will stop collecting metric
43462306a36Sopenharmony_ci	 * data.
43562306a36Sopenharmony_ci	 */
43662306a36Sopenharmony_ci	u64 next_buffer_addr;
43762306a36Sopenharmony_ci	u64 next_buffer_size;
43862306a36Sopenharmony_ci};
43962306a36Sopenharmony_ci
44062306a36Sopenharmony_ci/**
44162306a36Sopenharmony_ci * @brief Metric streamer stop command structure.
44262306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_STOP
44362306a36Sopenharmony_ci */
44462306a36Sopenharmony_cistruct vpu_jsm_metric_streamer_stop {
44562306a36Sopenharmony_ci	/** Bitmask to select the desired metric groups. */
44662306a36Sopenharmony_ci	u64 metric_group_mask;
44762306a36Sopenharmony_ci};
44862306a36Sopenharmony_ci
44962306a36Sopenharmony_ci/**
45062306a36Sopenharmony_ci * Provide VPU FW with buffers to write metric data.
45162306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_UPDATE
45262306a36Sopenharmony_ci */
45362306a36Sopenharmony_cistruct vpu_jsm_metric_streamer_update {
45462306a36Sopenharmony_ci	/** Metric group mask that identifies metric streamer instance. */
45562306a36Sopenharmony_ci	u64 metric_group_mask;
45662306a36Sopenharmony_ci	/**
45762306a36Sopenharmony_ci	 * Address and size of the buffer where the VPU will write metric data. If
45862306a36Sopenharmony_ci	 * the buffer address is 0 or same as the currently used buffer the VPU will
45962306a36Sopenharmony_ci	 * continue writing metric data to the current buffer. In this case the
46062306a36Sopenharmony_ci	 * buffer size is ignored and the size of the current buffer is unchanged.
46162306a36Sopenharmony_ci	 * If the address is non-zero and differs from the current buffer address the
46262306a36Sopenharmony_ci	 * VPU will immediately switch data collection to the new buffer.
46362306a36Sopenharmony_ci	 */
46462306a36Sopenharmony_ci	u64 buffer_addr;
46562306a36Sopenharmony_ci	u64 buffer_size;
46662306a36Sopenharmony_ci	/**
46762306a36Sopenharmony_ci	 * Address and size of the next buffer to write metric data after the initial
46862306a36Sopenharmony_ci	 * buffer is full. If the address is NULL the VPU will stop collecting metric
46962306a36Sopenharmony_ci	 * data but will continue to record dropped samples.
47062306a36Sopenharmony_ci	 *
47162306a36Sopenharmony_ci	 * Note that there is a hazard possible if both buffer_addr and the next_buffer_addr
47262306a36Sopenharmony_ci	 * are non-zero in same update request. It is the host's responsibility to ensure
47362306a36Sopenharmony_ci	 * that both addresses make sense even if the VPU just switched to writing samples
47462306a36Sopenharmony_ci	 * from the current to the next buffer.
47562306a36Sopenharmony_ci	 */
47662306a36Sopenharmony_ci	u64 next_buffer_addr;
47762306a36Sopenharmony_ci	u64 next_buffer_size;
47862306a36Sopenharmony_ci};
47962306a36Sopenharmony_ci
48062306a36Sopenharmony_cistruct vpu_ipc_msg_payload_blob_deinit {
48162306a36Sopenharmony_ci	/* 64-bit unique ID for the blob to be de-initialized. */
48262306a36Sopenharmony_ci	u64 blob_id;
48362306a36Sopenharmony_ci};
48462306a36Sopenharmony_ci
48562306a36Sopenharmony_cistruct vpu_ipc_msg_payload_job_done {
48662306a36Sopenharmony_ci	/* Engine to which the job was submitted. */
48762306a36Sopenharmony_ci	u32 engine_idx;
48862306a36Sopenharmony_ci	/* Index of the doorbell to which the job was submitted */
48962306a36Sopenharmony_ci	u32 db_idx;
49062306a36Sopenharmony_ci	/* ID of the completed job */
49162306a36Sopenharmony_ci	u32 job_id;
49262306a36Sopenharmony_ci	/* Status of the completed job */
49362306a36Sopenharmony_ci	u32 job_status;
49462306a36Sopenharmony_ci	/* Host SSID */
49562306a36Sopenharmony_ci	u32 host_ssid;
49662306a36Sopenharmony_ci	/* Zero Padding */
49762306a36Sopenharmony_ci	u32 reserved_0;
49862306a36Sopenharmony_ci	/* Command queue id */
49962306a36Sopenharmony_ci	u64 cmdq_id;
50062306a36Sopenharmony_ci};
50162306a36Sopenharmony_ci
50262306a36Sopenharmony_cistruct vpu_jsm_engine_reset_context {
50362306a36Sopenharmony_ci	/* Host SSID */
50462306a36Sopenharmony_ci	u32 host_ssid;
50562306a36Sopenharmony_ci	/* Zero Padding */
50662306a36Sopenharmony_ci	u32 reserved_0;
50762306a36Sopenharmony_ci	/* Command queue id */
50862306a36Sopenharmony_ci	u64 cmdq_id;
50962306a36Sopenharmony_ci	/* Flags: 0: cause of hang; 1: collateral damage of reset */
51062306a36Sopenharmony_ci	u64 flags;
51162306a36Sopenharmony_ci};
51262306a36Sopenharmony_ci
51362306a36Sopenharmony_cistruct vpu_ipc_msg_payload_engine_reset_done {
51462306a36Sopenharmony_ci	/* Engine ordinal */
51562306a36Sopenharmony_ci	u32 engine_idx;
51662306a36Sopenharmony_ci	/* Number of impacted contexts */
51762306a36Sopenharmony_ci	u32 num_impacted_contexts;
51862306a36Sopenharmony_ci	/* Array of impacted command queue ids and their flags */
51962306a36Sopenharmony_ci	struct vpu_jsm_engine_reset_context
52062306a36Sopenharmony_ci		impacted_contexts[VPU_MAX_ENGINE_RESET_IMPACTED_CONTEXTS];
52162306a36Sopenharmony_ci};
52262306a36Sopenharmony_ci
52362306a36Sopenharmony_cistruct vpu_ipc_msg_payload_engine_preempt_done {
52462306a36Sopenharmony_ci	/* Engine preempted. */
52562306a36Sopenharmony_ci	u32 engine_idx;
52662306a36Sopenharmony_ci	/* ID of the preemption request. */
52762306a36Sopenharmony_ci	u32 preempt_id;
52862306a36Sopenharmony_ci};
52962306a36Sopenharmony_ci
53062306a36Sopenharmony_ci/**
53162306a36Sopenharmony_ci * Response structure for register doorbell command for both OS
53262306a36Sopenharmony_ci * and HW scheduling.
53362306a36Sopenharmony_ci * @see VPU_JSM_MSG_REGISTER_DB
53462306a36Sopenharmony_ci * @see VPU_JSM_MSG_HWS_REGISTER_DB
53562306a36Sopenharmony_ci */
53662306a36Sopenharmony_cistruct vpu_ipc_msg_payload_register_db_done {
53762306a36Sopenharmony_ci	/* Index of the registered doorbell. */
53862306a36Sopenharmony_ci	u32 db_idx;
53962306a36Sopenharmony_ci	/* Reserved */
54062306a36Sopenharmony_ci	u32 reserved_0;
54162306a36Sopenharmony_ci};
54262306a36Sopenharmony_ci
54362306a36Sopenharmony_ci/**
54462306a36Sopenharmony_ci * Response structure for unregister doorbell command for both OS
54562306a36Sopenharmony_ci * and HW scheduling.
54662306a36Sopenharmony_ci * @see VPU_JSM_MSG_UNREGISTER_DB
54762306a36Sopenharmony_ci */
54862306a36Sopenharmony_cistruct vpu_ipc_msg_payload_unregister_db_done {
54962306a36Sopenharmony_ci	/* Index of the unregistered doorbell. */
55062306a36Sopenharmony_ci	u32 db_idx;
55162306a36Sopenharmony_ci	/* Reserved */
55262306a36Sopenharmony_ci	u32 reserved_0;
55362306a36Sopenharmony_ci};
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_cistruct vpu_ipc_msg_payload_query_engine_hb_done {
55662306a36Sopenharmony_ci	/* Engine returning heartbeat value. */
55762306a36Sopenharmony_ci	u32 engine_idx;
55862306a36Sopenharmony_ci	/* Reserved */
55962306a36Sopenharmony_ci	u32 reserved_0;
56062306a36Sopenharmony_ci	/* Heartbeat value. */
56162306a36Sopenharmony_ci	u64 heartbeat;
56262306a36Sopenharmony_ci};
56362306a36Sopenharmony_ci
56462306a36Sopenharmony_cistruct vpu_ipc_msg_payload_get_power_level_count_done {
56562306a36Sopenharmony_ci	/**
56662306a36Sopenharmony_ci	 * Number of supported power levels. The maximum possible
56762306a36Sopenharmony_ci	 * value of power_level_count is 16 but this may vary across
56862306a36Sopenharmony_ci	 * implementations.
56962306a36Sopenharmony_ci	 */
57062306a36Sopenharmony_ci	u32 power_level_count;
57162306a36Sopenharmony_ci	/* Reserved */
57262306a36Sopenharmony_ci	u32 reserved_0;
57362306a36Sopenharmony_ci	/**
57462306a36Sopenharmony_ci	 * Power consumption limit for each supported power level in
57562306a36Sopenharmony_ci	 * [0-100%] range relative to power level 0.
57662306a36Sopenharmony_ci	 */
57762306a36Sopenharmony_ci	u8 power_limit[16];
57862306a36Sopenharmony_ci};
57962306a36Sopenharmony_ci
58062306a36Sopenharmony_cistruct vpu_ipc_msg_payload_blob_deinit_done {
58162306a36Sopenharmony_ci	/* 64-bit unique ID for the blob de-initialized. */
58262306a36Sopenharmony_ci	u64 blob_id;
58362306a36Sopenharmony_ci};
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_ci/* HWS priority band setup request / response */
58662306a36Sopenharmony_cistruct vpu_ipc_msg_payload_hws_priority_band_setup {
58762306a36Sopenharmony_ci	/*
58862306a36Sopenharmony_ci	 * Grace period in 100ns units when preempting another priority band for
58962306a36Sopenharmony_ci	 * this priority band
59062306a36Sopenharmony_ci	 */
59162306a36Sopenharmony_ci	u32 grace_period[VPU_HWS_NUM_PRIORITY_BANDS];
59262306a36Sopenharmony_ci	/*
59362306a36Sopenharmony_ci	 * Default quantum in 100ns units for scheduling across processes
59462306a36Sopenharmony_ci	 * within a priority band
59562306a36Sopenharmony_ci	 */
59662306a36Sopenharmony_ci	u64 process_quantum[VPU_HWS_NUM_PRIORITY_BANDS];
59762306a36Sopenharmony_ci	/*
59862306a36Sopenharmony_ci	 * Default grace period in 100ns units for processes that preempt each
59962306a36Sopenharmony_ci	 * other within a priority band
60062306a36Sopenharmony_ci	 */
60162306a36Sopenharmony_ci	u64 process_grace_period[VPU_HWS_NUM_PRIORITY_BANDS];
60262306a36Sopenharmony_ci	/*
60362306a36Sopenharmony_ci	 * For normal priority band, specifies the target VPU percentage
60462306a36Sopenharmony_ci	 * in situations when it's starved by the focus band.
60562306a36Sopenharmony_ci	 */
60662306a36Sopenharmony_ci	u32 normal_band_percentage;
60762306a36Sopenharmony_ci	/* Reserved */
60862306a36Sopenharmony_ci	u32 reserved_0;
60962306a36Sopenharmony_ci};
61062306a36Sopenharmony_ci
61162306a36Sopenharmony_ci/* HWS create command queue request */
61262306a36Sopenharmony_cistruct vpu_ipc_msg_payload_hws_create_cmdq {
61362306a36Sopenharmony_ci	/* Process id */
61462306a36Sopenharmony_ci	u64 process_id;
61562306a36Sopenharmony_ci	/* Host SSID */
61662306a36Sopenharmony_ci	u32 host_ssid;
61762306a36Sopenharmony_ci	/* Zero Padding */
61862306a36Sopenharmony_ci	u32 reserved;
61962306a36Sopenharmony_ci	/* Command queue id */
62062306a36Sopenharmony_ci	u64 cmdq_id;
62162306a36Sopenharmony_ci	/* Command queue base */
62262306a36Sopenharmony_ci	u64 cmdq_base;
62362306a36Sopenharmony_ci	/* Command queue size */
62462306a36Sopenharmony_ci	u32 cmdq_size;
62562306a36Sopenharmony_ci	/* Reserved */
62662306a36Sopenharmony_ci	u32 reserved_0;
62762306a36Sopenharmony_ci};
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_ci/* HWS create command queue response */
63062306a36Sopenharmony_cistruct vpu_ipc_msg_payload_hws_create_cmdq_rsp {
63162306a36Sopenharmony_ci	/* Process id */
63262306a36Sopenharmony_ci	u64 process_id;
63362306a36Sopenharmony_ci	/* Host SSID */
63462306a36Sopenharmony_ci	u32 host_ssid;
63562306a36Sopenharmony_ci	/* Zero Padding */
63662306a36Sopenharmony_ci	u32 reserved;
63762306a36Sopenharmony_ci	/* Command queue id */
63862306a36Sopenharmony_ci	u64 cmdq_id;
63962306a36Sopenharmony_ci};
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_ci/* HWS destroy command queue request / response */
64262306a36Sopenharmony_cistruct vpu_ipc_msg_payload_hws_destroy_cmdq {
64362306a36Sopenharmony_ci	/* Host SSID */
64462306a36Sopenharmony_ci	u32 host_ssid;
64562306a36Sopenharmony_ci	/* Zero Padding */
64662306a36Sopenharmony_ci	u32 reserved;
64762306a36Sopenharmony_ci	/* Command queue id */
64862306a36Sopenharmony_ci	u64 cmdq_id;
64962306a36Sopenharmony_ci};
65062306a36Sopenharmony_ci
65162306a36Sopenharmony_ci/* HWS set context scheduling properties request / response */
65262306a36Sopenharmony_cistruct vpu_ipc_msg_payload_hws_set_context_sched_properties {
65362306a36Sopenharmony_ci	/* Host SSID */
65462306a36Sopenharmony_ci	u32 host_ssid;
65562306a36Sopenharmony_ci	/* Zero Padding */
65662306a36Sopenharmony_ci	u32 reserved_0;
65762306a36Sopenharmony_ci	/* Command queue id */
65862306a36Sopenharmony_ci	u64 cmdq_id;
65962306a36Sopenharmony_ci	/* Priority band to assign to work of this context */
66062306a36Sopenharmony_ci	u32 priority_band;
66162306a36Sopenharmony_ci	/* Inside realtime band assigns a further priority */
66262306a36Sopenharmony_ci	u32 realtime_priority_level;
66362306a36Sopenharmony_ci	/* Priority relative to other contexts in the same process */
66462306a36Sopenharmony_ci	u32 in_process_priority;
66562306a36Sopenharmony_ci	/* Zero padding / Reserved */
66662306a36Sopenharmony_ci	u32 reserved_1;
66762306a36Sopenharmony_ci	/* Context quantum relative to other contexts of same priority in the same process */
66862306a36Sopenharmony_ci	u64 context_quantum;
66962306a36Sopenharmony_ci	/* Grace period when preempting context of the same priority within the same process */
67062306a36Sopenharmony_ci	u64 grace_period_same_priority;
67162306a36Sopenharmony_ci	/* Grace period when preempting context of a lower priority within the same process */
67262306a36Sopenharmony_ci	u64 grace_period_lower_priority;
67362306a36Sopenharmony_ci};
67462306a36Sopenharmony_ci
67562306a36Sopenharmony_ci/*
67662306a36Sopenharmony_ci * @brief Register doorbell command structure.
67762306a36Sopenharmony_ci * This structure supports doorbell registration for both HW and OS scheduling.
67862306a36Sopenharmony_ci * Note: Queue base and size are added here so that the same structure can be used for
67962306a36Sopenharmony_ci * OS scheduling and HW scheduling. For OS scheduling, cmdq_id will be ignored
68062306a36Sopenharmony_ci * and cmdq_base and cmdq_size will be used. For HW scheduling, cmdq_base and cmdq_size will be
68162306a36Sopenharmony_ci * ignored and cmdq_id is used.
68262306a36Sopenharmony_ci * @see VPU_JSM_MSG_HWS_REGISTER_DB
68362306a36Sopenharmony_ci */
68462306a36Sopenharmony_cistruct vpu_jsm_hws_register_db {
68562306a36Sopenharmony_ci	/* Index of the doorbell to register. */
68662306a36Sopenharmony_ci	u32 db_id;
68762306a36Sopenharmony_ci	/* Host sub-stream ID for the context assigned to the doorbell. */
68862306a36Sopenharmony_ci	u32 host_ssid;
68962306a36Sopenharmony_ci	/* ID of the command queue associated with the doorbell. */
69062306a36Sopenharmony_ci	u64 cmdq_id;
69162306a36Sopenharmony_ci	/* Virtual address pointing to the start of command queue. */
69262306a36Sopenharmony_ci	u64 cmdq_base;
69362306a36Sopenharmony_ci	/* Size of the command queue in bytes. */
69462306a36Sopenharmony_ci	u64 cmdq_size;
69562306a36Sopenharmony_ci};
69662306a36Sopenharmony_ci
69762306a36Sopenharmony_ci/**
69862306a36Sopenharmony_ci * Payload for VPU_JSM_MSG_TRACE_SET_CONFIG[_RSP] and
69962306a36Sopenharmony_ci * VPU_JSM_MSG_TRACE_GET_CONFIG_RSP messages.
70062306a36Sopenharmony_ci *
70162306a36Sopenharmony_ci * The payload is interpreted differently depending on the type of message:
70262306a36Sopenharmony_ci *
70362306a36Sopenharmony_ci * - For VPU_JSM_MSG_TRACE_SET_CONFIG, the payload specifies the desired
70462306a36Sopenharmony_ci *   logging configuration to be set.
70562306a36Sopenharmony_ci *
70662306a36Sopenharmony_ci * - For VPU_JSM_MSG_TRACE_SET_CONFIG_RSP, the payload reports the logging
70762306a36Sopenharmony_ci *   configuration that was set after a VPU_JSM_MSG_TRACE_SET_CONFIG request.
70862306a36Sopenharmony_ci *   The host can compare this payload with the one it sent in the
70962306a36Sopenharmony_ci *   VPU_JSM_MSG_TRACE_SET_CONFIG request to check whether or not the
71062306a36Sopenharmony_ci *   configuration was set as desired.
71162306a36Sopenharmony_ci *
71262306a36Sopenharmony_ci * - VPU_JSM_MSG_TRACE_GET_CONFIG_RSP, the payload reports the current logging
71362306a36Sopenharmony_ci *   configuration.
71462306a36Sopenharmony_ci */
71562306a36Sopenharmony_cistruct vpu_ipc_msg_payload_trace_config {
71662306a36Sopenharmony_ci	/**
71762306a36Sopenharmony_ci	 * Logging level (currently set or to be set); see 'mvLog_t' enum for
71862306a36Sopenharmony_ci	 * acceptable values. The specified logging level applies to all
71962306a36Sopenharmony_ci	 * destinations and HW components
72062306a36Sopenharmony_ci	 */
72162306a36Sopenharmony_ci	u32 trace_level;
72262306a36Sopenharmony_ci	/**
72362306a36Sopenharmony_ci	 * Bitmask of logging destinations (currently enabled or to be enabled);
72462306a36Sopenharmony_ci	 * bitwise OR of values defined in logging_destination enum.
72562306a36Sopenharmony_ci	 */
72662306a36Sopenharmony_ci	u32 trace_destination_mask;
72762306a36Sopenharmony_ci	/**
72862306a36Sopenharmony_ci	 * Bitmask of loggable HW components (currently enabled or to be enabled);
72962306a36Sopenharmony_ci	 * bitwise OR of values defined in loggable_hw_component enum.
73062306a36Sopenharmony_ci	 */
73162306a36Sopenharmony_ci	u64 trace_hw_component_mask;
73262306a36Sopenharmony_ci	u64 reserved_0; /**< Reserved for future extensions. */
73362306a36Sopenharmony_ci};
73462306a36Sopenharmony_ci
73562306a36Sopenharmony_ci/**
73662306a36Sopenharmony_ci * Payload for VPU_JSM_MSG_TRACE_GET_CAPABILITY_RSP messages.
73762306a36Sopenharmony_ci */
73862306a36Sopenharmony_cistruct vpu_ipc_msg_payload_trace_capability_rsp {
73962306a36Sopenharmony_ci	u32 trace_destination_mask; /**< Bitmask of supported logging destinations. */
74062306a36Sopenharmony_ci	u32 reserved_0;
74162306a36Sopenharmony_ci	u64 trace_hw_component_mask; /**< Bitmask of supported loggable HW components. */
74262306a36Sopenharmony_ci	u64 reserved_1; /**< Reserved for future extensions. */
74362306a36Sopenharmony_ci};
74462306a36Sopenharmony_ci
74562306a36Sopenharmony_ci/**
74662306a36Sopenharmony_ci * Payload for VPU_JSM_MSG_TRACE_GET_NAME requests.
74762306a36Sopenharmony_ci */
74862306a36Sopenharmony_cistruct vpu_ipc_msg_payload_trace_get_name {
74962306a36Sopenharmony_ci	/**
75062306a36Sopenharmony_ci	 * The type of the entity to query name for; see logging_entity_type for
75162306a36Sopenharmony_ci	 * possible values.
75262306a36Sopenharmony_ci	 */
75362306a36Sopenharmony_ci	u32 entity_type;
75462306a36Sopenharmony_ci	u32 reserved_0;
75562306a36Sopenharmony_ci	/**
75662306a36Sopenharmony_ci	 * The ID of the entity to query name for; possible values depends on the
75762306a36Sopenharmony_ci	 * entity type.
75862306a36Sopenharmony_ci	 */
75962306a36Sopenharmony_ci	u64 entity_id;
76062306a36Sopenharmony_ci};
76162306a36Sopenharmony_ci
76262306a36Sopenharmony_ci/**
76362306a36Sopenharmony_ci * Payload for VPU_JSM_MSG_TRACE_GET_NAME_RSP responses.
76462306a36Sopenharmony_ci */
76562306a36Sopenharmony_cistruct vpu_ipc_msg_payload_trace_get_name_rsp {
76662306a36Sopenharmony_ci	/**
76762306a36Sopenharmony_ci	 * The type of the entity whose name was queried; see logging_entity_type
76862306a36Sopenharmony_ci	 * for possible values.
76962306a36Sopenharmony_ci	 */
77062306a36Sopenharmony_ci	u32 entity_type;
77162306a36Sopenharmony_ci	u32 reserved_0;
77262306a36Sopenharmony_ci	/**
77362306a36Sopenharmony_ci	 * The ID of the entity whose name was queried; possible values depends on
77462306a36Sopenharmony_ci	 * the entity type.
77562306a36Sopenharmony_ci	 */
77662306a36Sopenharmony_ci	u64 entity_id;
77762306a36Sopenharmony_ci	/** Reserved for future extensions. */
77862306a36Sopenharmony_ci	u64 reserved_1;
77962306a36Sopenharmony_ci	/** The name of the entity. */
78062306a36Sopenharmony_ci	char entity_name[VPU_TRACE_ENTITY_NAME_MAX_LEN];
78162306a36Sopenharmony_ci};
78262306a36Sopenharmony_ci
78362306a36Sopenharmony_ci/**
78462306a36Sopenharmony_ci * Data sent from the VPU to the host in all metric streamer response messages
78562306a36Sopenharmony_ci * and in asynchronous notification.
78662306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_START_DONE
78762306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_STOP_DONE
78862306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_UPDATE_DONE
78962306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_INFO_DONE
79062306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_NOTIFICATION
79162306a36Sopenharmony_ci */
79262306a36Sopenharmony_cistruct vpu_jsm_metric_streamer_done {
79362306a36Sopenharmony_ci	/** Metric group mask that identifies metric streamer instance. */
79462306a36Sopenharmony_ci	u64 metric_group_mask;
79562306a36Sopenharmony_ci	/**
79662306a36Sopenharmony_ci	 * Size in bytes of single sample - total size of all enabled counters.
79762306a36Sopenharmony_ci	 * Some VPU implementations may align sample_size to more than 8 bytes.
79862306a36Sopenharmony_ci	 */
79962306a36Sopenharmony_ci	u32 sample_size;
80062306a36Sopenharmony_ci	u32 reserved_0;
80162306a36Sopenharmony_ci	/**
80262306a36Sopenharmony_ci	 * Number of samples collected since the metric streamer was started.
80362306a36Sopenharmony_ci	 * This will be 0 if the metric streamer was not started.
80462306a36Sopenharmony_ci	 */
80562306a36Sopenharmony_ci	u32 samples_collected;
80662306a36Sopenharmony_ci	/**
80762306a36Sopenharmony_ci	 * Number of samples dropped since the metric streamer was started. This
80862306a36Sopenharmony_ci	 * is incremented every time the metric streamer is not able to write
80962306a36Sopenharmony_ci	 * collected samples because the current buffer is full and there is no
81062306a36Sopenharmony_ci	 * next buffer to switch to.
81162306a36Sopenharmony_ci	 */
81262306a36Sopenharmony_ci	u32 samples_dropped;
81362306a36Sopenharmony_ci	/** Address of the buffer that contains the latest metric data. */
81462306a36Sopenharmony_ci	u64 buffer_addr;
81562306a36Sopenharmony_ci	/**
81662306a36Sopenharmony_ci	 * Number of bytes written into the metric data buffer. In response to the
81762306a36Sopenharmony_ci	 * VPU_JSM_MSG_METRIC_STREAMER_INFO request this field contains the size of
81862306a36Sopenharmony_ci	 * all group and counter descriptors. The size is updated even if the buffer
81962306a36Sopenharmony_ci	 * in the request was NULL or too small to hold descriptors of all counters
82062306a36Sopenharmony_ci	 */
82162306a36Sopenharmony_ci	u64 bytes_written;
82262306a36Sopenharmony_ci};
82362306a36Sopenharmony_ci
82462306a36Sopenharmony_ci/**
82562306a36Sopenharmony_ci * Metric group description placed in the metric buffer after successful completion
82662306a36Sopenharmony_ci * of the VPU_JSM_MSG_METRIC_STREAMER_INFO command. This is followed by one or more
82762306a36Sopenharmony_ci * @vpu_jsm_metric_counter_descriptor records.
82862306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_INFO
82962306a36Sopenharmony_ci */
83062306a36Sopenharmony_cistruct vpu_jsm_metric_group_descriptor {
83162306a36Sopenharmony_ci	/**
83262306a36Sopenharmony_ci	 * Offset to the next metric group (8-byte aligned). If this offset is 0 this
83362306a36Sopenharmony_ci	 * is the last descriptor. The value of metric_info_size must be greater than
83462306a36Sopenharmony_ci	 * or equal to sizeof(struct vpu_jsm_metric_group_descriptor) + name_string_size
83562306a36Sopenharmony_ci	 * + description_string_size and must be 8-byte aligned.
83662306a36Sopenharmony_ci	 */
83762306a36Sopenharmony_ci	u32 next_metric_group_info_offset;
83862306a36Sopenharmony_ci	/**
83962306a36Sopenharmony_ci	 * Offset to the first metric counter description record (8-byte aligned).
84062306a36Sopenharmony_ci	 * @see vpu_jsm_metric_counter_descriptor
84162306a36Sopenharmony_ci	 */
84262306a36Sopenharmony_ci	u32 next_metric_counter_info_offset;
84362306a36Sopenharmony_ci	/** Index of the group. This corresponds to bit index in metric_group_mask. */
84462306a36Sopenharmony_ci	u32 group_id;
84562306a36Sopenharmony_ci	/** Number of counters in the metric group. */
84662306a36Sopenharmony_ci	u32 num_counters;
84762306a36Sopenharmony_ci	/** Data size for all counters, must be a multiple of 8 bytes.*/
84862306a36Sopenharmony_ci	u32 metric_group_data_size;
84962306a36Sopenharmony_ci	/**
85062306a36Sopenharmony_ci	 * Metric group domain number. Cannot use multiple, simultaneous metric groups
85162306a36Sopenharmony_ci	 * from the same domain.
85262306a36Sopenharmony_ci	 */
85362306a36Sopenharmony_ci	u32 domain;
85462306a36Sopenharmony_ci	/**
85562306a36Sopenharmony_ci	 * Counter name string size. The string must include a null termination character.
85662306a36Sopenharmony_ci	 * The FW may use a fixed size name or send a different name for each counter.
85762306a36Sopenharmony_ci	 * If the VPU uses fixed size strings, all characters from the end of the name
85862306a36Sopenharmony_ci	 * to the of the fixed size character array must be zeroed.
85962306a36Sopenharmony_ci	 */
86062306a36Sopenharmony_ci	u32 name_string_size;
86162306a36Sopenharmony_ci	/** Counter description string size, @see name_string_size */
86262306a36Sopenharmony_ci	u32 description_string_size;
86362306a36Sopenharmony_ci	u64 reserved_0;
86462306a36Sopenharmony_ci	/**
86562306a36Sopenharmony_ci	 * Right after this structure, the VPU writes name and description of
86662306a36Sopenharmony_ci	 * the metric group.
86762306a36Sopenharmony_ci	 */
86862306a36Sopenharmony_ci};
86962306a36Sopenharmony_ci
87062306a36Sopenharmony_ci/**
87162306a36Sopenharmony_ci * Metric counter description, placed in the buffer after vpu_jsm_metric_group_descriptor.
87262306a36Sopenharmony_ci * @see VPU_JSM_MSG_METRIC_STREAMER_INFO
87362306a36Sopenharmony_ci */
87462306a36Sopenharmony_cistruct vpu_jsm_metric_counter_descriptor {
87562306a36Sopenharmony_ci	/**
87662306a36Sopenharmony_ci	 * Offset to the next counter in a group (8-byte aligned). If this offset is
87762306a36Sopenharmony_ci	 * 0 this is the last counter in the group.
87862306a36Sopenharmony_ci	 */
87962306a36Sopenharmony_ci	u32 next_metric_counter_info_offset;
88062306a36Sopenharmony_ci	/**
88162306a36Sopenharmony_ci	 * Offset to the counter data from the start of samples in this metric group.
88262306a36Sopenharmony_ci	 * Note that metric_data_offset % metric_data_size must be 0.
88362306a36Sopenharmony_ci	 */
88462306a36Sopenharmony_ci	u32 metric_data_offset;
88562306a36Sopenharmony_ci	/** Size of the metric counter data in bytes. */
88662306a36Sopenharmony_ci	u32 metric_data_size;
88762306a36Sopenharmony_ci	/** Metric type, see Level Zero API for definitions. */
88862306a36Sopenharmony_ci	u32 tier;
88962306a36Sopenharmony_ci	/** Metric type, see set_metric_type_t for definitions. */
89062306a36Sopenharmony_ci	u32 metric_type;
89162306a36Sopenharmony_ci	/** Metric type, see set_value_type_t for definitions. */
89262306a36Sopenharmony_ci	u32 metric_value_type;
89362306a36Sopenharmony_ci	/**
89462306a36Sopenharmony_ci	 * Counter name string size. The string must include a null termination character.
89562306a36Sopenharmony_ci	 * The FW may use a fixed size name or send a different name for each counter.
89662306a36Sopenharmony_ci	 * If the VPU uses fixed size strings, all characters from the end of the name
89762306a36Sopenharmony_ci	 * to the of the fixed size character array must be zeroed.
89862306a36Sopenharmony_ci	 */
89962306a36Sopenharmony_ci	u32 name_string_size;
90062306a36Sopenharmony_ci	/** Counter description string size, @see name_string_size */
90162306a36Sopenharmony_ci	u32 description_string_size;
90262306a36Sopenharmony_ci	/** Counter component name string size, @see name_string_size */
90362306a36Sopenharmony_ci	u32 component_string_size;
90462306a36Sopenharmony_ci	/** Counter string size, @see name_string_size */
90562306a36Sopenharmony_ci	u32 units_string_size;
90662306a36Sopenharmony_ci	u64 reserved_0;
90762306a36Sopenharmony_ci	/**
90862306a36Sopenharmony_ci	 * Right after this structure, the VPU writes name, description
90962306a36Sopenharmony_ci	 * component and unit strings.
91062306a36Sopenharmony_ci	 */
91162306a36Sopenharmony_ci};
91262306a36Sopenharmony_ci
91362306a36Sopenharmony_ci/**
91462306a36Sopenharmony_ci * Payload for VPU_JSM_MSG_DYNDBG_CONTROL requests.
91562306a36Sopenharmony_ci *
91662306a36Sopenharmony_ci * VPU_JSM_MSG_DYNDBG_CONTROL are used to control the VPU FW Dynamic Debug
91762306a36Sopenharmony_ci * feature, which allows developers to selectively enable / disable MVLOG_DEBUG
91862306a36Sopenharmony_ci * messages. This is equivalent to the Dynamic Debug functionality provided by
91962306a36Sopenharmony_ci * Linux
92062306a36Sopenharmony_ci * (https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html)
92162306a36Sopenharmony_ci * The host can control Dynamic Debug behavior by sending dyndbg commands, which
92262306a36Sopenharmony_ci * have the same syntax as Linux
92362306a36Sopenharmony_ci * dyndbg commands.
92462306a36Sopenharmony_ci *
92562306a36Sopenharmony_ci * NOTE: in order for MVLOG_DEBUG messages to be actually printed, the host
92662306a36Sopenharmony_ci * still has to set the logging level to MVLOG_DEBUG, using the
92762306a36Sopenharmony_ci * VPU_JSM_MSG_TRACE_SET_CONFIG command.
92862306a36Sopenharmony_ci *
92962306a36Sopenharmony_ci * The host can see the current dynamic debug configuration by executing a
93062306a36Sopenharmony_ci * special 'show' command. The dyndbg configuration will be printed to the
93162306a36Sopenharmony_ci * configured logging destination using MVLOG_INFO logging level.
93262306a36Sopenharmony_ci */
93362306a36Sopenharmony_cistruct vpu_ipc_msg_payload_dyndbg_control {
93462306a36Sopenharmony_ci	/**
93562306a36Sopenharmony_ci	 * Dyndbg command (same format as Linux dyndbg); must be a NULL-terminated
93662306a36Sopenharmony_ci	 * string.
93762306a36Sopenharmony_ci	 */
93862306a36Sopenharmony_ci	char dyndbg_cmd[VPU_DYNDBG_CMD_MAX_LEN];
93962306a36Sopenharmony_ci};
94062306a36Sopenharmony_ci
94162306a36Sopenharmony_ci/*
94262306a36Sopenharmony_ci * Payloads union, used to define complete message format.
94362306a36Sopenharmony_ci */
94462306a36Sopenharmony_ciunion vpu_ipc_msg_payload {
94562306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_engine_reset engine_reset;
94662306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_engine_preempt engine_preempt;
94762306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_register_db register_db;
94862306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_unregister_db unregister_db;
94962306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_query_engine_hb query_engine_hb;
95062306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_power_level power_level;
95162306a36Sopenharmony_ci	struct vpu_jsm_metric_streamer_start metric_streamer_start;
95262306a36Sopenharmony_ci	struct vpu_jsm_metric_streamer_stop metric_streamer_stop;
95362306a36Sopenharmony_ci	struct vpu_jsm_metric_streamer_update metric_streamer_update;
95462306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_blob_deinit blob_deinit;
95562306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_ssid_release ssid_release;
95662306a36Sopenharmony_ci	struct vpu_jsm_hws_register_db hws_register_db;
95762306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_job_done job_done;
95862306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_engine_reset_done engine_reset_done;
95962306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_engine_preempt_done engine_preempt_done;
96062306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_register_db_done register_db_done;
96162306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_unregister_db_done unregister_db_done;
96262306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_query_engine_hb_done query_engine_hb_done;
96362306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_get_power_level_count_done get_power_level_count_done;
96462306a36Sopenharmony_ci	struct vpu_jsm_metric_streamer_done metric_streamer_done;
96562306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_blob_deinit_done blob_deinit_done;
96662306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_trace_config trace_config;
96762306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_trace_capability_rsp trace_capability;
96862306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_trace_get_name trace_get_name;
96962306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_trace_get_name_rsp trace_get_name_rsp;
97062306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_dyndbg_control dyndbg_control;
97162306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_hws_priority_band_setup hws_priority_band_setup;
97262306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_hws_create_cmdq hws_create_cmdq;
97362306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_hws_create_cmdq_rsp hws_create_cmdq_rsp;
97462306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_hws_destroy_cmdq hws_destroy_cmdq;
97562306a36Sopenharmony_ci	struct vpu_ipc_msg_payload_hws_set_context_sched_properties
97662306a36Sopenharmony_ci		hws_set_context_sched_properties;
97762306a36Sopenharmony_ci};
97862306a36Sopenharmony_ci
97962306a36Sopenharmony_ci/*
98062306a36Sopenharmony_ci * Host <-> LRT IPC message base structure.
98162306a36Sopenharmony_ci *
98262306a36Sopenharmony_ci * NOTE: All instances of this object must be aligned on a 64B boundary
98362306a36Sopenharmony_ci * to allow proper handling of VPU cache operations.
98462306a36Sopenharmony_ci */
98562306a36Sopenharmony_cistruct vpu_jsm_msg {
98662306a36Sopenharmony_ci	/* Reserved */
98762306a36Sopenharmony_ci	u64 reserved_0;
98862306a36Sopenharmony_ci	/* Message type, see vpu_ipc_msg_type enum. */
98962306a36Sopenharmony_ci	u32 type;
99062306a36Sopenharmony_ci	/* Buffer status, see vpu_ipc_msg_status enum. */
99162306a36Sopenharmony_ci	u32 status;
99262306a36Sopenharmony_ci	/*
99362306a36Sopenharmony_ci	 * Request ID, provided by the host in a request message and passed
99462306a36Sopenharmony_ci	 * back by VPU in the response message.
99562306a36Sopenharmony_ci	 */
99662306a36Sopenharmony_ci	u32 request_id;
99762306a36Sopenharmony_ci	/* Request return code set by the VPU, see VPU_JSM_STATUS_* defines. */
99862306a36Sopenharmony_ci	u32 result;
99962306a36Sopenharmony_ci	u64 reserved_1;
100062306a36Sopenharmony_ci	/* Message payload depending on message type, see vpu_ipc_msg_payload union. */
100162306a36Sopenharmony_ci	union vpu_ipc_msg_payload payload;
100262306a36Sopenharmony_ci};
100362306a36Sopenharmony_ci
100462306a36Sopenharmony_ci#pragma pack(pop)
100562306a36Sopenharmony_ci
100662306a36Sopenharmony_ci#endif
100762306a36Sopenharmony_ci
100862306a36Sopenharmony_ci///@}
1009