1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016 MediaTek Inc.
4 * Author: PC Chen <pc.chen@mediatek.com>
7 #ifndef _VDEC_IPI_MSG_H_
8 #define _VDEC_IPI_MSG_H_
11 * enum vdec_ipi_msgid - message id between AP and VPU
12 * @AP_IPIMSG_XXX : AP to VPU cmd message id
13 * @VPU_IPIMSG_XXX_ACK : VPU ack AP cmd message id
16 AP_IPIMSG_DEC_INIT = 0xA000,
17 AP_IPIMSG_DEC_START = 0xA001,
18 AP_IPIMSG_DEC_END = 0xA002,
19 AP_IPIMSG_DEC_DEINIT = 0xA003,
20 AP_IPIMSG_DEC_RESET = 0xA004,
21 AP_IPIMSG_DEC_CORE = 0xA005,
22 AP_IPIMSG_DEC_CORE_END = 0xA006,
23 AP_IPIMSG_DEC_GET_PARAM = 0xA007,
25 VPU_IPIMSG_DEC_INIT_ACK = 0xB000,
26 VPU_IPIMSG_DEC_START_ACK = 0xB001,
27 VPU_IPIMSG_DEC_END_ACK = 0xB002,
28 VPU_IPIMSG_DEC_DEINIT_ACK = 0xB003,
29 VPU_IPIMSG_DEC_RESET_ACK = 0xB004,
30 VPU_IPIMSG_DEC_CORE_ACK = 0xB005,
31 VPU_IPIMSG_DEC_CORE_END_ACK = 0xB006,
32 VPU_IPIMSG_DEC_GET_PARAM_ACK = 0xB007,
36 * struct vdec_ap_ipi_cmd - generic AP to VPU ipi command format
37 * @msg_id : vdec_ipi_msgid
38 * @vpu_inst_addr : VPU decoder instance address. Used if ABI version < 2.
39 * @inst_id : instance ID. Used if the ABI version >= 2.
40 * @codec_type : codec fourcc
41 * @reserved : reserved param
43 struct vdec_ap_ipi_cmd {
46 uint32_t vpu_inst_addr;
54 * struct vdec_vpu_ipi_ack - generic VPU to AP ipi command format
55 * @msg_id : vdec_ipi_msgid
56 * @status : VPU exeuction result
57 * @ap_inst_addr : AP video decoder instance address
59 struct vdec_vpu_ipi_ack {
62 uint64_t ap_inst_addr;
66 * struct vdec_ap_ipi_init - for AP_IPIMSG_DEC_INIT
67 * @msg_id : AP_IPIMSG_DEC_INIT
68 * @codec_type : codec fourcc
69 * @ap_inst_addr : AP video decoder instance address
71 struct vdec_ap_ipi_init {
74 uint64_t ap_inst_addr;
78 * struct vdec_ap_ipi_dec_start - for AP_IPIMSG_DEC_START
79 * @msg_id : AP_IPIMSG_DEC_START
80 * @vpu_inst_addr : VPU decoder instance address. Used if ABI version < 2.
81 * @inst_id : instance ID. Used if the ABI version >= 2.
83 * H264 decoder [0]:buf_sz [1]:nal_start
84 * VP8 decoder [0]:width/height
85 * VP9 decoder [0]:profile, [1][2] width/height
86 * @codec_type : codec fourcc
88 struct vdec_ap_ipi_dec_start {
91 uint32_t vpu_inst_addr;
99 * struct vdec_vpu_ipi_init_ack - for VPU_IPIMSG_DEC_INIT_ACK
100 * @msg_id : VPU_IPIMSG_DEC_INIT_ACK
101 * @status : VPU exeuction result
102 * @ap_inst_addr : AP vcodec_vpu_inst instance address
103 * @vpu_inst_addr : VPU decoder instance address
104 * @vdec_abi_version: ABI version of the firmware. Kernel can use it to
105 * ensure that it is compatible with the firmware.
106 * This field is not valid for MT8173 and must not be
107 * accessed for this chip.
108 * @inst_id : instance ID. Valid only if the ABI version >= 2.
110 struct vdec_vpu_ipi_init_ack {
113 uint64_t ap_inst_addr;
114 uint32_t vpu_inst_addr;
115 uint32_t vdec_abi_version;
120 * struct vdec_ap_ipi_get_param - for AP_IPIMSG_DEC_GET_PARAM
121 * @msg_id : AP_IPIMSG_DEC_GET_PARAM
122 * @inst_id : instance ID. Used if the ABI version >= 2.
123 * @data : picture information
124 * @param_type : get param type
125 * @codec_type : Codec fourcc
127 struct vdec_ap_ipi_get_param {
136 * struct vdec_vpu_ipi_get_param_ack - for VPU_IPIMSG_DEC_GET_PARAM_ACK
137 * @msg_id : VPU_IPIMSG_DEC_GET_PARAM_ACK
138 * @status : VPU execution result
139 * @ap_inst_addr : AP vcodec_vpu_inst instance address
140 * @data : picture information from SCP.
141 * @param_type : get param type
142 * @reserved : reserved param
144 struct vdec_vpu_ipi_get_param_ack {