1*02a8b425SSebastian Fricke /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*02a8b425SSebastian Fricke /* 3*02a8b425SSebastian Fricke * linux/drivers/media/platform/chips-media/coda_regs.h 4*02a8b425SSebastian Fricke * 5*02a8b425SSebastian Fricke * Copyright (C) 2012 Vista Silicon SL 6*02a8b425SSebastian Fricke * Javier Martin <javier.martin@vista-silicon.com> 7*02a8b425SSebastian Fricke * Xavier Duret 8*02a8b425SSebastian Fricke */ 9*02a8b425SSebastian Fricke 10*02a8b425SSebastian Fricke #ifndef _REGS_CODA_H_ 11*02a8b425SSebastian Fricke #define _REGS_CODA_H_ 12*02a8b425SSebastian Fricke 13*02a8b425SSebastian Fricke /* HW registers */ 14*02a8b425SSebastian Fricke #define CODA_REG_BIT_CODE_RUN 0x000 15*02a8b425SSebastian Fricke #define CODA_REG_RUN_ENABLE (1 << 0) 16*02a8b425SSebastian Fricke #define CODA_REG_BIT_CODE_DOWN 0x004 17*02a8b425SSebastian Fricke #define CODA_DOWN_ADDRESS_SET(x) (((x) & 0xffff) << 16) 18*02a8b425SSebastian Fricke #define CODA_DOWN_DATA_SET(x) ((x) & 0xffff) 19*02a8b425SSebastian Fricke #define CODA_REG_BIT_HOST_IN_REQ 0x008 20*02a8b425SSebastian Fricke #define CODA_REG_BIT_INT_CLEAR 0x00c 21*02a8b425SSebastian Fricke #define CODA_REG_BIT_INT_CLEAR_SET 0x1 22*02a8b425SSebastian Fricke #define CODA_REG_BIT_INT_STATUS 0x010 23*02a8b425SSebastian Fricke #define CODA_REG_BIT_CODE_RESET 0x014 24*02a8b425SSebastian Fricke #define CODA_REG_RESET_ENABLE (1 << 0) 25*02a8b425SSebastian Fricke #define CODA_REG_BIT_CUR_PC 0x018 26*02a8b425SSebastian Fricke #define CODA9_REG_BIT_SW_RESET 0x024 27*02a8b425SSebastian Fricke #define CODA9_SW_RESET_BPU_CORE 0x008 28*02a8b425SSebastian Fricke #define CODA9_SW_RESET_BPU_BUS 0x010 29*02a8b425SSebastian Fricke #define CODA9_SW_RESET_VCE_CORE 0x020 30*02a8b425SSebastian Fricke #define CODA9_SW_RESET_VCE_BUS 0x040 31*02a8b425SSebastian Fricke #define CODA9_SW_RESET_GDI_CORE 0x080 32*02a8b425SSebastian Fricke #define CODA9_SW_RESET_GDI_BUS 0x100 33*02a8b425SSebastian Fricke #define CODA9_REG_BIT_SW_RESET_STATUS 0x034 34*02a8b425SSebastian Fricke 35*02a8b425SSebastian Fricke /* Static SW registers */ 36*02a8b425SSebastian Fricke #define CODA_REG_BIT_CODE_BUF_ADDR 0x100 37*02a8b425SSebastian Fricke #define CODA_REG_BIT_WORK_BUF_ADDR 0x104 38*02a8b425SSebastian Fricke #define CODA_REG_BIT_PARA_BUF_ADDR 0x108 39*02a8b425SSebastian Fricke #define CODA_REG_BIT_STREAM_CTRL 0x10c 40*02a8b425SSebastian Fricke #define CODA7_STREAM_BUF_PIC_RESET (1 << 4) 41*02a8b425SSebastian Fricke #define CODADX6_STREAM_BUF_PIC_RESET (1 << 3) 42*02a8b425SSebastian Fricke #define CODA7_STREAM_BUF_PIC_FLUSH (1 << 3) 43*02a8b425SSebastian Fricke #define CODADX6_STREAM_BUF_PIC_FLUSH (1 << 2) 44*02a8b425SSebastian Fricke #define CODA7_STREAM_BUF_DYNALLOC_EN (1 << 5) 45*02a8b425SSebastian Fricke #define CODADX6_STREAM_BUF_DYNALLOC_EN (1 << 4) 46*02a8b425SSebastian Fricke #define CODADX6_STREAM_CHKDIS_OFFSET (1 << 1) 47*02a8b425SSebastian Fricke #define CODA7_STREAM_SEL_64BITS_ENDIAN (1 << 1) 48*02a8b425SSebastian Fricke #define CODA_STREAM_ENDIAN_SELECT (1 << 0) 49*02a8b425SSebastian Fricke #define CODA_REG_BIT_FRAME_MEM_CTRL 0x110 50*02a8b425SSebastian Fricke #define CODA9_FRAME_ENABLE_BWB (1 << 12) 51*02a8b425SSebastian Fricke #define CODA9_FRAME_TILED2LINEAR (1 << 11) 52*02a8b425SSebastian Fricke #define CODA_FRAME_CHROMA_INTERLEAVE (1 << 2) 53*02a8b425SSebastian Fricke #define CODA_IMAGE_ENDIAN_SELECT (1 << 0) 54*02a8b425SSebastian Fricke #define CODA_REG_BIT_BIT_STREAM_PARAM 0x114 55*02a8b425SSebastian Fricke #define CODA_BIT_STREAM_END_FLAG (1 << 2) 56*02a8b425SSebastian Fricke #define CODA_BIT_DEC_SEQ_INIT_ESCAPE (1 << 0) 57*02a8b425SSebastian Fricke #define CODA_REG_BIT_TEMP_BUF_ADDR 0x118 58*02a8b425SSebastian Fricke #define CODA_REG_BIT_RD_PTR(x) (0x120 + 8 * (x)) 59*02a8b425SSebastian Fricke #define CODA_REG_BIT_WR_PTR(x) (0x124 + 8 * (x)) 60*02a8b425SSebastian Fricke #define CODA_REG_BIT_FRM_DIS_FLG(x) (0x150 + 4 * (x)) 61*02a8b425SSebastian Fricke #define CODADX6_REG_BIT_SEARCH_RAM_BASE_ADDR 0x140 62*02a8b425SSebastian Fricke #define CODA7_REG_BIT_AXI_SRAM_USE 0x140 63*02a8b425SSebastian Fricke #define CODA9_USE_HOST_BTP_ENABLE (1 << 13) 64*02a8b425SSebastian Fricke #define CODA9_USE_HOST_OVL_ENABLE (1 << 12) 65*02a8b425SSebastian Fricke #define CODA7_USE_HOST_ME_ENABLE (1 << 11) 66*02a8b425SSebastian Fricke #define CODA9_USE_HOST_DBK_ENABLE (3 << 10) 67*02a8b425SSebastian Fricke #define CODA7_USE_HOST_OVL_ENABLE (1 << 10) 68*02a8b425SSebastian Fricke #define CODA7_USE_HOST_DBK_ENABLE (1 << 9) 69*02a8b425SSebastian Fricke #define CODA9_USE_HOST_IP_ENABLE (1 << 9) 70*02a8b425SSebastian Fricke #define CODA7_USE_HOST_IP_ENABLE (1 << 8) 71*02a8b425SSebastian Fricke #define CODA9_USE_HOST_BIT_ENABLE (1 << 8) 72*02a8b425SSebastian Fricke #define CODA7_USE_HOST_BIT_ENABLE (1 << 7) 73*02a8b425SSebastian Fricke #define CODA9_USE_BTP_ENABLE (1 << 5) 74*02a8b425SSebastian Fricke #define CODA7_USE_ME_ENABLE (1 << 4) 75*02a8b425SSebastian Fricke #define CODA9_USE_OVL_ENABLE (1 << 4) 76*02a8b425SSebastian Fricke #define CODA7_USE_OVL_ENABLE (1 << 3) 77*02a8b425SSebastian Fricke #define CODA9_USE_DBK_ENABLE (3 << 2) 78*02a8b425SSebastian Fricke #define CODA7_USE_DBK_ENABLE (1 << 2) 79*02a8b425SSebastian Fricke #define CODA7_USE_IP_ENABLE (1 << 1) 80*02a8b425SSebastian Fricke #define CODA7_USE_BIT_ENABLE (1 << 0) 81*02a8b425SSebastian Fricke 82*02a8b425SSebastian Fricke #define CODA_REG_BIT_BUSY 0x160 83*02a8b425SSebastian Fricke #define CODA_REG_BIT_BUSY_FLAG 1 84*02a8b425SSebastian Fricke #define CODA_REG_BIT_RUN_COMMAND 0x164 85*02a8b425SSebastian Fricke #define CODA_COMMAND_SEQ_INIT 1 86*02a8b425SSebastian Fricke #define CODA_COMMAND_SEQ_END 2 87*02a8b425SSebastian Fricke #define CODA_COMMAND_PIC_RUN 3 88*02a8b425SSebastian Fricke #define CODA_COMMAND_SET_FRAME_BUF 4 89*02a8b425SSebastian Fricke #define CODA_COMMAND_ENCODE_HEADER 5 90*02a8b425SSebastian Fricke #define CODA_COMMAND_ENC_PARA_SET 6 91*02a8b425SSebastian Fricke #define CODA_COMMAND_DEC_PARA_SET 7 92*02a8b425SSebastian Fricke #define CODA_COMMAND_DEC_BUF_FLUSH 8 93*02a8b425SSebastian Fricke #define CODA_COMMAND_RC_CHANGE_PARAMETER 9 94*02a8b425SSebastian Fricke #define CODA_COMMAND_FIRMWARE_GET 0xf 95*02a8b425SSebastian Fricke #define CODA_REG_BIT_RUN_INDEX 0x168 96*02a8b425SSebastian Fricke #define CODA_INDEX_SET(x) ((x) & 0x3) 97*02a8b425SSebastian Fricke #define CODA_REG_BIT_RUN_COD_STD 0x16c 98*02a8b425SSebastian Fricke #define CODADX6_MODE_DECODE_MP4 0 99*02a8b425SSebastian Fricke #define CODADX6_MODE_ENCODE_MP4 1 100*02a8b425SSebastian Fricke #define CODADX6_MODE_DECODE_H264 2 101*02a8b425SSebastian Fricke #define CODADX6_MODE_ENCODE_H264 3 102*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_H264 0 103*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_VC1 1 104*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_MP2 2 105*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_MP4 3 106*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_DV3 3 107*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_RV 4 108*02a8b425SSebastian Fricke #define CODA7_MODE_DECODE_MJPG 5 109*02a8b425SSebastian Fricke #define CODA7_MODE_ENCODE_H264 8 110*02a8b425SSebastian Fricke #define CODA7_MODE_ENCODE_MP4 11 111*02a8b425SSebastian Fricke #define CODA7_MODE_ENCODE_MJPG 13 112*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_H264 0 113*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_VC1 1 114*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_MP2 2 115*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_MP4 3 116*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_DV3 3 117*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_RV 4 118*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_AVS 5 119*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_MJPG 6 120*02a8b425SSebastian Fricke #define CODA9_MODE_DECODE_VPX 7 121*02a8b425SSebastian Fricke #define CODA9_MODE_ENCODE_H264 8 122*02a8b425SSebastian Fricke #define CODA9_MODE_ENCODE_MP4 11 123*02a8b425SSebastian Fricke #define CODA9_MODE_ENCODE_MJPG 13 124*02a8b425SSebastian Fricke #define CODA_MODE_INVALID 0xffff 125*02a8b425SSebastian Fricke #define CODA_REG_BIT_INT_ENABLE 0x170 126*02a8b425SSebastian Fricke #define CODA_INT_INTERRUPT_ENABLE (1 << 3) 127*02a8b425SSebastian Fricke #define CODA_REG_BIT_INT_REASON 0x174 128*02a8b425SSebastian Fricke #define CODA7_REG_BIT_RUN_AUX_STD 0x178 129*02a8b425SSebastian Fricke #define CODA_MP4_AUX_MPEG4 0 130*02a8b425SSebastian Fricke #define CODA_MP4_AUX_DIVX3 1 131*02a8b425SSebastian Fricke #define CODA_VPX_AUX_THO 0 132*02a8b425SSebastian Fricke #define CODA_VPX_AUX_VP6 1 133*02a8b425SSebastian Fricke #define CODA_VPX_AUX_VP8 2 134*02a8b425SSebastian Fricke #define CODA_H264_AUX_AVC 0 135*02a8b425SSebastian Fricke #define CODA_H264_AUX_MVC 1 136*02a8b425SSebastian Fricke 137*02a8b425SSebastian Fricke /* 138*02a8b425SSebastian Fricke * Commands' mailbox: 139*02a8b425SSebastian Fricke * registers with offsets in the range 0x180-0x1d0 140*02a8b425SSebastian Fricke * have different meaning depending on the command being 141*02a8b425SSebastian Fricke * issued. 142*02a8b425SSebastian Fricke */ 143*02a8b425SSebastian Fricke 144*02a8b425SSebastian Fricke /* Decoder Sequence Initialization */ 145*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_BB_START 0x180 146*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_BB_SIZE 0x184 147*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_OPTION 0x188 148*02a8b425SSebastian Fricke #define CODA_NO_INT_ENABLE (1 << 10) 149*02a8b425SSebastian Fricke #define CODA_REORDER_ENABLE (1 << 1) 150*02a8b425SSebastian Fricke #define CODADX6_QP_REPORT (1 << 0) 151*02a8b425SSebastian Fricke #define CODA7_MP4_DEBLK_ENABLE (1 << 0) 152*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_SRC_SIZE 0x18c 153*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_START_BYTE 0x190 154*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_PS_BB_START 0x194 155*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_PS_BB_SIZE 0x198 156*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_JPG_THUMB_EN 0x19c 157*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_MP4_ASP_CLASS 0x19c 158*02a8b425SSebastian Fricke #define CODA_MP4_CLASS_MPEG4 0 159*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_X264_MV_EN 0x19c 160*02a8b425SSebastian Fricke #define CODA_CMD_DEC_SEQ_SPP_CHUNK_SIZE 0x1a0 161*02a8b425SSebastian Fricke 162*02a8b425SSebastian Fricke #define CODA7_RET_DEC_SEQ_ASPECT 0x1b0 163*02a8b425SSebastian Fricke #define CODA9_RET_DEC_SEQ_BITRATE 0x1b4 164*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_SUCCESS 0x1c0 165*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_SRC_FMT 0x1c4 /* SRC_SIZE on CODA7 */ 166*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_SRC_SIZE 0x1c4 167*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_SRC_F_RATE 0x1c8 168*02a8b425SSebastian Fricke #define CODA9_RET_DEC_SEQ_ASPECT 0x1c8 169*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_FRAME_NEED 0x1cc 170*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_FRAME_DELAY 0x1d0 171*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_INFO 0x1d4 172*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_CROP_LEFT_RIGHT 0x1d8 173*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_CROP_TOP_BOTTOM 0x1dc 174*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_NEXT_FRAME_NUM 0x1e0 175*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_ERR_REASON 0x1e0 176*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_FRATE_NR 0x1e4 177*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_FRATE_DR 0x1e8 178*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_JPG_PARA 0x1e4 179*02a8b425SSebastian Fricke #define CODA_RET_DEC_SEQ_JPG_THUMB_IND 0x1e8 180*02a8b425SSebastian Fricke #define CODA7_RET_DEC_SEQ_HEADER_REPORT 0x1ec 181*02a8b425SSebastian Fricke 182*02a8b425SSebastian Fricke /* Decoder Picture Run */ 183*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_ROT_MODE 0x180 184*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_ROT_ADDR_Y 0x184 185*02a8b425SSebastian Fricke #define CODA9_CMD_DEC_PIC_ROT_INDEX 0x184 186*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_ROT_ADDR_CB 0x188 187*02a8b425SSebastian Fricke #define CODA9_CMD_DEC_PIC_ROT_ADDR_Y 0x188 188*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_ROT_ADDR_CR 0x18c 189*02a8b425SSebastian Fricke #define CODA9_CMD_DEC_PIC_ROT_ADDR_CB 0x18c 190*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_ROT_STRIDE 0x190 191*02a8b425SSebastian Fricke #define CODA9_CMD_DEC_PIC_ROT_ADDR_CR 0x190 192*02a8b425SSebastian Fricke #define CODA9_CMD_DEC_PIC_ROT_STRIDE 0x1b8 193*02a8b425SSebastian Fricke 194*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_OPTION 0x194 195*02a8b425SSebastian Fricke #define CODA_PRE_SCAN_EN (1 << 0) 196*02a8b425SSebastian Fricke #define CODA_PRE_SCAN_MODE_DECODE (0 << 1) 197*02a8b425SSebastian Fricke #define CODA_PRE_SCAN_MODE_RETURN (1 << 1) 198*02a8b425SSebastian Fricke #define CODA_IFRAME_SEARCH_EN (1 << 2) 199*02a8b425SSebastian Fricke #define CODA_SKIP_FRAME_MODE (0x3 << 3) 200*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_SKIP_NUM 0x198 201*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_CHUNK_SIZE 0x19c 202*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_BB_START 0x1a0 203*02a8b425SSebastian Fricke #define CODA_CMD_DEC_PIC_START_BYTE 0x1a4 204*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_SIZE 0x1bc 205*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_FRAME_NUM 0x1c0 206*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_FRAME_IDX 0x1c4 207*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_ERR_MB 0x1c8 208*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_TYPE 0x1cc 209*02a8b425SSebastian Fricke #define CODA_PIC_TYPE_MASK 0x7 210*02a8b425SSebastian Fricke #define CODA_PIC_TYPE_MASK_VC1 0x3f 211*02a8b425SSebastian Fricke #define CODA9_PIC_TYPE_FIRST_MASK (0x7 << 3) 212*02a8b425SSebastian Fricke #define CODA9_PIC_TYPE_IDR_MASK (0x3 << 6) 213*02a8b425SSebastian Fricke #define CODA7_PIC_TYPE_H264_NPF_MASK (0x3 << 16) 214*02a8b425SSebastian Fricke #define CODA7_PIC_TYPE_INTERLACED (1 << 18) 215*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_POST 0x1d0 216*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_MVC_REPORT 0x1d0 217*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_OPTION 0x1d4 218*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_SUCCESS 0x1d8 219*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_CUR_IDX 0x1dc 220*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_CROP_LEFT_RIGHT 0x1e0 221*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_CROP_TOP_BOTTOM 0x1e4 222*02a8b425SSebastian Fricke #define CODA_RET_DEC_PIC_FRAME_NEED 0x1ec 223*02a8b425SSebastian Fricke 224*02a8b425SSebastian Fricke #define CODA9_RET_DEC_PIC_VP8_PIC_REPORT 0x1e8 225*02a8b425SSebastian Fricke #define CODA9_RET_DEC_PIC_ASPECT 0x1f0 226*02a8b425SSebastian Fricke #define CODA9_RET_DEC_PIC_VP8_SCALE_INFO 0x1f0 227*02a8b425SSebastian Fricke #define CODA9_RET_DEC_PIC_FRATE_NR 0x1f4 228*02a8b425SSebastian Fricke #define CODA9_RET_DEC_PIC_FRATE_DR 0x1f8 229*02a8b425SSebastian Fricke 230*02a8b425SSebastian Fricke /* Encoder Sequence Initialization */ 231*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_BB_START 0x180 232*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_BB_SIZE 0x184 233*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_OPTION 0x188 234*02a8b425SSebastian Fricke #define CODA7_OPTION_AVCINTRA16X16ONLY_OFFSET 9 235*02a8b425SSebastian Fricke #define CODA9_OPTION_MVC_PREFIX_NAL_OFFSET 9 236*02a8b425SSebastian Fricke #define CODA7_OPTION_GAMMA_OFFSET 8 237*02a8b425SSebastian Fricke #define CODA9_OPTION_MVC_PARASET_REFRESH_OFFSET 8 238*02a8b425SSebastian Fricke #define CODA7_OPTION_RCQPMAX_OFFSET 7 239*02a8b425SSebastian Fricke #define CODA9_OPTION_GAMMA_OFFSET 7 240*02a8b425SSebastian Fricke #define CODADX6_OPTION_GAMMA_OFFSET 7 241*02a8b425SSebastian Fricke #define CODA7_OPTION_RCQPMIN_OFFSET 6 242*02a8b425SSebastian Fricke #define CODA9_OPTION_RCQPMAX_OFFSET 6 243*02a8b425SSebastian Fricke #define CODA_OPTION_LIMITQP_OFFSET 6 244*02a8b425SSebastian Fricke #define CODA_OPTION_RCINTRAQP_OFFSET 5 245*02a8b425SSebastian Fricke #define CODA_OPTION_FMO_OFFSET 4 246*02a8b425SSebastian Fricke #define CODA9_OPTION_MVC_INTERVIEW_OFFSET 4 247*02a8b425SSebastian Fricke #define CODA_OPTION_AVC_AUD_OFFSET 2 248*02a8b425SSebastian Fricke #define CODA_OPTION_SLICEREPORT_OFFSET 1 249*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_COD_STD 0x18c 250*02a8b425SSebastian Fricke #define CODA_STD_MPEG4 0 251*02a8b425SSebastian Fricke #define CODA9_STD_H264 0 252*02a8b425SSebastian Fricke #define CODA_STD_H263 1 253*02a8b425SSebastian Fricke #define CODA_STD_H264 2 254*02a8b425SSebastian Fricke #define CODA9_STD_MPEG4 3 255*02a8b425SSebastian Fricke 256*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_SRC_SIZE 0x190 257*02a8b425SSebastian Fricke #define CODA7_PICWIDTH_OFFSET 16 258*02a8b425SSebastian Fricke #define CODA7_PICWIDTH_MASK 0xffff 259*02a8b425SSebastian Fricke #define CODADX6_PICWIDTH_OFFSET 10 260*02a8b425SSebastian Fricke #define CODADX6_PICWIDTH_MASK 0x3ff 261*02a8b425SSebastian Fricke #define CODA_PICHEIGHT_OFFSET 0 262*02a8b425SSebastian Fricke #define CODADX6_PICHEIGHT_MASK 0x3ff 263*02a8b425SSebastian Fricke #define CODA7_PICHEIGHT_MASK 0xffff 264*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_SRC_F_RATE 0x194 265*02a8b425SSebastian Fricke #define CODA_FRATE_RES_OFFSET 0 266*02a8b425SSebastian Fricke #define CODA_FRATE_RES_MASK 0xffff 267*02a8b425SSebastian Fricke #define CODA_FRATE_DIV_OFFSET 16 268*02a8b425SSebastian Fricke #define CODA_FRATE_DIV_MASK 0xffff 269*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_MP4_PARA 0x198 270*02a8b425SSebastian Fricke #define CODA_MP4PARAM_VERID_OFFSET 6 271*02a8b425SSebastian Fricke #define CODA_MP4PARAM_VERID_MASK 0x01 272*02a8b425SSebastian Fricke #define CODA_MP4PARAM_INTRADCVLCTHR_OFFSET 2 273*02a8b425SSebastian Fricke #define CODA_MP4PARAM_INTRADCVLCTHR_MASK 0x07 274*02a8b425SSebastian Fricke #define CODA_MP4PARAM_REVERSIBLEVLCENABLE_OFFSET 1 275*02a8b425SSebastian Fricke #define CODA_MP4PARAM_REVERSIBLEVLCENABLE_MASK 0x01 276*02a8b425SSebastian Fricke #define CODA_MP4PARAM_DATAPARTITIONENABLE_OFFSET 0 277*02a8b425SSebastian Fricke #define CODA_MP4PARAM_DATAPARTITIONENABLE_MASK 0x01 278*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_263_PARA 0x19c 279*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXJENABLE_OFFSET 2 280*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXJENABLE_MASK 0x01 281*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXKENABLE_OFFSET 1 282*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXKENABLE_MASK 0x01 283*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXTENABLE_OFFSET 0 284*02a8b425SSebastian Fricke #define CODA_263PARAM_ANNEXTENABLE_MASK 0x01 285*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_264_PARA 0x1a0 286*02a8b425SSebastian Fricke #define CODA_264PARAM_DEBLKFILTEROFFSETBETA_OFFSET 12 287*02a8b425SSebastian Fricke #define CODA_264PARAM_DEBLKFILTEROFFSETBETA_MASK 0x0f 288*02a8b425SSebastian Fricke #define CODA_264PARAM_DEBLKFILTEROFFSETALPHA_OFFSET 8 289*02a8b425SSebastian Fricke #define CODA_264PARAM_DEBLKFILTEROFFSETALPHA_MASK 0x0f 290*02a8b425SSebastian Fricke #define CODA_264PARAM_DISABLEDEBLK_OFFSET 6 291*02a8b425SSebastian Fricke #define CODA_264PARAM_DISABLEDEBLK_MASK 0x03 292*02a8b425SSebastian Fricke #define CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_OFFSET 5 293*02a8b425SSebastian Fricke #define CODA_264PARAM_CONSTRAINEDINTRAPREDFLAG_MASK 0x01 294*02a8b425SSebastian Fricke #define CODA_264PARAM_CHROMAQPOFFSET_OFFSET 0 295*02a8b425SSebastian Fricke #define CODA_264PARAM_CHROMAQPOFFSET_MASK 0x1f 296*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_SLICE_MODE 0x1a4 297*02a8b425SSebastian Fricke #define CODA_SLICING_SIZE_OFFSET 2 298*02a8b425SSebastian Fricke #define CODA_SLICING_SIZE_MASK 0x3fffffff 299*02a8b425SSebastian Fricke #define CODA_SLICING_UNIT_OFFSET 1 300*02a8b425SSebastian Fricke #define CODA_SLICING_UNIT_MASK 0x01 301*02a8b425SSebastian Fricke #define CODA_SLICING_MODE_OFFSET 0 302*02a8b425SSebastian Fricke #define CODA_SLICING_MODE_MASK 0x01 303*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_GOP_SIZE 0x1a8 304*02a8b425SSebastian Fricke #define CODA_GOP_SIZE_OFFSET 0 305*02a8b425SSebastian Fricke #define CODA_GOP_SIZE_MASK 0x3f 306*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_RC_PARA 0x1ac 307*02a8b425SSebastian Fricke #define CODA_RATECONTROL_AUTOSKIP_OFFSET 31 308*02a8b425SSebastian Fricke #define CODA_RATECONTROL_AUTOSKIP_MASK 0x01 309*02a8b425SSebastian Fricke #define CODA_RATECONTROL_INITIALDELAY_OFFSET 16 310*02a8b425SSebastian Fricke #define CODA_RATECONTROL_INITIALDELAY_MASK 0x7fff 311*02a8b425SSebastian Fricke #define CODA_RATECONTROL_BITRATE_OFFSET 1 312*02a8b425SSebastian Fricke #define CODA_RATECONTROL_BITRATE_MASK 0x7fff 313*02a8b425SSebastian Fricke #define CODA_RATECONTROL_ENABLE_OFFSET 0 314*02a8b425SSebastian Fricke #define CODA_RATECONTROL_ENABLE_MASK 0x01 315*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_RC_BUF_SIZE 0x1b0 316*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_INTRA_REFRESH 0x1b4 317*02a8b425SSebastian Fricke #define CODADX6_CMD_ENC_SEQ_FMO 0x1b8 318*02a8b425SSebastian Fricke #define CODA_FMOPARAM_TYPE_OFFSET 4 319*02a8b425SSebastian Fricke #define CODA_FMOPARAM_TYPE_MASK 1 320*02a8b425SSebastian Fricke #define CODA_FMOPARAM_SLICENUM_OFFSET 0 321*02a8b425SSebastian Fricke #define CODA_FMOPARAM_SLICENUM_MASK 0x0f 322*02a8b425SSebastian Fricke #define CODADX6_CMD_ENC_SEQ_INTRA_QP 0x1bc 323*02a8b425SSebastian Fricke #define CODA7_CMD_ENC_SEQ_SEARCH_BASE 0x1b8 324*02a8b425SSebastian Fricke #define CODA7_CMD_ENC_SEQ_SEARCH_SIZE 0x1bc 325*02a8b425SSebastian Fricke #define CODA7_CMD_ENC_SEQ_INTRA_QP 0x1c4 326*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_RC_QP_MIN_MAX 0x1c8 327*02a8b425SSebastian Fricke #define CODA_QPMIN_OFFSET 8 328*02a8b425SSebastian Fricke #define CODA_QPMIN_MASK 0x3f 329*02a8b425SSebastian Fricke #define CODA_QPMAX_OFFSET 0 330*02a8b425SSebastian Fricke #define CODA_QPMAX_MASK 0x3f 331*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_RC_GAMMA 0x1cc 332*02a8b425SSebastian Fricke #define CODA_GAMMA_OFFSET 0 333*02a8b425SSebastian Fricke #define CODA_GAMMA_MASK 0xffff 334*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_RC_INTERVAL_MODE 0x1d0 335*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_SEQ_INTRA_WEIGHT 0x1d4 336*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_SEQ_ME_OPTION 0x1d8 337*02a8b425SSebastian Fricke #define CODA_RET_ENC_SEQ_SUCCESS 0x1c0 338*02a8b425SSebastian Fricke 339*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_JPG_PARA 0x198 340*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_JPG_RST_INTERVAL 0x19C 341*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_JPG_THUMB_EN 0x1a0 342*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_JPG_THUMB_SIZE 0x1a4 343*02a8b425SSebastian Fricke #define CODA_CMD_ENC_SEQ_JPG_THUMB_OFFSET 0x1a8 344*02a8b425SSebastian Fricke 345*02a8b425SSebastian Fricke /* Encoder Parameter Change */ 346*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_CHANGE_ENABLE 0x180 347*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_RC_GOP BIT(0) 348*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_RC_INTRA_QP BIT(1) 349*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_RC_BITRATE BIT(2) 350*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_RC_FRAME_RATE BIT(3) 351*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_INTRA_MB_NUM BIT(4) 352*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_SLICE_MODE BIT(5) 353*02a8b425SSebastian Fricke #define CODA_PARAM_CHANGE_HEC_MODE BIT(6) 354*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_RC_GOP 0x184 355*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_RC_INTRA_QP 0x188 356*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_RC_BITRATE 0x18c 357*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_RC_FRAME_RATE 0x190 358*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_INTRA_MB_NUM 0x194 359*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_SLICE_MODE 0x198 360*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PARAM_HEC_MODE 0x19c 361*02a8b425SSebastian Fricke #define CODA_RET_ENC_PARAM_CHANGE_SUCCESS 0x1c0 362*02a8b425SSebastian Fricke 363*02a8b425SSebastian Fricke /* Encoder Picture Run */ 364*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SRC_INDEX 0x180 365*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SRC_STRIDE 0x184 366*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SUB_FRAME_SYNC 0x1a4 367*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SRC_ADDR_Y 0x1a8 368*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SRC_ADDR_CB 0x1ac 369*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_PIC_SRC_ADDR_CR 0x1b0 370*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_SRC_ADDR_Y 0x180 371*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_SRC_ADDR_CB 0x184 372*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_SRC_ADDR_CR 0x188 373*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_QS 0x18c 374*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_ROT_MODE 0x190 375*02a8b425SSebastian Fricke #define CODA_ROT_MIR_ENABLE (1 << 4) 376*02a8b425SSebastian Fricke #define CODA_ROT_0 (0x0 << 0) 377*02a8b425SSebastian Fricke #define CODA_ROT_90 (0x1 << 0) 378*02a8b425SSebastian Fricke #define CODA_ROT_180 (0x2 << 0) 379*02a8b425SSebastian Fricke #define CODA_ROT_270 (0x3 << 0) 380*02a8b425SSebastian Fricke #define CODA_MIR_NONE (0x0 << 2) 381*02a8b425SSebastian Fricke #define CODA_MIR_VER (0x1 << 2) 382*02a8b425SSebastian Fricke #define CODA_MIR_HOR (0x2 << 2) 383*02a8b425SSebastian Fricke #define CODA_MIR_VER_HOR (0x3 << 2) 384*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_OPTION 0x194 385*02a8b425SSebastian Fricke #define CODA_FORCE_IPICTURE BIT(1) 386*02a8b425SSebastian Fricke #define CODA_REPORT_MB_INFO BIT(3) 387*02a8b425SSebastian Fricke #define CODA_REPORT_MV_INFO BIT(4) 388*02a8b425SSebastian Fricke #define CODA_REPORT_SLICE_INFO BIT(5) 389*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_BB_START 0x198 390*02a8b425SSebastian Fricke #define CODA_CMD_ENC_PIC_BB_SIZE 0x19c 391*02a8b425SSebastian Fricke #define CODA_RET_ENC_FRAME_NUM 0x1c0 392*02a8b425SSebastian Fricke #define CODA_RET_ENC_PIC_TYPE 0x1c4 393*02a8b425SSebastian Fricke #define CODA_RET_ENC_PIC_FRAME_IDX 0x1c8 394*02a8b425SSebastian Fricke #define CODA_RET_ENC_PIC_SLICE_NUM 0x1cc 395*02a8b425SSebastian Fricke #define CODA_RET_ENC_PIC_FLAG 0x1d0 396*02a8b425SSebastian Fricke #define CODA_RET_ENC_PIC_SUCCESS 0x1d8 397*02a8b425SSebastian Fricke 398*02a8b425SSebastian Fricke /* Set Frame Buffer */ 399*02a8b425SSebastian Fricke #define CODA_CMD_SET_FRAME_BUF_NUM 0x180 400*02a8b425SSebastian Fricke #define CODA_CMD_SET_FRAME_BUF_STRIDE 0x184 401*02a8b425SSebastian Fricke #define CODA_CMD_SET_FRAME_SLICE_BB_START 0x188 402*02a8b425SSebastian Fricke #define CODA_CMD_SET_FRAME_SLICE_BB_SIZE 0x18c 403*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_SUBSAMP_A 0x188 404*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_SUBSAMP_B 0x18c 405*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_AXI_BIT_ADDR 0x190 406*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_AXI_IPACDC_ADDR 0x194 407*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_AXI_DBKY_ADDR 0x198 408*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_AXI_DBKC_ADDR 0x19c 409*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_AXI_OVL_ADDR 0x1a0 410*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_MAX_DEC_SIZE 0x1a4 411*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_AXI_BTP_ADDR 0x1a4 412*02a8b425SSebastian Fricke #define CODA7_CMD_SET_FRAME_SOURCE_BUF_STRIDE 0x1a8 413*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_CACHE_SIZE 0x1a8 414*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_CACHE_CONFIG 0x1ac 415*02a8b425SSebastian Fricke #define CODA9_CACHE_BYPASS_OFFSET 28 416*02a8b425SSebastian Fricke #define CODA9_CACHE_DUALCONF_OFFSET 26 417*02a8b425SSebastian Fricke #define CODA9_CACHE_PAGEMERGE_OFFSET 24 418*02a8b425SSebastian Fricke #define CODA9_CACHE_LUMA_BUFFER_SIZE_OFFSET 16 419*02a8b425SSebastian Fricke #define CODA9_CACHE_CB_BUFFER_SIZE_OFFSET 8 420*02a8b425SSebastian Fricke #define CODA9_CACHE_CR_BUFFER_SIZE_OFFSET 0 421*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_SUBSAMP_A_MVC 0x1b0 422*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_SUBSAMP_B_MVC 0x1b4 423*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_DP_BUF_BASE 0x1b0 424*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_DP_BUF_SIZE 0x1b4 425*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_MAX_DEC_SIZE 0x1b8 426*02a8b425SSebastian Fricke #define CODA9_CMD_SET_FRAME_DELAY 0x1bc 427*02a8b425SSebastian Fricke 428*02a8b425SSebastian Fricke /* Encoder Header */ 429*02a8b425SSebastian Fricke #define CODA_CMD_ENC_HEADER_CODE 0x180 430*02a8b425SSebastian Fricke #define CODA_GAMMA_OFFSET 0 431*02a8b425SSebastian Fricke #define CODA_HEADER_H264_SPS 0 432*02a8b425SSebastian Fricke #define CODA_HEADER_H264_PPS 1 433*02a8b425SSebastian Fricke #define CODA_HEADER_MP4V_VOL 0 434*02a8b425SSebastian Fricke #define CODA_HEADER_MP4V_VOS 1 435*02a8b425SSebastian Fricke #define CODA_HEADER_MP4V_VIS 2 436*02a8b425SSebastian Fricke #define CODA9_HEADER_FRAME_CROP (1 << 3) 437*02a8b425SSebastian Fricke #define CODA_CMD_ENC_HEADER_BB_START 0x184 438*02a8b425SSebastian Fricke #define CODA_CMD_ENC_HEADER_BB_SIZE 0x188 439*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_HEADER_FRAME_CROP_H 0x18c 440*02a8b425SSebastian Fricke #define CODA9_CMD_ENC_HEADER_FRAME_CROP_V 0x190 441*02a8b425SSebastian Fricke 442*02a8b425SSebastian Fricke /* Get Version */ 443*02a8b425SSebastian Fricke #define CODA_CMD_FIRMWARE_VERNUM 0x1c0 444*02a8b425SSebastian Fricke #define CODA_FIRMWARE_PRODUCT(x) (((x) >> 16) & 0xffff) 445*02a8b425SSebastian Fricke #define CODA_FIRMWARE_MAJOR(x) (((x) >> 12) & 0x0f) 446*02a8b425SSebastian Fricke #define CODA_FIRMWARE_MINOR(x) (((x) >> 8) & 0x0f) 447*02a8b425SSebastian Fricke #define CODA_FIRMWARE_RELEASE(x) ((x) & 0xff) 448*02a8b425SSebastian Fricke #define CODA_FIRMWARE_VERNUM(product, major, minor, release) \ 449*02a8b425SSebastian Fricke ((product) << 16 | ((major) << 12) | \ 450*02a8b425SSebastian Fricke ((minor) << 8) | (release)) 451*02a8b425SSebastian Fricke #define CODA9_CMD_FIRMWARE_CODE_REV 0x1c4 452*02a8b425SSebastian Fricke 453*02a8b425SSebastian Fricke #define CODA9_GDMA_BASE 0x1000 454*02a8b425SSebastian Fricke #define CODA9_GDI_CONTROL (CODA9_GDMA_BASE + 0x034) 455*02a8b425SSebastian Fricke #define CODA9_GDI_PIC_INIT_HOST (CODA9_GDMA_BASE + 0x038) 456*02a8b425SSebastian Fricke #define CODA9_GDI_STATUS (CODA9_GDMA_BASE + 0x080) 457*02a8b425SSebastian Fricke #define CODA9_GDI_WPROT_ERR_CLR (CODA9_GDMA_BASE + 0x0a0) 458*02a8b425SSebastian Fricke #define CODA9_GDI_WPROT_RGN_EN (CODA9_GDMA_BASE + 0x0ac) 459*02a8b425SSebastian Fricke 460*02a8b425SSebastian Fricke #define CODA9_GDI_BUS_CTRL (CODA9_GDMA_BASE + 0x0f0) 461*02a8b425SSebastian Fricke #define CODA9_GDI_BUS_STATUS (CODA9_GDMA_BASE + 0x0f4) 462*02a8b425SSebastian Fricke 463*02a8b425SSebastian Fricke #define CODA9_GDI_INFO_CONTROL (CODA9_GDMA_BASE + 0x400) 464*02a8b425SSebastian Fricke #define CODA9_GDI_INFO_PIC_SIZE (CODA9_GDMA_BASE + 0x404) 465*02a8b425SSebastian Fricke #define CODA9_GDI_INFO_BASE_Y (CODA9_GDMA_BASE + 0x408) 466*02a8b425SSebastian Fricke #define CODA9_GDI_INFO_BASE_CB (CODA9_GDMA_BASE + 0x40c) 467*02a8b425SSebastian Fricke #define CODA9_GDI_INFO_BASE_CR (CODA9_GDMA_BASE + 0x410) 468*02a8b425SSebastian Fricke 469*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_CAS_0 (CODA9_GDMA_BASE + 0x800) 470*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_CAS_F (CODA9_GDMA_BASE + 0x83c) 471*02a8b425SSebastian Fricke 472*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_BA_0 (CODA9_GDMA_BASE + 0x840) 473*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_BA_1 (CODA9_GDMA_BASE + 0x844) 474*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_BA_2 (CODA9_GDMA_BASE + 0x848) 475*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_BA_3 (CODA9_GDMA_BASE + 0x84c) 476*02a8b425SSebastian Fricke 477*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_RAS_0 (CODA9_GDMA_BASE + 0x850) 478*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_RAS_F (CODA9_GDMA_BASE + 0x88c) 479*02a8b425SSebastian Fricke 480*02a8b425SSebastian Fricke #define CODA9_GDI_XY2_RBC_CONFIG (CODA9_GDMA_BASE + 0x890) 481*02a8b425SSebastian Fricke #define CODA9_XY2RBC_SEPARATE_MAP BIT(19) 482*02a8b425SSebastian Fricke #define CODA9_XY2RBC_TOP_BOT_SPLIT BIT(18) 483*02a8b425SSebastian Fricke #define CODA9_XY2RBC_TILED_MAP BIT(17) 484*02a8b425SSebastian Fricke #define CODA9_XY2RBC_CA_INC_HOR BIT(16) 485*02a8b425SSebastian Fricke #define CODA9_GDI_RBC2_AXI_0 (CODA9_GDMA_BASE + 0x8a0) 486*02a8b425SSebastian Fricke #define CODA9_GDI_RBC2_AXI_1F (CODA9_GDMA_BASE + 0x91c) 487*02a8b425SSebastian Fricke #define CODA9_GDI_TILEDBUF_BASE (CODA9_GDMA_BASE + 0x920) 488*02a8b425SSebastian Fricke 489*02a8b425SSebastian Fricke #define CODA9_JPEG_BASE 0x3000 490*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_PIC_START (CODA9_JPEG_BASE + 0x000) 491*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_PIC_STATUS (CODA9_JPEG_BASE + 0x004) 492*02a8b425SSebastian Fricke #define CODA9_JPEG_STATUS_OVERFLOW BIT(3) 493*02a8b425SSebastian Fricke #define CODA9_JPEG_STATUS_BBC_INT BIT(2) 494*02a8b425SSebastian Fricke #define CODA9_JPEG_STATUS_ERROR BIT(1) 495*02a8b425SSebastian Fricke #define CODA9_JPEG_STATUS_DONE BIT(0) 496*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_PIC_ERRMB (CODA9_JPEG_BASE + 0x008) 497*02a8b425SSebastian Fricke #define CODA9_JPEG_ERRMB_RESTART_IDX_MASK (0xf << 24) 498*02a8b425SSebastian Fricke #define CODA9_JPEG_ERRMB_MCU_POS_X_MASK (0xfff << 12) 499*02a8b425SSebastian Fricke #define CODA9_JPEG_ERRMB_MCU_POS_Y_MASK 0xfff 500*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_PIC_CTRL (CODA9_JPEG_BASE + 0x010) 501*02a8b425SSebastian Fricke #define CODA9_JPEG_PIC_CTRL_USER_HUFFMAN_EN BIT(6) 502*02a8b425SSebastian Fricke #define CODA9_JPEG_PIC_CTRL_TC_DIRECTION BIT(4) 503*02a8b425SSebastian Fricke #define CODA9_JPEG_PIC_CTRL_ENCODER_EN BIT(3) 504*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_PIC_SIZE (CODA9_JPEG_BASE + 0x014) 505*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_MCU_INFO (CODA9_JPEG_BASE + 0x018) 506*02a8b425SSebastian Fricke #define CODA9_JPEG_MCU_BLOCK_NUM_OFFSET 16 507*02a8b425SSebastian Fricke #define CODA9_JPEG_COMP_NUM_OFFSET 12 508*02a8b425SSebastian Fricke #define CODA9_JPEG_COMP0_INFO_OFFSET 8 509*02a8b425SSebastian Fricke #define CODA9_JPEG_COMP1_INFO_OFFSET 4 510*02a8b425SSebastian Fricke #define CODA9_JPEG_COMP2_INFO_OFFSET 0 511*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_ROT_INFO (CODA9_JPEG_BASE + 0x01c) 512*02a8b425SSebastian Fricke #define CODA9_JPEG_ROT_MIR_ENABLE BIT(4) 513*02a8b425SSebastian Fricke #define CODA9_JPEG_ROT_MIR_MODE_MASK 0xf 514*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_SCL_INFO (CODA9_JPEG_BASE + 0x020) 515*02a8b425SSebastian Fricke #define CODA9_JPEG_SCL_ENABLE BIT(4) 516*02a8b425SSebastian Fricke #define CODA9_JPEG_SCL_HOR_MODE_MASK (0x3 << 2) 517*02a8b425SSebastian Fricke #define CODA9_JPEG_SCL_VER_MODE_MASK (0x3 << 0) 518*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_IF_INFO (CODA9_JPEG_BASE + 0x024) 519*02a8b425SSebastian Fricke #define CODA9_JPEG_SENS_IF_CLR BIT(1) 520*02a8b425SSebastian Fricke #define CODA9_JPEG_DISP_IF_CLR BIT(0) 521*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_OP_INFO (CODA9_JPEG_BASE + 0x02c) 522*02a8b425SSebastian Fricke #define CODA9_JPEG_BUS_REQ_NUM_OFFSET 0 523*02a8b425SSebastian Fricke #define CODA9_JPEG_BUS_REQ_NUM_MASK 0x7 524*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_DPB_CONFIG (CODA9_JPEG_BASE + 0x030) 525*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_DPB_BASE00 (CODA9_JPEG_BASE + 0x040) 526*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_HUFF_CTRL (CODA9_JPEG_BASE + 0x080) 527*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_HUFF_ADDR (CODA9_JPEG_BASE + 0x084) 528*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_HUFF_DATA (CODA9_JPEG_BASE + 0x088) 529*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_QMAT_CTRL (CODA9_JPEG_BASE + 0x090) 530*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_QMAT_ADDR (CODA9_JPEG_BASE + 0x094) 531*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_QMAT_DATA (CODA9_JPEG_BASE + 0x098) 532*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_RST_INTVAL (CODA9_JPEG_BASE + 0x0b0) 533*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_RST_INDEX (CODA9_JPEG_BASE + 0x0b4) 534*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_RST_COUNT (CODA9_JPEG_BASE + 0x0b8) 535*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_DPCM_DIFF_Y (CODA9_JPEG_BASE + 0x0f0) 536*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_DPCM_DIFF_CB (CODA9_JPEG_BASE + 0x0f4) 537*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_DPCM_DIFF_CR (CODA9_JPEG_BASE + 0x0f8) 538*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_CTRL (CODA9_JPEG_BASE + 0x100) 539*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BT_PTR (CODA9_JPEG_BASE + 0x110) 540*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_WD_PTR (CODA9_JPEG_BASE + 0x114) 541*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_TT_CNT (CODA9_JPEG_BASE + 0x118) 542*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BBSR (CODA9_JPEG_BASE + 0x140) 543*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BBER (CODA9_JPEG_BASE + 0x144) 544*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BBIR (CODA9_JPEG_BASE + 0x148) 545*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BBHR (CODA9_JPEG_BASE + 0x14c) 546*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_BCNT (CODA9_JPEG_BASE + 0x158) 547*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_FF_RPTR (CODA9_JPEG_BASE + 0x160) 548*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_GBU_FF_WPTR (CODA9_JPEG_BASE + 0x164) 549*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_END_ADDR (CODA9_JPEG_BASE + 0x208) 550*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_WR_PTR (CODA9_JPEG_BASE + 0x20c) 551*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_RD_PTR (CODA9_JPEG_BASE + 0x210) 552*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_EXT_ADDR (CODA9_JPEG_BASE + 0x214) 553*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_INT_ADDR (CODA9_JPEG_BASE + 0x218) 554*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_DATA_CNT (CODA9_JPEG_BASE + 0x21c) 555*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_COMMAND (CODA9_JPEG_BASE + 0x220) 556*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_BUSY (CODA9_JPEG_BASE + 0x224) 557*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_CTRL (CODA9_JPEG_BASE + 0x228) 558*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_CUR_POS (CODA9_JPEG_BASE + 0x22c) 559*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_BAS_ADDR (CODA9_JPEG_BASE + 0x230) 560*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_STRM_CTRL (CODA9_JPEG_BASE + 0x234) 561*02a8b425SSebastian Fricke #define CODA9_REG_JPEG_BBC_FLUSH_CMD (CODA9_JPEG_BASE + 0x238) 562*02a8b425SSebastian Fricke 563*02a8b425SSebastian Fricke #endif 564