1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (c) 2016 MediaTek Inc. 4 * Author: PC Chen <pc.chen@mediatek.com> 5 */ 6 7#ifndef _VDEC_IPI_MSG_H_ 8#define _VDEC_IPI_MSG_H_ 9 10/** 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 14 */ 15enum vdec_ipi_msgid { 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 22 VPU_IPIMSG_DEC_INIT_ACK = 0xB000, 23 VPU_IPIMSG_DEC_START_ACK = 0xB001, 24 VPU_IPIMSG_DEC_END_ACK = 0xB002, 25 VPU_IPIMSG_DEC_DEINIT_ACK = 0xB003, 26 VPU_IPIMSG_DEC_RESET_ACK = 0xB004, 27}; 28 29/** 30 * struct vdec_ap_ipi_cmd - generic AP to VPU ipi command format 31 * @msg_id : vdec_ipi_msgid 32 * @vpu_inst_addr : VPU decoder instance address 33 */ 34struct vdec_ap_ipi_cmd { 35 uint32_t msg_id; 36 uint32_t vpu_inst_addr; 37}; 38 39/** 40 * struct vdec_vpu_ipi_ack - generic VPU to AP ipi command format 41 * @msg_id : vdec_ipi_msgid 42 * @status : VPU exeuction result 43 * @ap_inst_addr : AP video decoder instance address 44 */ 45struct vdec_vpu_ipi_ack { 46 uint32_t msg_id; 47 int32_t status; 48 uint64_t ap_inst_addr; 49}; 50 51/** 52 * struct vdec_ap_ipi_init - for AP_IPIMSG_DEC_INIT 53 * @msg_id : AP_IPIMSG_DEC_INIT 54 * @reserved : Reserved field 55 * @ap_inst_addr : AP video decoder instance address 56 */ 57struct vdec_ap_ipi_init { 58 uint32_t msg_id; 59 uint32_t reserved; 60 uint64_t ap_inst_addr; 61}; 62 63/** 64 * struct vdec_ap_ipi_dec_start - for AP_IPIMSG_DEC_START 65 * @msg_id : AP_IPIMSG_DEC_START 66 * @vpu_inst_addr : VPU decoder instance address 67 * @data : Header info 68 * H264 decoder [0]:buf_sz [1]:nal_start 69 * VP8 decoder [0]:width/height 70 * VP9 decoder [0]:profile, [1][2] width/height 71 * @reserved : Reserved field 72 */ 73struct vdec_ap_ipi_dec_start { 74 uint32_t msg_id; 75 uint32_t vpu_inst_addr; 76 uint32_t data[3]; 77 uint32_t reserved; 78}; 79 80/** 81 * struct vdec_vpu_ipi_init_ack - for VPU_IPIMSG_DEC_INIT_ACK 82 * @msg_id : VPU_IPIMSG_DEC_INIT_ACK 83 * @status : VPU exeuction result 84 * @ap_inst_addr : AP vcodec_vpu_inst instance address 85 * @vpu_inst_addr : VPU decoder instance address 86 */ 87struct vdec_vpu_ipi_init_ack { 88 uint32_t msg_id; 89 int32_t status; 90 uint64_t ap_inst_addr; 91 uint32_t vpu_inst_addr; 92}; 93 94#endif 95