1 //<MStar Software> 2 //****************************************************************************** 3 // MStar Software 4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. 5 // All software, firmware and related documentation herein ("MStar Software") are 6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by 7 // law, including, but not limited to, copyright law and international treaties. 8 // Any use, modification, reproduction, retransmission, or republication of all 9 // or part of MStar Software is expressly prohibited, unless prior written 10 // permission has been granted by MStar. 11 // 12 // By accessing, browsing and/or using MStar Software, you acknowledge that you 13 // have read, understood, and agree, to be bound by below terms ("Terms") and to 14 // comply with all applicable laws and regulations: 15 // 16 // 1. MStar shall retain any and all right, ownership and interest to MStar 17 // Software and any modification/derivatives thereof. 18 // No right, ownership, or interest to MStar Software and any 19 // modification/derivatives thereof is transferred to you under Terms. 20 // 21 // 2. You understand that MStar Software might include, incorporate or be 22 // supplied together with third party`s software and the use of MStar 23 // Software may require additional licenses from third parties. 24 // Therefore, you hereby agree it is your sole responsibility to separately 25 // obtain any and all third party right and license necessary for your use of 26 // such third party`s software. 27 // 28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as 29 // MStar`s confidential information and you agree to keep MStar`s 30 // confidential information in strictest confidence and not disclose to any 31 // third party. 32 // 33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any 34 // kind. Any warranties are hereby expressly disclaimed by MStar, including 35 // without limitation, any warranties of merchantability, non-infringement of 36 // intellectual property rights, fitness for a particular purpose, error free 37 // and in conformity with any international standard. You agree to waive any 38 // claim against MStar for any loss, damage, cost or expense that you may 39 // incur related to your use of MStar Software. 40 // In no event shall MStar be liable for any direct, indirect, incidental or 41 // consequential damages, including without limitation, lost of profit or 42 // revenues, lost or damage of data, and unauthorized system use. 43 // You agree that this Section 4 shall still apply without being affected 44 // even if MStar Software has been modified by MStar in accordance with your 45 // request or instruction for your use, except otherwise agreed by both 46 // parties in writing. 47 // 48 // 5. If requested, MStar may from time to time provide technical supports or 49 // services in relation with MStar Software to you for your use of 50 // MStar Software in conjunction with your or your customer`s product 51 // ("Services"). 52 // You understand and agree that, except otherwise agreed by both parties in 53 // writing, Services are provided on an "AS IS" basis and the warranty 54 // disclaimer set forth in Section 4 above shall apply. 55 // 56 // 6. Nothing contained herein shall be construed as by implication, estoppels 57 // or otherwise: 58 // (a) conferring any license or right to use MStar name, trademark, service 59 // mark, symbol or any other identification; 60 // (b) obligating MStar or any of its affiliates to furnish any person, 61 // including without limitation, you and your customers, any assistance 62 // of any kind whatsoever, or any information; or 63 // (c) conferring any license or right under any intellectual property right. 64 // 65 // 7. These terms shall be governed by and construed in accordance with the laws 66 // of Taiwan, R.O.C., excluding its conflict of law rules. 67 // Any and all dispute arising out hereof or related hereto shall be finally 68 // settled by arbitration referred to the Chinese Arbitration Association, 69 // Taipei in accordance with the ROC Arbitration Law and the Arbitration 70 // Rules of the Association by three (3) arbitrators appointed in accordance 71 // with the said Rules. 72 // The place of arbitration shall be in Taipei, Taiwan and the language shall 73 // be English. 74 // The arbitration award shall be final and binding to both parties. 75 // 76 //****************************************************************************** 77 //<MStar Software> 78 //////////////////////////////////////////////////////////////////////////////// 79 // 80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc. 81 // All rights reserved. 82 // 83 // Unless otherwise stipulated in writing, any and all information contained 84 // herein regardless in any format shall remain the sole proprietary of 85 // MStar Semiconductor Inc. and be kept in strict confidence 86 // ("MStar Confidential Information") by the recipient. 87 // Any unauthorized act including without limitation unauthorized disclosure, 88 // copying, use, reproduction, sale, distribution, modification, disassembling, 89 // reverse engineering and compiling of the contents of MStar Confidential 90 // Information is unlawful and strictly prohibited. MStar hereby reserves the 91 // rights to any and all damages, losses, costs and expenses resulting therefrom. 92 // 93 // 94 /// @file regMVD.h 95 /// @brief Hardware register definition for Video Decoder 96 /// @author MStar Semiconductor Inc. 97 // 98 /////////////////////////////////////////////////////////////////////////////////// 99 100 #ifndef _REG_MVD_H_ 101 #define _REG_MVD_H_ 102 103 104 //////////////////////////////////////////////////////////////////////////////// 105 // Constant & Macro Definition 106 //////////////////////////////////////////////////////////////////////////////// 107 //------------------------------------------------------------------------------ 108 // Base Address 109 //------------------------------------------------------------------------------ 110 #define MVD_REG_BASE 0x1100UL // 0x1100 - 0x11FF 111 #define CHIP_REG_BASE 0x1E00UL // 0x1E00 - 0x1EFF 112 113 #define MIU0_REG_BASE 0x1200UL 114 #define MIU1_REG_BASE 0x0600UL 115 116 117 //------------------------------------------------------------------------------ 118 // MIU register 119 //------------------------------------------------------------------------------ 120 //MIU request mask 121 #define MIU0_RQ0_MASK_L (MIU0_REG_BASE + 0x23*2) 122 #define MIU0_RQ0_MASK_H (MIU0_REG_BASE + 0x23*2 +1) 123 #define MIU0_RQ1_MASK_L (MIU0_REG_BASE + 0x33*2) 124 #define MIU0_RQ1_MASK_H (MIU0_REG_BASE + 0x33*2 +1) 125 #define MIU0_RQ2_MASK_L (MIU0_REG_BASE + 0x43*2) 126 #define MIU0_RQ2_MASK_H (MIU0_REG_BASE + 0x43*2 +1) 127 #define MIU0_RQ3_MASK_L (MIU0_REG_BASE + 0x53*2) 128 #define MIU0_RQ3_MASK_H (MIU0_REG_BASE + 0x53*2 +1) 129 #define MIU0_SEL0_L (MIU0_REG_BASE + 0xF0) 130 #define MIU0_SEL0_H (MIU0_REG_BASE + 0xF1) 131 #define MIU0_SEL2_L (MIU0_REG_BASE + 0xF4) 132 #define MIU0_SEL2_H (MIU0_REG_BASE + 0xF5) 133 #define MIU0_SEL3_L (MIU0_REG_BASE + 0xF6) 134 #define MIU0_SEL3_H (MIU0_REG_BASE + 0xF7) 135 136 #define MIU1_RQ0_MASK_L (MIU1_REG_BASE + 0x23*2) 137 #define MIU1_RQ0_MASK_H (MIU1_REG_BASE + 0x23*2 +1) 138 #define MIU1_RQ1_MASK_L (MIU1_REG_BASE + 0x33*2) 139 #define MIU1_RQ1_MASK_H (MIU1_REG_BASE + 0x33*2 +1) 140 #define MIU1_RQ2_MASK_L (MIU1_REG_BASE + 0x43*2) 141 #define MIU1_RQ2_MASK_H (MIU1_REG_BASE + 0x43*2 +1) 142 #define MIU1_RQ3_MASK_L (MIU1_REG_BASE + 0x53*2) 143 #define MIU1_RQ3_MASK_H (MIU1_REG_BASE + 0x53*2 +1) 144 145 146 //------------------------------------------------------------------------------ 147 // MVD Reg 148 //------------------------------------------------------------------------------ 149 #define MVD_CTRL_RST BIT0//1: reset MVD; 0: release reset 150 #define MVD_CTRL_CLR_INT BIT2//Clear MVD interrupt. 151 #define MVD_CTRL_CLK_SYNCMODE BIT4//1: sync_mode; 0: async_mode 152 #define MVD_CTRL_CLK_ALLON BIT5//1: enable all clocks in mvd 153 #define MVD_CTRL_DISCONNECT_MIU BIT6//1: disconnect; 0: release reset 154 #define MVD_CTRL (MVD_REG_BASE + 0x00) 155 156 #define MVD_STATUS_READY BIT1 157 #define MVD_STATUS (MVD_REG_BASE + 0x01) 158 #define MVD_T8_MIU_128_0 BIT2 // enable MVD to 128 bit mode 159 #define MVD_T8_MIU_128_1 BIT3 // enable MVD to 128 bit mode 160 #define MVD_COMMAND (MVD_REG_BASE + 0x02) 161 #define MVD_ARG0 (MVD_REG_BASE + 0x04) 162 #define MVD_ARG1 (MVD_REG_BASE + 0x05) 163 #define MVD_ARG2 (MVD_REG_BASE + 0x06) 164 #define MVD_ARG3 (MVD_REG_BASE + 0x07) 165 #define MVD_ARG4 (MVD_REG_BASE + 0x08) 166 #define MVD_ARG5 (MVD_REG_BASE + 0x09) 167 168 #define MVD_SLQCTRL_WADR_RELOAD BIT0 //reload "slq_wadr" into write address 169 //w reload: program 1, then program 0, and reload complete 170 #define MVD_SLQCTRL_RADR_PROBE BIT1 //SLQ read address probe 171 #define MVD_SLQCTRL_WADR_PROBE BIT2 //SLQ write address probe 172 //r/w probe: program 1, then program 0, and read "slq_caddr" 173 #define MVD_SLQCTRL (MVD_REG_BASE + 0x16) 174 175 //SLQ write address value[24:0] 176 #define MVD_SLQ_WADR0 (MVD_REG_BASE + 0x18) 177 #define MVD_SLQ_WADR1 (MVD_REG_BASE + 0x19) 178 #define MVD_SLQ_WADR2 (MVD_REG_BASE + 0x1A) 179 #define MVD_SLQ_WADR3 (MVD_REG_BASE + 0x1B) 180 181 //SLQ probe address value[24:0] 182 #define MVD_SLQ_CADR0 (MVD_REG_BASE + 0x1C) 183 #define MVD_SLQ_CADR1 (MVD_REG_BASE + 0x1D) 184 #define MVD_SLQ_CADR2 (MVD_REG_BASE + 0x1E) 185 #define MVD_SLQ_CADR3 (MVD_REG_BASE + 0x1F) 186 187 //CRC in/out 188 #define MVD_CRC_CTL (MVD_REG_BASE + 0x23) 189 #define MVD_CRC_CTL_FIRE BIT6 190 #define MVD_CRC_CTL_DONE BIT7 191 #define MVD_CRC_HSIZE (MVD_REG_BASE + 0x22) //CRC hsize[13:4] 192 #define MVD_CRC_VSIZE (MVD_REG_BASE + 0x24) //CRC vsize[13:0] 193 #define MVD_CRC_STRIP (MVD_REG_BASE + 0x26) //CRC strip[13:0] 194 #define MVD_CRC_Y_START (MVD_REG_BASE + 0x28) //CRC y start address[25:0] 195 #define MVD_CRC_Y_START_LEN BMASK(25:0) 196 #define MVD_CRC_UV_START (MVD_REG_BASE + 0x2C) //CRC uv start address[25:0] 197 #define MVD_CRC_UV_START_LEN BMASK(25:0) 198 #define MVD_CRC_Y_L (MVD_REG_BASE + 0x30) 199 #define MVD_CRC_Y_H (MVD_REG_BASE + 0x32) 200 #define MVD_CRC_UV_L (MVD_REG_BASE + 0x34) 201 #define MVD_CRC_UV_H (MVD_REG_BASE + 0x36) 202 203 #define REG_CHIPTOP_BASE 0x0b00UL 204 205 #define REG_CKG_MVD_SYNC (REG_CHIPTOP_BASE + 0x38*2 +1) 206 #define CKG_MVD_SYNC_GATED BIT0 207 208 #define REG_CKG_MVD (REG_CHIPTOP_BASE + 0x39*2) 209 #define CKG_MVD_GATED BIT0 210 #define CKG_MVD_INVERT BIT1 211 #define CKG_MVD_MASK (BIT4 | BIT3 | BIT2) 212 #define CKG_MVD_160MHZ (0 << 2) 213 #define CKG_MVD_144MHZ (1 << 2) 214 #define CKG_MVD_RESERVED_MHZ (2 << 2) 215 #define CKG_MVD_108MHZ (3 << 2) 216 #define CKG_MVD_RESERVED2_MHZ (4 << 2) //clk_miu_p 217 #define CKG_MVD_72MHZ (5 << 2) 218 #define CKG_MVD_RESERVED3_MHZ (6 << 2) //mempll_clk_buf_div2 219 #define CKG_MVD_XTAL_CLK (7 << 2) //XTAL clock 220 221 222 #define REG_CKG_MVD_LUMA_A (REG_CHIPTOP_BASE + 0x3a*2 + 1) 223 #define CKG_MVD_LUMA_A_GATED BIT0 224 #define CKG_MVD_LUMA_A_INVERT BIT1 225 226 #define REG_CKG_MVD_LUMA_B (REG_CHIPTOP_BASE + 0x3b*2) 227 #define CKG_MVD_LUMA_B_GATED BIT0 228 #define CKG_MVD_LUMA_B_INVERT BIT1 229 230 #define REG_CKG_MVD_LUMA_C (REG_CHIPTOP_BASE + 0x3b*2 + 1) 231 #define CKG_MVD_LUMA_C_GATED BIT0 232 #define CKG_MVD_LUMA_C_INVERT BIT1 233 234 #define REG_CKG_MVD_RMEM (REG_CHIPTOP_BASE + 0x3c*2) 235 #define CKG_MVD_RMEM_GATED BIT0 236 #define CKG_MVD_RMEM_INVERT BIT1 237 238 #define REG_CKG_MVD_RMEM1 (REG_CHIPTOP_BASE + 0x3c*2 + 1) 239 #define CKG_MVD_RMEM1_GATED BIT0 240 #define CKG_MVD_RMEM1_INVERT BIT1 241 242 243 #define REG_CKG_MVD_CHROMA_A (REG_CHIPTOP_BASE + 0x3d*2) 244 #define CKG_MVD_CHROMA_A_GATED BIT0 245 #define CKG_MVD_CHROMA_A_INVERT BIT1 246 247 #define REG_CKG_MVD_CHROMA_B (REG_CHIPTOP_BASE + 0x3d*2) 248 #define CKG_MVD_CHROMA_B_GATED BIT4 249 #define CKG_MVD_CHROMA_B_INVERT BIT5 250 251 #define REG_CKG_MVD_CHROMA_C (REG_CHIPTOP_BASE + 0x3d*2 + 1) 252 #define CKG_MVD_CHROMA_C_GATED BIT0 253 #define CKG_MVD_CHROMA_C_INVERT BIT1 254 255 #define REG_CKG_MVD_RREFDAT (REG_CHIPTOP_BASE + 0x3e*2) 256 #define CKG_MVD_RREFDAT_GATED BIT0 257 #define CKG_MVD_RREFDAT_INVERT BIT1 258 259 #define REG_CKG_VD_AEON (REG_CHIPTOP_BASE + 0x30*2) 260 #define CKG_VD_AEON_GATED BIT0 261 #define CKG_VD_AEON_INVERT BIT1 262 #define CKG_VD_AEON_MASK (BIT6 | BIT5 | BIT4 | BIT3 | BIT2) 263 #define CKG_VD_AEON_160MHZ (0 << 2) 264 //Notice: The clock 160M comes from UTMI. 265 //Please start UTMI's clock before you switch to 160M 266 #define CKG_VD_AEON_144MHZ (1 << 2) 267 #define CKG_VD_AEON_123MHZ (2 << 2) 268 #define CKG_VD_AEON_108MHZ (3 << 2) 269 #define CKG_VD_AEON_96MHZ (4 << 2) 270 #define CKG_VD_AEON_72MHZ (5 << 2) 271 #define CKG_VD_AEON_DISABLE0 (6 << 2) //disable 272 #define CKG_VD_AEON_DISABLE1 (7 << 2) //disable 273 #define CKG_VD_AEON_CLK_MCU (1 << 5) //01xxx 274 #define CKG_VD_AEON_CLK_MIU (2 << 5) //10xxx 275 #define CKG_VD_AEON_XTAL (3 << 5) //11xxx 276 277 278 #define REG_CHIP_ID_MAJOR (CHIP_REG_BASE + 0xCC) 279 #define REG_CHIP_ID_MINOR (CHIP_REG_BASE + 0xCD) 280 #define REG_CHIP_VERSION (CHIP_REG_BASE + 0xCE) 281 #define REG_CHIP_REVISION (CHIP_REG_BASE + 0xCF) 282 283 #endif // _REG_MVD_H_ 284 285