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) 2006-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 95 #ifndef _REG_VBI_H 96 #define _REG_VBI_H 97 98 #define VBI_REG_BASE 0x3700UL // 0x3700 - 0x37FF 99 #define AFEC_REG_BASE 0x3500UL // 0x3500 - 0x35FF 100 #define CHIP_REG_BASE 0x1E00UL // 0x1E00 - 0x1EFF 101 #define ADC_ATOP_REG_BASE 0x2500UL // 0x2500 - 0x25FF 102 103 #define BK_REG_L( x, y ) ((x) | (((y) << 1))) 104 #define BK_REG_H( x, y ) (((x) | (((y) << 1))) + 1) 105 106 #define CC_BUF_BIT 28 107 #define TTX_BUF_BIT 28 108 //////////////////////////////////////////////////////////////////////////////// 109 // VBI register 110 //////////////////////////////////////////////////////////////////////////////// 111 #define BK_VBI_1D (VBI_REG_BASE+0x1D) 112 #define BK_VBI_2A (VBI_REG_BASE+0x2A) 113 #define BK_VBI_40 (VBI_REG_BASE+0x40) 114 #define BK_VBI_41 (VBI_REG_BASE+0x41) 115 #define BK_VBI_42 (VBI_REG_BASE+0x42) 116 #define BK_VBI_44 (VBI_REG_BASE+0x44) 117 #define BK_VBI_45 (VBI_REG_BASE+0x45) 118 #define BK_VBI_46 (VBI_REG_BASE+0x46) 119 #define BK_VBI_4A (VBI_REG_BASE+0x4A) 120 #define BK_VBI_4B (VBI_REG_BASE+0x4B) 121 #define BK_VBI_4D (VBI_REG_BASE+0x4D) 122 #define BK_VBI_4F (VBI_REG_BASE+0x4F) 123 #define BK_VBI_50 (VBI_REG_BASE+0x50) 124 #define BK_VBI_51 (VBI_REG_BASE+0x51) 125 #define BK_VBI_53 (VBI_REG_BASE+0x53) 126 #define BK_VBI_55 (VBI_REG_BASE+0x55) 127 #define BK_VBI_56 (VBI_REG_BASE+0x56) 128 #define BK_VBI_57 (VBI_REG_BASE+0x57) 129 #define BK_VBI_58 (VBI_REG_BASE+0x58) 130 #define BK_VBI_59 (VBI_REG_BASE+0x59) 131 #define BK_VBI_5A (VBI_REG_BASE+0x5A) 132 #define BK_VBI_5B (VBI_REG_BASE+0x5B) 133 #define BK_VBI_5C (VBI_REG_BASE+0x5C) 134 #define BK_VBI_5D (VBI_REG_BASE+0x5D) 135 #define BK_VBI_5E (VBI_REG_BASE+0x5E) 136 #define BK_VBI_5F (VBI_REG_BASE+0x5F) 137 #define BK_VBI_70 (VBI_REG_BASE+0x70) 138 #define BK_VBI_71 (VBI_REG_BASE+0x71) 139 #define BK_VBI_72 (VBI_REG_BASE+0x72) 140 #define BK_VBI_77 (VBI_REG_BASE+0x77) 141 #define BK_VBI_7C (VBI_REG_BASE+0x7C) 142 #define BK_VBI_7D (VBI_REG_BASE+0x7D) 143 #define BK_VBI_7E (VBI_REG_BASE+0x7E) 144 #define BK_VBI_7F (VBI_REG_BASE+0x7F) 145 #define BK_VBI_81 (VBI_REG_BASE+0x81) 146 #define BK_VBI_82 (VBI_REG_BASE+0x82) 147 #define BK_VBI_83 (VBI_REG_BASE+0x83) 148 #define BK_VBI_86 (VBI_REG_BASE+0x86) 149 #define BK_VBI_89 (VBI_REG_BASE+0x89) 150 #define BK_VBI_8A (VBI_REG_BASE+0x8A) 151 #define BK_VBI_8B (VBI_REG_BASE+0x8B) 152 #define BK_VBI_8D (VBI_REG_BASE+0x8D) 153 #define BK_VBI_90 (VBI_REG_BASE+0x90) 154 #define BK_VBI_91 (VBI_REG_BASE+0x91) 155 #define BK_VBI_92 (VBI_REG_BASE+0x92) 156 #define BK_VBI_99 (VBI_REG_BASE+0x99) 157 #define BK_VBI_9A (VBI_REG_BASE+0x9A) 158 #define BK_VBI_A6 (VBI_REG_BASE+0xA6) 159 #define BK_VBI_A7 (VBI_REG_BASE+0xA7) 160 #define BK_VBI_AD (VBI_REG_BASE+0xAD) 161 #define BK_VBI_AE (VBI_REG_BASE+0xAE) 162 #define BK_VBI_AF (VBI_REG_BASE+0xAF) 163 #define BK_VBI_B4 (VBI_REG_BASE+0xB4) 164 #define BK_VBI_B5 (VBI_REG_BASE+0xB5) 165 #define BK_VBI_B7 (VBI_REG_BASE+0xB7) 166 #define BK_VBI_B8 (VBI_REG_BASE+0xB8) 167 #define BK_VBI_BB (VBI_REG_BASE+0xBB) 168 #define BK_VBI_BF (VBI_REG_BASE+0xBF) 169 #define BK_VBI_C4 (VBI_REG_BASE+0xC4) 170 #define BK_VBI_CA (VBI_REG_BASE+0xCA) 171 #define BK_VBI_CB (VBI_REG_BASE+0xCB) 172 #define BK_VBI_CC (VBI_REG_BASE+0xCC) 173 #define BK_VBI_CD (VBI_REG_BASE+0xCD) 174 #define BK_VBI_CE (VBI_REG_BASE+0xCE) 175 #define BK_VBI_CF (VBI_REG_BASE+0xCF) 176 177 #define BK_VBI_DE (VBI_REG_BASE+0xDE) 178 #define BK_VBI_DF (VBI_REG_BASE+0xDF) 179 #define BK_VBI_E0 (VBI_REG_BASE+0xE0) 180 #define BK_VBI_E1 (VBI_REG_BASE+0xE1) 181 #define BK_VBI_E2 (VBI_REG_BASE+0xE2) 182 #define BK_VBI_E3 (VBI_REG_BASE+0xE3) 183 #define BK_VBI_E4 (VBI_REG_BASE+0xE4) 184 #define BK_VBI_E5 (VBI_REG_BASE+0xE5) 185 #define BK_VBI_E6 (VBI_REG_BASE+0xE6) 186 #define BK_VBI_E7 (VBI_REG_BASE+0xE7) 187 188 #define VBI_INTERRUPT_MASK 0x6C + (VBI_REG_BASE) 189 #define VBI_INTERRUPT_CLEAR 0x6D + (VBI_REG_BASE) 190 #define VBI_INTERRUPT_STATUS 0x6E + (VBI_REG_BASE) 191 #define VBI_INTERRUPT_RAW 0x6F + (VBI_REG_BASE) 192 193 #define VBI_VPS_COUNT 0xA5 + (VBI_REG_BASE) 194 #define VBI_WSS_COUNT 0xA5 + (VBI_REG_BASE) 195 196 //////////////////////////////////////////////////////////////////////////////// 197 // Other registers 198 //////////////////////////////////////////////////////////////////////////////// 199 #define BK_AFEC_6B (AFEC_REG_BASE + 0x6B) 200 #define BK_AFEC_CD (AFEC_REG_BASE + 0xCD) 201 #define L_BK_ADC_ATOP(x) BK_REG_L(ADC_ATOP_REG_BASE, x) 202 #define H_BK_ADC_ATOP(x) BK_REG_H(ADC_ATOP_REG_BASE, x) 203 #define L_BK_CHIPTOP(x) BK_REG_L(CHIP_REG_BASE, x) 204 #define H_BK_CHIPTOP(x) BK_REG_H(CHIP_REG_BASE, x) 205 206 /********************************************************************************/ 207 /* Start of Teletext Register definitions */ 208 /********************************************************************************/ 209 #define TT_ENABLE 0x10 + (VBI_REG_BASE) 210 211 // DMA and Tag Search Register 212 #define DMASRC_ADR_L 0x11 + (VBI_REG_BASE) // DMA Source Linear Address 213 #define DMASRC_ADR_M 0x12 + (VBI_REG_BASE) 214 #define DMASRC_ADR_H 0x13 + (VBI_REG_BASE) 215 216 #define DMADES_ADR_L 0x14 + (VBI_REG_BASE)// DMA Destination Linear Address 217 #define DMADES_ADR_M 0x15 + (VBI_REG_BASE) 218 #define DMADES_ADR_H 0x16 + (VBI_REG_BASE) 219 220 #define DMAQW_CNT_L 0x17 + (VBI_REG_BASE)// DMA Block Move Count 221 #define DMAQW_CNT_H 0x18 + (VBI_REG_BASE) 222 223 #define DMA_FUNC 0x19 + (VBI_REG_BASE)// DMA Function Seletction 224 #define DMA_HEADER 0x01 225 #define DMA_PACKET1_TO_25 0x02 226 #define DMA_BTT 0x04 227 #define DMA_AIT 0x05 228 #define DMA_MCU_READ 0x0D 229 #define DMA_MCU_WRITE 0x0E 230 #define DMA_PACKET26_28_29 0x03 231 #define DMA_PACKET27 0x06 232 #define DMA_TAG_READ 0x1D 233 #define DMA_TAG_WRITE 0x1E 234 #define DMA_ERASE 0x1F 235 236 #define DMA_COMMAND 0x1A + (VBI_REG_BASE) 237 #define DMA_READY _BIT1 238 #define DMA_FIRE _BIT0 239 240 #define DMAERASE_DATA 0x1B + (VBI_REG_BASE) 241 242 #define VBI_BIT24_ADDR 0x1D + (VBI_REG_BASE) 243 #define CCBASE_ADDR24 _BIT7 244 #define TTBASE_ADDR24 _BIT6 245 #define DMASRC_ADDR24 _BIT5 246 #define DMADES_ADDR24 _BIT4 247 #define TAGBASE_ADDR24 _BIT2 248 #define PAGEBASE_ADDR24 _BIT1 249 #define TTBASE2_ADDR24 _BIT0 250 251 #define TTDEC_COMMAND 0x1F + (VBI_REG_BASE) 252 253 #define TTDEC_STATIS 0x20 + (VBI_REG_BASE) 254 #define VBIREADY _BIT7 255 256 #define SLICERREADY 0x21 + (VBI_REG_BASE) 257 258 #define MCU_ADDR_PORT 0x22 + (VBI_REG_BASE) 259 #define BURST_RD_MD _BIT7 260 #define BURST_WR_MD _BIT6 261 262 263 #define MCU_DATA_PORT 0x23 + (VBI_REG_BASE) 264 265 #define TAGRW_POS_L 0x24 + (VBI_REG_BASE) 266 #define TAGRW_POS_H 0x25 + (VBI_REG_BASE) 267 268 #define PAGEBUF_ADDR_L 0x26 + (VBI_REG_BASE) 269 #define PAGEBUF_ADDR_M 0x27 + (VBI_REG_BASE) 270 #define PAGEBUF_ADDR_H 0x28 + (VBI_REG_BASE) 271 272 #define PAGEBUF_CNT_L 0x29 + (VBI_REG_BASE) 273 #define PAGEBUF_CNT_H 0x2A + (VBI_REG_BASE) 274 275 #define FUNCTION 0x2B + (VBI_REG_BASE) 276 277 #define TAG_MAGAZINE 0x2C + (VBI_REG_BASE) 278 #define TAG_PAGE 0x2D + (VBI_REG_BASE) 279 #define TAG_SUBCODE_H 0x2E + (VBI_REG_BASE) 280 #define TAG_SUBCODE_L 0x2F + (VBI_REG_BASE) 281 282 283 #define TAG_BASE_L 0x30 + (VBI_REG_BASE) 284 #define TAG_BASE_H 0x31 + (VBI_REG_BASE) 285 286 #define PAGE_BASE_L 0x32 + (VBI_REG_BASE) 287 #define PAGE_BASE_H 0x33 + (VBI_REG_BASE) 288 289 #define PAGE_SIZE 0x34 + (VBI_REG_BASE) // Per 8 Bytes 290 291 #define TAG_PHT_SIZE_L 0x35 + (VBI_REG_BASE) 292 #define TAG_PHT_SIZE_H 0x36 + (VBI_REG_BASE) 293 294 295 #define TAG_COMMAND 0x37 + (VBI_REG_BASE) 296 #define BUF_ADDR_RDY _BIT3 297 #define HIT_STATUS _BIT2 298 #define TAG_READY _BIT1 299 #define TAG_FIRE _BIT0 300 301 302 #define VBI_BASEADDR_L 0x38 + (VBI_REG_BASE) 303 #define VBI_BASEADDR_M 0x39 + (VBI_REG_BASE) 304 #define VBI_BASEADDR_H 0x3A + (VBI_REG_BASE) 305 #define VBI_BUF_LEN 0x3B + (VBI_REG_BASE) 306 #define VBI_BUF_LEN_H 0x3C + (VBI_REG_BASE) 307 308 #define VBI_W_COUNT 0x3D + (VBI_REG_BASE) 309 #define VBI_PKTCNT_L 0x3D + (VBI_REG_BASE) 310 311 312 #define TT_LineUpdDef 0x72 + (VBI_REG_BASE) 313 #define TT_DAT_LN_STR1 0x7C + (VBI_REG_BASE) 314 #define TT_DAT_LN_END1 0x7D + (VBI_REG_BASE) 315 #define TT_DAT_LN_STR2 0x7E + (VBI_REG_BASE) 316 #define TT_DAT_LN_END2 0x7F + (VBI_REG_BASE) 317 #define TTSLCTHRD 0x8D + (VBI_REG_BASE) 318 319 #define TT_CLK_RUN_IN_START_POINT 0x77 + (VBI_REG_BASE) 320 321 #endif 322 323