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 #define MIU0_REG_BASE2 (0x61500) 116 #define MIU1_REG_BASE2 (0x62200) 117 118 119 //------------------------------------------------------------------------------ 120 // MIU register 121 //------------------------------------------------------------------------------ 122 //MIU request mask 123 #define MIU0_RQ0_MASK_L (MIU0_REG_BASE + 0x23*2) 124 #define MIU0_RQ0_MASK_H (MIU0_REG_BASE + 0x23*2 +1) 125 #define MIU0_RQ1_MASK_L (MIU0_REG_BASE + 0x33*2) 126 #define MIU0_RQ1_MASK_H (MIU0_REG_BASE + 0x33*2 +1) 127 #define MIU0_RQ2_MASK_L (MIU0_REG_BASE + 0x43*2) 128 #define MIU0_RQ2_MASK_H (MIU0_REG_BASE + 0x43*2 +1) 129 #define MIU0_RQ3_MASK_L (MIU0_REG_BASE + 0x53*2) 130 #define MIU0_RQ3_MASK_H (MIU0_REG_BASE + 0x53*2 +1) 131 #define MIU0_RQ4_MASK_L (MIU0_REG_BASE2+((0x0003)<<1)) 132 #define MIU0_RQ4_MASK_H (MIU0_REG_BASE2+((0x0003)<<1)+1) 133 #define MIU0_RQ5_MASK_L (MIU0_REG_BASE2+((0x0013)<<1)) 134 #define MIU0_RQ5_MASK_H (MIU0_REG_BASE2+((0x0013)<<1)+1) 135 136 137 #define MIU0_SEL0_L (MIU0_REG_BASE + 0xF0) //0x78<<1 138 #define MIU0_SEL0_H (MIU0_REG_BASE + 0xF1) 139 #define MIU0_SEL2_L (MIU0_REG_BASE + 0xF4) //0x7A<<1 140 #define MIU0_SEL2_H (MIU0_REG_BASE + 0xF5) 141 #define MIU0_SEL3_L (MIU0_REG_BASE + 0xF6) //0x7B<<1 142 #define MIU0_SEL3_H (MIU0_REG_BASE + 0xF7) 143 #define MIU0_SEL4_L (MIU0_REG_BASE +(( 0x007C)<<1)) 144 #define MIU0_SEL4_H (MIU0_REG_BASE +(( 0x007C)<<1)+1) 145 #define MIU0_SEL5_L (MIU0_REG_BASE +(( 0x007D)<<1)) 146 #define MIU0_SEL5_H (MIU0_REG_BASE +(( 0x007D)<<1)+1) 147 148 149 #define MIU1_RQ0_MASK_L (MIU1_REG_BASE + 0x23*2) 150 #define MIU1_RQ0_MASK_H (MIU1_REG_BASE + 0x23*2 +1) 151 #define MIU1_RQ1_MASK_L (MIU1_REG_BASE + 0x33*2) 152 #define MIU1_RQ1_MASK_H (MIU1_REG_BASE + 0x33*2 +1) 153 #define MIU1_RQ2_MASK_L (MIU1_REG_BASE + 0x43*2) 154 #define MIU1_RQ2_MASK_H (MIU1_REG_BASE + 0x43*2 +1) 155 #define MIU1_RQ3_MASK_L (MIU1_REG_BASE + 0x53*2) 156 #define MIU1_RQ3_MASK_H (MIU1_REG_BASE + 0x53*2 +1) 157 #define MIU1_RQ4_MASK_L (MIU1_REG_BASE2+((0x0003)<<1)) 158 #define MIU1_RQ4_MASK_H (MIU1_REG_BASE2+((0x0003)<<1)+1) 159 #define MIU1_RQ5_MASK_L (MIU1_REG_BASE2+((0x0013)<<1)) 160 #define MIU1_RQ5_MASK_H (MIU1_REG_BASE2+((0x0013)<<1)+1) 161 162 163 //------------------------------------------------------------------------------ 164 // MVD Reg 165 //------------------------------------------------------------------------------ 166 #define MVD_CTRL_RST BIT0//1: reset MVD; 0: release reset 167 #define MVD_CTRL_CLR_INT BIT2//Clear MVD interrupt. 168 #define MVD_CTRL_CLK_SYNCMODE BIT4//1: sync_mode; 0: async_mode 169 #define MVD_CTRL_CLK_ALLON BIT5//1: enable all clocks in mvd 170 #define MVD_CTRL_DISCONNECT_MIU BIT6//1: disconnect; 0: release reset 171 #define MVD_CTRL (MVD_REG_BASE + 0x00) 172 173 #define MVD_STATUS_READY BIT1 174 #define MVD_STATUS (MVD_REG_BASE + 0x01) 175 #define MVD_T8_MIU_128_0 BIT2 // enable MVD to 128 bit mode 176 #define MVD_T8_MIU_128_1 BIT3 // enable MVD to 128 bit mode 177 #define MVD_COMMAND (MVD_REG_BASE + 0x02) 178 #define MVD_ARG0 (MVD_REG_BASE + 0x04) 179 #define MVD_ARG1 (MVD_REG_BASE + 0x05) 180 #define MVD_ARG2 (MVD_REG_BASE + 0x06) 181 #define MVD_ARG3 (MVD_REG_BASE + 0x07) 182 #define MVD_ARG4 (MVD_REG_BASE + 0x08) 183 #define MVD_ARG5 (MVD_REG_BASE + 0x09) 184 185 #define MVD_SLQCTRL_WADR_RELOAD BIT0 //reload "slq_wadr" into write address 186 //w reload: program 1, then program 0, and reload complete 187 #define MVD_SLQCTRL_RADR_PROBE BIT1 //SLQ read address probe 188 #define MVD_SLQCTRL_WADR_PROBE BIT2 //SLQ write address probe 189 //r/w probe: program 1, then program 0, and read "slq_caddr" 190 #define MVD_SLQCTRL (MVD_REG_BASE + 0x16) 191 192 //SLQ write address value[24:0] 193 #define MVD_SLQ_WADR0 (MVD_REG_BASE + 0x18) 194 #define MVD_SLQ_WADR1 (MVD_REG_BASE + 0x19) 195 #define MVD_SLQ_WADR2 (MVD_REG_BASE + 0x1A) 196 #define MVD_SLQ_WADR3 (MVD_REG_BASE + 0x1B) 197 198 //SLQ probe address value[24:0] 199 #define MVD_SLQ_CADR0 (MVD_REG_BASE + 0x1C) 200 #define MVD_SLQ_CADR1 (MVD_REG_BASE + 0x1D) 201 #define MVD_SLQ_CADR2 (MVD_REG_BASE + 0x1E) 202 #define MVD_SLQ_CADR3 (MVD_REG_BASE + 0x1F) 203 204 //CRC in/out 205 #define MVD_CRC_CTL (MVD_REG_BASE + 0x23) 206 #define MVD_CRC_CTL_FIRE BIT6 207 #define MVD_CRC_CTL_DONE BIT7 208 #define MVD_CRC_HSIZE (MVD_REG_BASE + 0x22) //CRC hsize[13:4] 209 #define MVD_CRC_VSIZE (MVD_REG_BASE + 0x24) //CRC vsize[13:0] 210 #define MVD_CRC_STRIP (MVD_REG_BASE + 0x26) //CRC strip[13:0] 211 #define MVD_CRC_Y_START (MVD_REG_BASE + 0x28) //CRC y start address[25:0] 212 #define MVD_CRC_Y_START_LEN BMASK(25:0) 213 #define MVD_CRC_UV_START (MVD_REG_BASE + 0x2C) //CRC uv start address[25:0] 214 #define MVD_CRC_UV_START_LEN BMASK(25:0) 215 #define MVD_CRC_Y_L (MVD_REG_BASE + 0x30) 216 #define MVD_CRC_Y_H (MVD_REG_BASE + 0x32) 217 #define MVD_CRC_UV_L (MVD_REG_BASE + 0x34) 218 #define MVD_CRC_UV_H (MVD_REG_BASE + 0x36) 219 220 #define REG_CHIPTOP_BASE 0x0b00UL 221 222 #define REG_CKG_MVD_SYNC (REG_CHIPTOP_BASE + 0x38*2 +1) 223 #define CKG_MVD_SYNC_GATED BIT0 224 225 #define REG_CKG_MVD (REG_CHIPTOP_BASE + 0x39*2) 226 #define CKG_MVD_GATED BIT0 227 #define CKG_MVD_INVERT BIT1 228 #define CKG_MVD_MASK (BIT4 | BIT3 | BIT2) 229 #define CKG_MVD_144MHZ (0 << 2) 230 #define CKG_MVD_123MHZ (1 << 2) 231 #define CKG_MVD_108MHZ (2 << 2) 232 #define CKG_MVD_86MHZ (3 << 2) 233 #define CKG_MVD_62MHZ (4 << 2) //clk_miu_p 234 #define CKG_MVD_54MHZ (5 << 2) 235 #define CKG_MVD_43MHZ (6 << 2) //mempll_clk_buf_div2 236 #define CKG_MVD_XTAL_CLK (7 << 2) //XTAL clock 237 238 #define REG_CKG_MVD_CHROMA_A (REG_CHIPTOP_BASE + 0x3a*2) 239 #define CKG_MVD_CHROMA_A_GATED BIT0 240 #define CKG_MVD_CHROMA_A_INVERT BIT1 241 242 #define REG_CKG_MVD_CHROMA_B (REG_CHIPTOP_BASE + 0x3a*2) 243 #define CKG_MVD_CHROMA_B_GATED BIT2 244 #define CKG_MVD_CHROMA_B_INVERT BIT3 245 246 #define REG_CKG_MVD_CHROMA_C (REG_CHIPTOP_BASE + 0x3a*2) 247 #define CKG_MVD_CHROMA_C_GATED BIT4 248 #define CKG_MVD_CHROMA_C_INVERT BIT5 249 250 #define REG_CKG_MVD_LUMA_A (REG_CHIPTOP_BASE + 0x3a*2 + 1) 251 #define CKG_MVD_LUMA_A_GATED BIT0 252 #define CKG_MVD_LUMA_A_INVERT BIT1 253 254 #define REG_CKG_MVD_LUMA_B (REG_CHIPTOP_BASE + 0x3b*2) 255 #define CKG_MVD_LUMA_B_GATED BIT0 256 #define CKG_MVD_LUMA_B_INVERT BIT1 257 258 #define REG_CKG_MVD_LUMA_C (REG_CHIPTOP_BASE + 0x3b*2 + 1) 259 #define CKG_MVD_LUMA_C_GATED BIT0 260 #define CKG_MVD_LUMA_C_INVERT BIT1 261 262 #define REG_CKG_MVD_RMEM (REG_CHIPTOP_BASE + 0x3c*2) 263 #define CKG_MVD_RMEM_GATED BIT0 264 #define CKG_MVD_RMEM_INVERT BIT1 265 266 #define REG_CKG_MVD_RMEM1 (REG_CHIPTOP_BASE + 0x3c*2 + 1) 267 #define CKG_MVD_RMEM1_GATED BIT0 268 #define CKG_MVD_RMEM1_INVERT BIT1 269 270 #define REG_CKG_MVD_RREFDAT (REG_CHIPTOP_BASE + 0x3c*2 + 1) 271 #define CKG_MVD_RREFDAT_GATED BIT2 272 #define CKG_MVD_RREFDAT_INVERT BIT3 273 274 #define REG_CKG_VD_AEON (REG_CHIPTOP_BASE + 0x30*2) 275 #define CKG_VD_AEON_GATED BIT0 276 #define CKG_VD_AEON_INVERT BIT1 277 #define CKG_VD_AEON_MASK (BIT6 | BIT5 | BIT4 | BIT3 | BIT2) 278 #define CKG_VD_AEON_160MHZ (0 << 2) 279 //Notice: The clock 160M comes from UTMI. 280 //Please start UTMI's clock before you switch to 160M 281 #define CKG_VD_AEON_144MHZ (1 << 2) 282 #define CKG_VD_AEON_123MHZ (2 << 2) 283 #define CKG_VD_AEON_108MHZ (3 << 2) 284 #define CKG_VD_AEON_96MHZ (4 << 2) 285 #define CKG_VD_AEON_72MHZ (5 << 2) 286 #define CKG_VD_AEON_DISABLE0 (6 << 2) //disable 287 #define CKG_VD_AEON_DISABLE1 (7 << 2) //disable 288 #define CKG_VD_AEON_CLK_MCU (1 << 5) //01xxx 289 #define CKG_VD_AEON_CLK_MIU (2 << 5) //10xxx 290 #define CKG_VD_AEON_XTAL (3 << 5) //11xxx 291 292 #ifdef CONFIG_MSTAR_SRAMPD 293 #define PATGEN_REG_BASE 0x71200 294 #define REG_CODEC_SRAM_SD_EN (PATGEN_REG_BASE + 0x10*2) 295 #define SRAM_SD_EN_MVD BIT2 296 #endif 297 298 #define REG_CHIP_ID_MAJOR (CHIP_REG_BASE + 0xCC) 299 #define REG_CHIP_ID_MINOR (CHIP_REG_BASE + 0xCD) 300 #define REG_CHIP_VERSION (CHIP_REG_BASE + 0xCE) 301 #define REG_CHIP_REVISION (CHIP_REG_BASE + 0xCF) 302 303 #endif // _REG_MVD_H_ 304 305