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 95 /////////////////////////////////////////////////////////////////////////////////////////////////// 96 /// 97 /// file regVPU.h 98 /// @brief VPU Module Register Definition 99 /// @author MStar Semiconductor Inc. 100 /////////////////////////////////////////////////////////////////////////////////////////////////// 101 102 #ifndef _REG_VPU_H_ 103 #define _REG_VPU_H_ 104 105 //#include "MsCommon.h" 106 107 #ifndef BMASK 108 #define BIT(_bit_) (1 << (_bit_)) 109 #define BITS(_bits_, _val_) ((BIT(((1)?_bits_)+1)-BIT(((0)?_bits_))) & (_val_<<((0)?_bits_))) 110 #define BMASK(_bits_) (BIT(((1)?_bits_)+1)-BIT(((0)?_bits_))) 111 #endif 112 113 #ifndef READ_BYTE 114 #define READ_BYTE(_reg) (*(volatile MS_U8*)(_reg)) 115 #define READ_WORD(_reg) (*(volatile MS_U16*)(_reg)) 116 #define READ_LONG(_reg) (*(volatile MS_U32*)(_reg)) 117 #define WRITE_BYTE(_reg, _val) { (*((volatile MS_U8*)(_reg))) = (MS_U8)(_val); } 118 #define WRITE_WORD(_reg, _val) { (*((volatile MS_U16*)(_reg))) = (MS_U16)(_val); } 119 #define WRITE_LONG(_reg, _val) { (*((volatile MS_U32*)(_reg))) = (MS_U32)(_val); } 120 #endif 121 122 //------------------------------------------------------------------------------------------------- 123 // Hardware Capability 124 //------------------------------------------------------------------------------------------------- 125 126 127 //------------------------------------------------------------------------------------------------- 128 // Macro and Define 129 //------------------------------------------------------------------------------------------------- 130 131 //***************************************************************************** 132 // RIU macro 133 #define VPU_MACRO_START do { 134 #define VPU_MACRO_END } while (0) 135 #define VPU_RIU_BASE u32VPURegOSBase 136 137 #define VPU_HIGHBYTE(u16) ((MS_U8)((u16) >> 8)) 138 #define VPU_LOWBYTE(u16) ((MS_U8)(u16)) 139 #define VPU_RIU_READ_BYTE(addr) ( READ_BYTE( VPU_RIU_BASE + (addr) ) ) 140 #define VPU_RIU_READ_WORD(addr) ( READ_WORD( VPU_RIU_BASE + (addr) ) ) 141 #define VPU_RIU_WRITE_BYTE(addr, val) { WRITE_BYTE( VPU_RIU_BASE+(addr), val); } 142 #define VPU_RIU_WRITE_WORD(addr, val) { WRITE_WORD( VPU_RIU_BASE+(addr), val); } 143 144 145 #define _VPU_ReadByte( u32Reg ) VPU_RIU_READ_BYTE(((u32Reg) << 1) - ((u32Reg) & 1)) 146 147 #define _VPU_Read2Byte( u32Reg ) (VPU_RIU_READ_WORD((u32Reg)<<1)) 148 149 #define _VPU_Read4Byte( u32Reg ) ( (MS_U32)VPU_RIU_READ_WORD((u32Reg)<<1) | ((MS_U32)VPU_RIU_READ_WORD(((u32Reg)+2)<<1)<<16 ) ) 150 151 #define _VPU_ReadRegBit( u32Reg, u8Mask ) (VPU_RIU_READ_BYTE(((u32Reg)<<1) - ((u32Reg) & 1)) & (u8Mask)) 152 153 #define _VPU_ReadWordBit( u32Reg, u16Mask ) (_VPU_Read2Byte( u32Reg ) & (u16Mask)) 154 155 #define _VPU_WriteRegBit( u32Reg, bEnable, u8Mask ) \ 156 VPU_MACRO_START \ 157 VPU_RIU_WRITE_BYTE( (((u32Reg) <<1) - ((u32Reg) & 1)) , (bEnable) ? (VPU_RIU_READ_BYTE( (((u32Reg) <<1) - ((u32Reg) & 1)) ) | (u8Mask)) : \ 158 (VPU_RIU_READ_BYTE( (((u32Reg) <<1) - ((u32Reg) & 1)) ) & ~(u8Mask))); \ 159 VPU_MACRO_END 160 161 #define _VPU_WriteByte( u32Reg, u8Val ) \ 162 VPU_MACRO_START \ 163 VPU_RIU_WRITE_BYTE(((u32Reg) << 1) - ((u32Reg) & 1), u8Val); \ 164 VPU_MACRO_END 165 166 #define _VPU_Write2Byte( u32Reg, u16Val ) \ 167 VPU_MACRO_START \ 168 if ( ((u32Reg) & 0x01) ) \ 169 { \ 170 VPU_RIU_WRITE_BYTE(((u32Reg) << 1) - 1, (MS_U8)((u16Val))); \ 171 VPU_RIU_WRITE_BYTE(((u32Reg) + 1) << 1, (MS_U8)((u16Val) >> 8)); \ 172 } \ 173 else \ 174 { \ 175 VPU_RIU_WRITE_WORD( ((u32Reg)<<1) , u16Val); \ 176 } \ 177 VPU_MACRO_END 178 179 #define _VPU_Write3Byte( u32Reg, u32Val ) \ 180 if ((u32Reg) & 0x01) \ 181 { \ 182 VPU_RIU_WRITE_BYTE((u32Reg << 1) - 1, u32Val); \ 183 VPU_RIU_WRITE_WORD( (u32Reg + 1)<<1 , ((u32Val) >> 8)); \ 184 } \ 185 else \ 186 { \ 187 VPU_RIU_WRITE_WORD( (u32Reg) << 1, u32Val); \ 188 VPU_RIU_WRITE_BYTE( (u32Reg + 2) << 1 , ((u32Val) >> 16)); \ 189 } 190 191 #define _VPU_Write4Byte( u32Reg, u32Val ) \ 192 VPU_MACRO_START \ 193 if ((u32Reg) & 0x01) \ 194 { \ 195 VPU_RIU_WRITE_BYTE( ((u32Reg) << 1) - 1 , u32Val); \ 196 VPU_RIU_WRITE_WORD( ((u32Reg) + 1)<<1 , ( (u32Val) >> 8)); \ 197 VPU_RIU_WRITE_BYTE( (((u32Reg) + 3) << 1) , ((u32Val) >> 24)); \ 198 } \ 199 else \ 200 { \ 201 VPU_RIU_WRITE_WORD( (u32Reg) <<1 , u32Val); \ 202 VPU_RIU_WRITE_WORD( ((u32Reg) + 2)<<1 , ((u32Val) >> 16)); \ 203 } \ 204 VPU_MACRO_END 205 206 #define _VPU_WriteByteMask( u32Reg, u8Val, u8Msk ) \ 207 VPU_MACRO_START \ 208 VPU_RIU_WRITE_BYTE( (((u32Reg) <<1) - ((u32Reg) & 1)), (VPU_RIU_READ_BYTE((((u32Reg) <<1) - ((u32Reg) & 1))) & ~(u8Msk)) | ((u8Val) & (u8Msk))); \ 209 VPU_MACRO_END 210 211 #define _VPU_WriteWordMask( u32Reg, u16Val , u16Msk) \ 212 VPU_MACRO_START \ 213 if ( ((u32Reg) & 0x01) ) \ 214 { \ 215 if ((u16Msk)&0xff00) _VPU_WriteByteMask( ((u32Reg)+1) , (((u16Val) & 0xff00)>>8) , (((u16Msk)&0xff00)>>8) ); \ 216 _VPU_WriteByteMask( (u32Reg) , ((u16Val) & 0x00ff) , ((u16Msk)&0x00ff) ); \ 217 } \ 218 else \ 219 { \ 220 VPU_RIU_WRITE_WORD( ((u32Reg)<<1) , (((u16Val) & (u16Msk)) | (_VPU_Read2Byte( u32Reg ) & (~( u16Msk )))) ); \ 221 } \ 222 VPU_MACRO_END 223 224 225 226 //------------------------------------------------------------------------------ 227 // VPU Reg 228 //------------------------------------------------------------------------------ 229 // on kano, pVPUHalContext->_stCtx[0] for VPU_EVDR2 and pVPUHalContext->_stCtx[1] for VPU_EVDR2_LITE 230 #define VPU_EVDR2 0 231 #define VPU_EVDR2_LITE 1 232 233 #define REG_VPU_BASE (0x0300) 234 #define REG_MBX_BASE (0x0400) 235 #define REG_VPU_LITE_BASE (0x12700) 236 #define REG_MBX_LITE_BASE (0x12800) 237 238 #define VPU_BASE(vpu) ((vpu==VPU_EVDR2)?(REG_VPU_BASE):(REG_VPU_LITE_BASE)) 239 #define MBX_BASE(vpu) ((vpu==VPU_EVDR2)?(REG_MBX_BASE):(REG_MBX_LITE_BASE)) 240 241 #ifdef HAL_FEATURE_MAU // abandoned, no mau on kano 242 #define REG_MAU1_BASE (0x0400) 243 #define REG_MAU1_LV2_0_BASE (0x63500) 244 #define REG_MAU1_LV2_1_BASE (0x63600) 245 #define REG_MAU1_LITE_BASE (0x0400) 246 #define REG_MAU1_LITE_LV2_0_BASE (0x63500) 247 #define REG_MAU1_LITE_LV2_1_BASE (0x63600) 248 249 #define MAU1_BASE(vpu) ((vpu==VPU_EVDR2)?(REG_MAU1_BASE):(REG_MAU1_LITE_BASE)) 250 #define MAU1_LV2_0_BASE(vpu) ((vpu==VPU_EVDR2)?(REG_MAU1_LV2_0_BASE):(REG_MAU1_LITE_LV2_0_BASE)) 251 #define MAU1_LV2_1_BASE(vpu) ((vpu==VPU_EVDR2)?(REG_MAU1_LV2_1_BASE):(REG_MAU1_LITE_LV2_1_BASE)) 252 #endif 253 254 255 256 //write back stage PC 257 #define VPU_REG_EXPC_L(vpu) (VPU_BASE(vpu)+(0x000a<<1)) 258 #define VPU_REG_EXPC_H(vpu) (VPU_BASE(vpu)+(0x000b<<1)) 259 260 #define VPU_REG_ICU_STATUS(vpu) (VPU_BASE(vpu)+(0x001f<<1)) 261 #define VPU_REG_ICU_IDLE BIT(1) 262 #define VPU_REG_ISB_IDLE BIT(8) 263 264 #define VPU_REG_DCU_DBG_SEL(vpu) (VPU_BASE(vpu)+(0x0028<<1)) 265 #define VPU_REG_DCU_DBG_SEL_0 BIT(2) 266 #define VPU_REG_DCU_DBG_SEL_1 BIT(3) 267 #define VPU_REG_DCU_STATUS(vpu) (VPU_BASE(vpu)+(0x0029<<1)) 268 #define VPU_REG_BIU_EMPTY BIT(11) 269 270 #define VPU_REG_CPU_SETTING(vpu) (VPU_BASE(vpu)+(0x0040<<1)) 271 #define VPU_REG_CPU_R2_EN BIT(0) 272 #define VPU_REG_CPU_SW_RSTZ BIT(1) 273 #define VPU_REG_CPU_MIU_SW_RSTZ BIT(2) 274 #define VPU_REG_CPU_RIU_SW_RSTZ BIT(3) 275 #define VPU_REG_CPU_SPI_BOOT BIT(4) 276 #define VPU_REG_CPU_SDRAM_BOOT BIT(5) 277 #define VPU_REG_CPU_R2_INTO BIT(6) 278 #define VPU_REG_CPU_DBG_ON_DCU BIT(8) 279 #define VPU_REG_CPU_DBG_ON_ICU BIT(9) 280 #define VPU_REG_CPU_DBG_CLK_SEL BIT(10) 281 #define VPU_REG_CPU_DBG_CLK_TOGGLE BIT(11) 282 283 #define VPU_REG_ICU_SDR_BASE_L(vpu) (VPU_BASE(vpu)+(0x0041<<1)) //byte address 284 #define VPU_REG_ICU_SDR_BASE_H(vpu) (VPU_BASE(vpu)+(0x0042<<1)) 285 #define VPU_REG_DCU_SDR_BASE_L(vpu) (VPU_BASE(vpu)+(0x0043<<1)) //byte address 286 #define VPU_REG_DCU_SDR_BASE_H(vpu) (VPU_BASE(vpu)+(0x0044<<1)) 287 288 #define VPU_REG_SPI_BASE(vpu) (VPU_BASE(vpu)+(0x0048<<1)) //REG ACCESS BASE32 289 290 291 #define VPU_REG_IQMEM_BASE_L(vpu) (VPU_BASE(vpu)+(0x0049<<1)) 292 #define VPU_REG_IQMEM_BASE_H(vpu) (VPU_BASE(vpu)+(0x004a<<1)) 293 #define VPU_REG_IQMEM_MASK_L(vpu) (VPU_BASE(vpu)+(0x004b<<1)) 294 #define VPU_REG_IQMEM_MASK_H(vpu) (VPU_BASE(vpu)+(0x004c<<1)) 295 296 #define VPU_REG_DQMEM_BASE_L(vpu) (VPU_BASE(vpu)+(0x004d<<1)) 297 #define VPU_REG_DQMEM_BASE_H(vpu) (VPU_BASE(vpu)+(0x004e<<1)) 298 #define VPU_REG_DQMEM_MASK_L(vpu) (VPU_BASE(vpu)+(0x004f<<1)) 299 #define VPU_REG_DQMEM_MASK_H(vpu) (VPU_BASE(vpu)+(0x0050<<1)) 300 301 #define VPU_REG_PQMEM_BASE_L(vpu) (VPU_BASE(vpu)+(0x0051<<1)) 302 #define VPU_REG_PQMEM_BASE_H(vpu) (VPU_BASE(vpu)+(0x0052<<1)) 303 #define VPU_REG_PQMEM_MASK_L(vpu) (VPU_BASE(vpu)+(0x0053<<1)) 304 #define VPU_REG_PQMEM_MASK_H(vpu) (VPU_BASE(vpu)+(0x0054<<1)) 305 #define VPU_REG_IQMEM_SETTING(vpu) (VPU_BASE(vpu)+(0x0064<<1)) 306 #define VPU_REG_VQMEM_BASE_L(vpu) (VPU_BASE(vpu)+(0x0067<<1)) 307 #define VPU_REG_VQMEM_BASE_H(vpu) (VPU_BASE(vpu)+(0x0068<<1)) 308 #define VPU_REG_VQMEM_MASK_L(vpu) (VPU_BASE(vpu)+(0x0069<<1)) 309 #define VPU_REG_VQMEM_MASK_H(vpu) (VPU_BASE(vpu)+(0x006a<<1)) 310 #define VPU_REG_CPU_CONFIG(vpu) (VPU_BASE(vpu)+(0x006b<<1)) 311 #define VPU_REG_CPU_STALL_EN BIT(15) 312 313 #define VPU_REG_QMEM_OWNER(vpu) (VPU_BASE(vpu)+(0x006c<<1)) 314 315 #define VPU_REG_IO0_BASE(vpu) (VPU_BASE(vpu)+(0x0045<<1)) //RIU 316 #define VPU_REG_IO1_BASE(vpu) (VPU_BASE(vpu)+(0x0055<<1)) //R2 internal UART 317 #define VPU_REG_IO2_BASE(vpu) (VPU_BASE(vpu)+(0x0056<<1)) //R2 read SPI 318 #define VPU_REG_IO3_BASE(vpu) (VPU_BASE(vpu)+(0x0057<<1)) //IP use 319 #define VPU_REG_CONTROL_SET(vpu) (VPU_BASE(vpu)+(0x0058<<1)) 320 321 #define VPU_REG_R2_MI_SEL_BASE(vpu) (VPU_BASE(vpu)+(0x0072<<1)) 322 323 #define VPU_REG_IO0_EN BIT(0) //default Enable 324 #define VPU_REG_IO1_EN BIT(1) //default Enable 325 #define VPU_REG_IO2_EN BIT(2) 326 #define VPU_REG_IO3_EN BIT(3) 327 #define VPU_REG_QMEM_SPACE_EN BIT(4) 328 #define VPU_REG_MMU_IO_EN BIT(5) 329 #define VPU_REG_WMB_FORCE_OFF BIT(6) 330 #define VPU_REG_WMB_AUTO_OFF BIT(7) 331 #define VPU_REG_PQMEM_SPACE_EN BIT(13) 332 #define VPU_REG_VQMEM_SPACE_EN BIT(14) 333 334 335 336 #define VPU_REG_VERSION(vpu) (MBX_BASE(vpu)+(0x0055<<1)) 337 338 #define VPU_REG_HI_MBOX0_L(vpu) (MBX_BASE(vpu)+(0x005b<<1)) 339 #define VPU_REG_HI_MBOX0_H(vpu) (MBX_BASE(vpu)+(0x005c<<1)) 340 #define VPU_REG_HI_MBOX1_L(vpu) (MBX_BASE(vpu)+(0x005d<<1)) 341 #define VPU_REG_HI_MBOX1_H(vpu) (MBX_BASE(vpu)+(0x005e<<1)) 342 343 #define VPU_REG_HI_MBOX_SET(vpu) (MBX_BASE(vpu)+(0x005f<<1)) 344 #define VPU_REG_HI_MBOX0_SET BIT(0) 345 #define VPU_REG_HI_MBOX1_SET BIT(1) 346 347 #define VPU_REG_RISC_MBOX_CLR(vpu) (MBX_BASE(vpu)+(0x0067<<1)) 348 #define VPU_REG_RISC_MBOX0_CLR BIT(0) 349 #define VPU_REG_RISC_MBOX1_CLR BIT(1) 350 #define VPU_REG_RISC_ISR_CLR BIT(2) 351 #define VPU_REG_RISC_ISR_MSK BIT(6) 352 #define VPU_REG_RISC_ISR_FORCE BIT(10) 353 354 #define VPU_REG_RISC_MBOX_RDY(vpu) (MBX_BASE(vpu)+( 0x0068<<1)) 355 #define VPU_REG_RISC_MBOX0_RDY BIT(0) 356 #define VPU_REG_RISC_MBOX1_RDY BIT(1) 357 #define VPU_REG_RISC_ISR_VALID BIT(2) 358 359 #define VPU_REG_HI_MBOX_RDY(vpu) (MBX_BASE(vpu)+(0x0069<<1)) 360 #define VPU_REG_HI_MBOX0_RDY BIT(0) 361 #define VPU_REG_HI_MBOX1_RDY BIT(1) 362 363 #define VPU_REG_RISC_MBOX0_L(vpu) (MBX_BASE(vpu)+(0x006b<<1)) 364 #define VPU_REG_RISC_MBOX0_H(vpu) (MBX_BASE(vpu)+(0x006c<<1)) 365 #define VPU_REG_RISC_MBOX1_L(vpu) (MBX_BASE(vpu)+(0x006d<<1)) 366 #define VPU_REG_RISC_MBOX1_H(vpu) (MBX_BASE(vpu)+(0x006e<<1)) 367 368 369 370 #ifdef HAL_FEATURE_MAU // abandoned, no mau on kano 371 #define MAU1_CPU_RST(vpu) (MAU1_BASE(vpu)+(0x0002<<1)) 372 #define MAU1_REG_SW_RESET BIT(0) 373 374 #define MAU1_ARB0_DBG0(vpu) (MAU1_BASE(vpu)+(0x0008<<1)) 375 #define MAU1_ARB1_DBG0(vpu) (MAU1_BASE(vpu)+(0x000a<<1)) 376 #define MAU1_FSM_CS_MASK BMASK(13:9) 377 #define MAU1_FSM_CS_IDLE BITS(13:9,1) 378 379 #define MAU1_MIU_SEL(vpu) (MAU1_BASE(vpu)+(0x0001<<1)) 380 381 #define MAU1_LV2_0_MIU_SEL(vpu) (MAU1_LV2_0_BASE(vpu)+(0x0001<<1)) 382 383 #define MAU1_LV2_1_MIU_SEL(vpu) (MAU1_LV2_1_BASE(vpu)+(0x0001<<1)) 384 #endif 385 386 387 388 //------------------------------------------------------------------------------ 389 // ChipTop Reg 390 //------------------------------------------------------------------------------ 391 392 #define CHIPTOP_REG_BASE (0x1E00) 393 #define CLKGEN0_REG_BASE (0x0B00) 394 #define CLKGEN2_REG_BASE (0x0A00) 395 396 #define REG_TOP_VPU (CLKGEN0_REG_BASE+(0x0030<<1)) 397 #define TOP_CKG_VPU_MASK BMASK(6:0) 398 #define TOP_CKG_VPU_DIS BIT(0) 399 #define TOP_CKG_VPU_INV BIT(1) 400 #define TOP_CKG_VPU_CLK_MASK BMASK(6:2) 401 402 #ifdef CONFIG_MSTAR_SRAMPD 403 #define REG_PATGEN_BASE 0x71200 404 #define REG_PATGEN_VP9_BASE 0x71800 405 #define REG_CODEC_SRAM_SD_EN (REG_PATGEN_BASE+((0x0010)<<1)) 406 #define CODEC_SRAM_HVD_R2 BIT(4) 407 #define CODEC_SRAM_HVD_R2_MIU0_BWP BIT(5) 408 #define CODEC_SRAM_HVD_R2_MIU1_BWP BIT(6) 409 #define REG_HICODEC_LITE_SRAM_SD_EN (REG_PATGEN_VP9_BASE+((0x0010)<<1)) 410 #define HICODEC_LITE_SRAM_HICODEC0 BIT(0) 411 #define HICODEC_LITE_SRAM_HICODEC1 BIT(1) 412 #endif 413 414 //------------------------------------------------------------------------------ 415 // MIU Reg 416 //------------------------------------------------------------------------------ 417 //------------------------------------------------------------------------------ 418 // MIU Reg 419 //------------------------------------------------------------------------------ 420 #define MIU0_REG_HVD_BASE (0x1200) 421 #define MIU0_REG_HVD_BASE2 (0x61500) 422 423 #define MIU1_REG_HVD_BASE (0x0600) 424 #define MIU1_REG_HVD_BASE2 (0x62200) 425 426 #define MIU2_REG_HVD_BASE (0x62000) 427 #define MIU2_REG_HVD_BASE2 (0x62300) 428 429 #define MIU0_REG_RQ0_MASK (MIU0_REG_HVD_BASE+(( 0x0023)<<1)) 430 #define MIU0_REG_RQ1_MASK (MIU0_REG_HVD_BASE+(( 0x0033)<<1)) 431 #define MIU0_REG_RQ2_MASK (MIU0_REG_HVD_BASE+(( 0x0043)<<1)) 432 #define MIU0_REG_RQ3_MASK (MIU0_REG_HVD_BASE+(( 0x0053)<<1)) 433 #define MIU0_REG_RQ4_MASK (MIU0_REG_HVD_BASE2+(( 0x0003)<<1)) 434 #define MIU0_REG_RQ5_MASK (MIU0_REG_HVD_BASE2+(( 0x0013)<<1)) 435 436 #define MIU1_REG_RQ0_MASK (MIU1_REG_HVD_BASE+(( 0x0023)<<1)) 437 #define MIU1_REG_RQ1_MASK (MIU1_REG_HVD_BASE+(( 0x0033)<<1)) 438 #define MIU1_REG_RQ2_MASK (MIU1_REG_HVD_BASE+(( 0x0043)<<1)) 439 #define MIU1_REG_RQ3_MASK (MIU1_REG_HVD_BASE+(( 0x0053)<<1)) 440 #define MIU1_REG_RQ4_MASK (MIU1_REG_HVD_BASE2+(( 0x0003)<<1)) 441 #define MIU1_REG_RQ5_MASK (MIU1_REG_HVD_BASE2+(( 0x0013)<<1)) 442 443 #define MIU2_REG_RQ0_MASK (MIU2_REG_HVD_BASE+(( 0x0023)<<1)) 444 #define MIU2_REG_RQ1_MASK (MIU2_REG_HVD_BASE+(( 0x0033)<<1)) 445 #define MIU2_REG_RQ2_MASK (MIU2_REG_HVD_BASE+(( 0x0043)<<1)) 446 #define MIU2_REG_RQ3_MASK (MIU2_REG_HVD_BASE+(( 0x0053)<<1)) 447 #define MIU2_REG_RQ4_MASK (MIU2_REG_HVD_BASE2+(( 0x0003)<<1)) 448 #define MIU2_REG_RQ5_MASK (MIU2_REG_HVD_BASE2+(( 0x0013)<<1)) 449 450 451 #define MIU0_REG_SEL0 (MIU0_REG_HVD_BASE+(( 0x0078)<<1)) 452 #define MIU0_REG_SEL1 (MIU0_REG_HVD_BASE+(( 0x0079)<<1)) 453 #define MIU0_REG_SEL2 (MIU0_REG_HVD_BASE+(( 0x007A)<<1)) 454 #define MIU0_REG_SEL3 (MIU0_REG_HVD_BASE+(( 0x007B)<<1)) 455 #define MIU0_REG_SEL4 (MIU0_REG_HVD_BASE+(( 0x007C)<<1)) 456 #define MIU0_REG_SEL5 (MIU0_REG_HVD_BASE+(( 0x007D)<<1)) 457 458 #define MIU2_REG_SEL0 (MIU2_REG_HVD_BASE+(( 0x0078)<<1)) 459 #define MIU2_REG_SEL1 (MIU2_REG_HVD_BASE+(( 0x0079)<<1)) 460 #define MIU2_REG_SEL2 (MIU2_REG_HVD_BASE+(( 0x007A)<<1)) 461 #define MIU2_REG_SEL3 (MIU2_REG_HVD_BASE+(( 0x007B)<<1)) 462 #define MIU2_REG_SEL4 (MIU2_REG_HVD_BASE+(( 0x007C)<<1)) 463 #define MIU2_REG_SEL5 (MIU2_REG_HVD_BASE+(( 0x007D)<<1)) 464 465 466 //------------------------------------------------------------------------------------------------- 467 // Type and Structure 468 //------------------------------------------------------------------------------------------------- 469 470 471 472 473 #endif // _REG_VPU_H_ 474 475