1*53ee8cc1Swenshuai.xi //<MStar Software> 2*53ee8cc1Swenshuai.xi //****************************************************************************** 3*53ee8cc1Swenshuai.xi // MStar Software 4*53ee8cc1Swenshuai.xi // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. 5*53ee8cc1Swenshuai.xi // All software, firmware and related documentation herein ("MStar Software") are 6*53ee8cc1Swenshuai.xi // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by 7*53ee8cc1Swenshuai.xi // law, including, but not limited to, copyright law and international treaties. 8*53ee8cc1Swenshuai.xi // Any use, modification, reproduction, retransmission, or republication of all 9*53ee8cc1Swenshuai.xi // or part of MStar Software is expressly prohibited, unless prior written 10*53ee8cc1Swenshuai.xi // permission has been granted by MStar. 11*53ee8cc1Swenshuai.xi // 12*53ee8cc1Swenshuai.xi // By accessing, browsing and/or using MStar Software, you acknowledge that you 13*53ee8cc1Swenshuai.xi // have read, understood, and agree, to be bound by below terms ("Terms") and to 14*53ee8cc1Swenshuai.xi // comply with all applicable laws and regulations: 15*53ee8cc1Swenshuai.xi // 16*53ee8cc1Swenshuai.xi // 1. MStar shall retain any and all right, ownership and interest to MStar 17*53ee8cc1Swenshuai.xi // Software and any modification/derivatives thereof. 18*53ee8cc1Swenshuai.xi // No right, ownership, or interest to MStar Software and any 19*53ee8cc1Swenshuai.xi // modification/derivatives thereof is transferred to you under Terms. 20*53ee8cc1Swenshuai.xi // 21*53ee8cc1Swenshuai.xi // 2. You understand that MStar Software might include, incorporate or be 22*53ee8cc1Swenshuai.xi // supplied together with third party`s software and the use of MStar 23*53ee8cc1Swenshuai.xi // Software may require additional licenses from third parties. 24*53ee8cc1Swenshuai.xi // Therefore, you hereby agree it is your sole responsibility to separately 25*53ee8cc1Swenshuai.xi // obtain any and all third party right and license necessary for your use of 26*53ee8cc1Swenshuai.xi // such third party`s software. 27*53ee8cc1Swenshuai.xi // 28*53ee8cc1Swenshuai.xi // 3. MStar Software and any modification/derivatives thereof shall be deemed as 29*53ee8cc1Swenshuai.xi // MStar`s confidential information and you agree to keep MStar`s 30*53ee8cc1Swenshuai.xi // confidential information in strictest confidence and not disclose to any 31*53ee8cc1Swenshuai.xi // third party. 32*53ee8cc1Swenshuai.xi // 33*53ee8cc1Swenshuai.xi // 4. MStar Software is provided on an "AS IS" basis without warranties of any 34*53ee8cc1Swenshuai.xi // kind. Any warranties are hereby expressly disclaimed by MStar, including 35*53ee8cc1Swenshuai.xi // without limitation, any warranties of merchantability, non-infringement of 36*53ee8cc1Swenshuai.xi // intellectual property rights, fitness for a particular purpose, error free 37*53ee8cc1Swenshuai.xi // and in conformity with any international standard. You agree to waive any 38*53ee8cc1Swenshuai.xi // claim against MStar for any loss, damage, cost or expense that you may 39*53ee8cc1Swenshuai.xi // incur related to your use of MStar Software. 40*53ee8cc1Swenshuai.xi // In no event shall MStar be liable for any direct, indirect, incidental or 41*53ee8cc1Swenshuai.xi // consequential damages, including without limitation, lost of profit or 42*53ee8cc1Swenshuai.xi // revenues, lost or damage of data, and unauthorized system use. 43*53ee8cc1Swenshuai.xi // You agree that this Section 4 shall still apply without being affected 44*53ee8cc1Swenshuai.xi // even if MStar Software has been modified by MStar in accordance with your 45*53ee8cc1Swenshuai.xi // request or instruction for your use, except otherwise agreed by both 46*53ee8cc1Swenshuai.xi // parties in writing. 47*53ee8cc1Swenshuai.xi // 48*53ee8cc1Swenshuai.xi // 5. If requested, MStar may from time to time provide technical supports or 49*53ee8cc1Swenshuai.xi // services in relation with MStar Software to you for your use of 50*53ee8cc1Swenshuai.xi // MStar Software in conjunction with your or your customer`s product 51*53ee8cc1Swenshuai.xi // ("Services"). 52*53ee8cc1Swenshuai.xi // You understand and agree that, except otherwise agreed by both parties in 53*53ee8cc1Swenshuai.xi // writing, Services are provided on an "AS IS" basis and the warranty 54*53ee8cc1Swenshuai.xi // disclaimer set forth in Section 4 above shall apply. 55*53ee8cc1Swenshuai.xi // 56*53ee8cc1Swenshuai.xi // 6. Nothing contained herein shall be construed as by implication, estoppels 57*53ee8cc1Swenshuai.xi // or otherwise: 58*53ee8cc1Swenshuai.xi // (a) conferring any license or right to use MStar name, trademark, service 59*53ee8cc1Swenshuai.xi // mark, symbol or any other identification; 60*53ee8cc1Swenshuai.xi // (b) obligating MStar or any of its affiliates to furnish any person, 61*53ee8cc1Swenshuai.xi // including without limitation, you and your customers, any assistance 62*53ee8cc1Swenshuai.xi // of any kind whatsoever, or any information; or 63*53ee8cc1Swenshuai.xi // (c) conferring any license or right under any intellectual property right. 64*53ee8cc1Swenshuai.xi // 65*53ee8cc1Swenshuai.xi // 7. These terms shall be governed by and construed in accordance with the laws 66*53ee8cc1Swenshuai.xi // of Taiwan, R.O.C., excluding its conflict of law rules. 67*53ee8cc1Swenshuai.xi // Any and all dispute arising out hereof or related hereto shall be finally 68*53ee8cc1Swenshuai.xi // settled by arbitration referred to the Chinese Arbitration Association, 69*53ee8cc1Swenshuai.xi // Taipei in accordance with the ROC Arbitration Law and the Arbitration 70*53ee8cc1Swenshuai.xi // Rules of the Association by three (3) arbitrators appointed in accordance 71*53ee8cc1Swenshuai.xi // with the said Rules. 72*53ee8cc1Swenshuai.xi // The place of arbitration shall be in Taipei, Taiwan and the language shall 73*53ee8cc1Swenshuai.xi // be English. 74*53ee8cc1Swenshuai.xi // The arbitration award shall be final and binding to both parties. 75*53ee8cc1Swenshuai.xi // 76*53ee8cc1Swenshuai.xi //****************************************************************************** 77*53ee8cc1Swenshuai.xi //<MStar Software> 78*53ee8cc1Swenshuai.xi //////////////////////////////////////////////////////////////////////////////// 79*53ee8cc1Swenshuai.xi // 80*53ee8cc1Swenshuai.xi // Copyright (c) 2008-2009 MStar Semiconductor, Inc. 81*53ee8cc1Swenshuai.xi // All rights reserved. 82*53ee8cc1Swenshuai.xi // 83*53ee8cc1Swenshuai.xi // Unless otherwise stipulated in writing, any and all information contained 84*53ee8cc1Swenshuai.xi // herein regardless in any format shall remain the sole proprietary of 85*53ee8cc1Swenshuai.xi // MStar Semiconductor Inc. and be kept in strict confidence 86*53ee8cc1Swenshuai.xi // ("MStar Confidential Information") by the recipient. 87*53ee8cc1Swenshuai.xi // Any unauthorized act including without limitation unauthorized disclosure, 88*53ee8cc1Swenshuai.xi // copying, use, reproduction, sale, distribution, modification, disassembling, 89*53ee8cc1Swenshuai.xi // reverse engineering and compiling of the contents of MStar Confidential 90*53ee8cc1Swenshuai.xi // Information is unlawful and strictly prohibited. MStar hereby reserves the 91*53ee8cc1Swenshuai.xi // rights to any and all damages, losses, costs and expenses resulting therefrom. 92*53ee8cc1Swenshuai.xi // 93*53ee8cc1Swenshuai.xi //////////////////////////////////////////////////////////////////////////////// 94*53ee8cc1Swenshuai.xi 95*53ee8cc1Swenshuai.xi #ifndef _DEV_MVD_H_ 96*53ee8cc1Swenshuai.xi #define _DEV_MVD_H_ 97*53ee8cc1Swenshuai.xi 98*53ee8cc1Swenshuai.xi #include "mvd4_interface.h" //firmware header 99*53ee8cc1Swenshuai.xi #include "halVPU.h" 100*53ee8cc1Swenshuai.xi 101*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 102*53ee8cc1Swenshuai.xi // Macro and Define 103*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 104*53ee8cc1Swenshuai.xi 105*53ee8cc1Swenshuai.xi //#define MVD_ENABLE_ISR //unmark this to enable MVD ISR 106*53ee8cc1Swenshuai.xi 107*53ee8cc1Swenshuai.xi #ifndef __MDRV_TYPES_H__ 108*53ee8cc1Swenshuai.xi #define BIT0 BIT(0) 109*53ee8cc1Swenshuai.xi #define BIT1 BIT(1) 110*53ee8cc1Swenshuai.xi #define BIT2 BIT(2) 111*53ee8cc1Swenshuai.xi #define BIT3 BIT(3) 112*53ee8cc1Swenshuai.xi #define BIT4 BIT(4) 113*53ee8cc1Swenshuai.xi #define BIT5 BIT(5) 114*53ee8cc1Swenshuai.xi #define BIT6 BIT(6) 115*53ee8cc1Swenshuai.xi #define BIT7 BIT(7) 116*53ee8cc1Swenshuai.xi #endif 117*53ee8cc1Swenshuai.xi 118*53ee8cc1Swenshuai.xi #define H_DWORD(x) (MS_U8)(((x)>>24)&0xff) 119*53ee8cc1Swenshuai.xi #define L_DWORD(x) (MS_U8)(((x)>>16)&0xff) 120*53ee8cc1Swenshuai.xi #define H_WORD(x) (MS_U8)(((x)>>8 )&0xff) 121*53ee8cc1Swenshuai.xi #define L_WORD(x) (MS_U8)((x)&0xff) 122*53ee8cc1Swenshuai.xi #define COMBM16(hi,lo) ((((MS_U16)(hi))<<8) | ((MS_U16)(lo))) 123*53ee8cc1Swenshuai.xi #define COMBU32(hh,hl,lh,ll) ((((MS_U32)(hh))<<24) | (((MS_U32)(hl))<<16) | (((MS_U32)(lh))<<8) | ((MS_U32)(ll))) 124*53ee8cc1Swenshuai.xi #ifndef MemAlign 125*53ee8cc1Swenshuai.xi #define MemAlign(n, unit) ( (((n)+(unit)-1)/(unit)) * (unit) ) 126*53ee8cc1Swenshuai.xi #endif 127*53ee8cc1Swenshuai.xi 128*53ee8cc1Swenshuai.xi //Init command arguments 129*53ee8cc1Swenshuai.xi #define SETUP_CMDARG(x) \ 130*53ee8cc1Swenshuai.xi do { \ 131*53ee8cc1Swenshuai.xi x.Arg0 = 0; \ 132*53ee8cc1Swenshuai.xi x.Arg1 = 0; \ 133*53ee8cc1Swenshuai.xi x.Arg2 = 0; \ 134*53ee8cc1Swenshuai.xi x.Arg3 = 0; \ 135*53ee8cc1Swenshuai.xi x.Arg4 = 0; \ 136*53ee8cc1Swenshuai.xi x.Arg5 = 0; \ 137*53ee8cc1Swenshuai.xi } while(0) 138*53ee8cc1Swenshuai.xi 139*53ee8cc1Swenshuai.xi //Set command arguments 140*53ee8cc1Swenshuai.xi #define SET_CMDARG(cmd, u32val) \ 141*53ee8cc1Swenshuai.xi do { \ 142*53ee8cc1Swenshuai.xi cmd.Arg0 = L_WORD(u32val); \ 143*53ee8cc1Swenshuai.xi cmd.Arg1 = H_WORD(u32val); \ 144*53ee8cc1Swenshuai.xi cmd.Arg2 = L_DWORD(u32val); \ 145*53ee8cc1Swenshuai.xi cmd.Arg3 = H_DWORD(u32val); \ 146*53ee8cc1Swenshuai.xi cmd.Arg4 = 0; \ 147*53ee8cc1Swenshuai.xi cmd.Arg5 = 0; \ 148*53ee8cc1Swenshuai.xi } while(0) 149*53ee8cc1Swenshuai.xi 150*53ee8cc1Swenshuai.xi void HAL_MVD_RegSetBase(MS_U32 u32Base); 151*53ee8cc1Swenshuai.xi MS_U8 HAL_MVD_RegReadByte(MS_U32 u32Reg); 152*53ee8cc1Swenshuai.xi void HAL_MVD_RegWriteByte(MS_U32 u32Reg, MS_U8 u8Val); 153*53ee8cc1Swenshuai.xi void HAL_MVD_RegWriteBit(MS_U32 u32Reg, MS_BOOL bEnable, MS_U8 u8Mask); 154*53ee8cc1Swenshuai.xi void HAL_MVD_RegWriteByteMask(MS_U32 u32Reg, MS_U8 u8Val, MS_U8 u8Msk); 155*53ee8cc1Swenshuai.xi void HAL_MVD_RegWrite4Byte(MS_U32 u32Reg, MS_U32 u32Val); 156*53ee8cc1Swenshuai.xi 157*53ee8cc1Swenshuai.xi // Mutex function for HI interface 158*53ee8cc1Swenshuai.xi #define HAL_MVD_LockHiIfMutex() 159*53ee8cc1Swenshuai.xi #define HAL_MVD_UnlockHiIfMutex() 160*53ee8cc1Swenshuai.xi 161*53ee8cc1Swenshuai.xi #define HAL_MVD_SetVpuFwDecoder(x) HAL_VPU_SetFWDecoder(x) 162*53ee8cc1Swenshuai.xi 163*53ee8cc1Swenshuai.xi #define MVD_SUPPORT_MPEG2 0x01 164*53ee8cc1Swenshuai.xi #define MVD_SUPPORT_MPEG4 0x02 165*53ee8cc1Swenshuai.xi #define MVD_SUPPORT_VC1 0x04 166*53ee8cc1Swenshuai.xi 167*53ee8cc1Swenshuai.xi #define MVD_FW_VERSION FW_VERSION 168*53ee8cc1Swenshuai.xi #define MVD_FW_CODE_LEN (0x40000UL) //256K 169*53ee8cc1Swenshuai.xi #define MVD_SYNC_DONE 1 170*53ee8cc1Swenshuai.xi 171*53ee8cc1Swenshuai.xi typedef enum 172*53ee8cc1Swenshuai.xi { 173*53ee8cc1Swenshuai.xi E_MVD_VER_ERR = 0x0, 174*53ee8cc1Swenshuai.xi E_MVD_VER_4 = 0x1, 175*53ee8cc1Swenshuai.xi E_MVD_VER_5 = 0x10, 176*53ee8cc1Swenshuai.xi E_MVD_VER_6 = 0x100, 177*53ee8cc1Swenshuai.xi E_MVD_VER_MAX =0x11111111 178*53ee8cc1Swenshuai.xi } MVD_VER_Type; 179*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------// 180*53ee8cc1Swenshuai.xi //MVD Engine family description (from mvd4 ~ mvd ??) 181*53ee8cc1Swenshuai.xi //***** 182*53ee8cc1Swenshuai.xi //MVD 4 183*53ee8cc1Swenshuai.xi //==>T3 ,U3, JANUS,T4 ,U4 , K1, M10 184*53ee8cc1Swenshuai.xi // 185*53ee8cc1Swenshuai.xi //#define MVD_HW_VER E_MVD_VER_4 186*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_LENS 0x0FFFFFFF 187*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_SIZES 28 188*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_MASK 0xff 189*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT1 24 190*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT2 4 191*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_MASK 0x0007 192*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_LENS 8 193*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_SIZES 3 194*53ee8cc1Swenshuai.xi // 195*53ee8cc1Swenshuai.xi //MVD 5 196*53ee8cc1Swenshuai.xi //==>T8 ,T9, J2 ,T11 ,T12 ,T13 197*53ee8cc1Swenshuai.xi // 198*53ee8cc1Swenshuai.xi //#define MVD_HW_VER (E_MVD_VER_5|E_MVD_VER_4) 199*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_LENS 0x1FFFFFFF 200*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_SIZES 29 201*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_MASK 0x3f 202*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT1 26 203*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT2 3 204*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_MASK 0x000f 205*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_LENS 16 206*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_SIZES 4 207*53ee8cc1Swenshuai.xi // 208*53ee8cc1Swenshuai.xi //MVD 6 209*53ee8cc1Swenshuai.xi //==>A1 ,A2 ,A5 210*53ee8cc1Swenshuai.xi // 211*53ee8cc1Swenshuai.xi //#define MVD_HW_(E_MVD_VER_6|E_MVD_VER_5|E_MVD_VER_4) 212*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_LENS 0x1FFFFFFF 213*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_ENTRY_SIZES 29 214*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_MASK 0x3f 215*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT1 26 216*53ee8cc1Swenshuai.xi //#define MVD_SLQ_TBL_SHIFT_BIT2 3 217*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_MASK 0x000f 218*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_LENS 16 219*53ee8cc1Swenshuai.xi //#define MVD_TILE_MODE_PITCH_SIZES 4 220*53ee8cc1Swenshuai.xi // 221*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------// 222*53ee8cc1Swenshuai.xi #if defined(CHIP_MONET) 223*53ee8cc1Swenshuai.xi #define MVD_HW_VER (E_MVD_VER_6|E_MVD_VER_5|E_MVD_VER_4) 224*53ee8cc1Swenshuai.xi #define MVD_SLQ_TBL_ENTRY_LENS 0x7FFFFFFF 225*53ee8cc1Swenshuai.xi #define MVD_SLQ_TBL_ENTRY_SIZES 31 226*53ee8cc1Swenshuai.xi #define MVD_SLQ_TBL_SHIFT_MASK 0x0 227*53ee8cc1Swenshuai.xi #define MVD_SLQ_TBL_SHIFT_BIT1 0 228*53ee8cc1Swenshuai.xi #define MVD_SLQ_TBL_SHIFT_BIT2 0 229*53ee8cc1Swenshuai.xi #define MVD_TILE_MODE_MASK 0x000f 230*53ee8cc1Swenshuai.xi #define MVD_TILE_MODE_PITCH_LENS 16 231*53ee8cc1Swenshuai.xi #define MVD_TILE_MODE_PITCH_SIZES 4 232*53ee8cc1Swenshuai.xi #define MVD_SUPPORT_DHD 1 233*53ee8cc1Swenshuai.xi #else 234*53ee8cc1Swenshuai.xi #error "The CHIP version not verify yet ,Plz contact MVD owner !!" 235*53ee8cc1Swenshuai.xi #endif 236*53ee8cc1Swenshuai.xi 237*53ee8cc1Swenshuai.xi #ifdef REDLION_LINUX_KERNEL_ENVI 238*53ee8cc1Swenshuai.xi #if defined(CHIP_T3) 239*53ee8cc1Swenshuai.xi #define MVD_MIU1_BASE_ADDRESS 0x08000000UL//0x10000000UL 240*53ee8cc1Swenshuai.xi #else 241*53ee8cc1Swenshuai.xi #define MVD_MIU1_BASE_ADDRESS 0x08000000UL 242*53ee8cc1Swenshuai.xi #endif 243*53ee8cc1Swenshuai.xi #endif 244*53ee8cc1Swenshuai.xi 245*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 246*53ee8cc1Swenshuai.xi // Type and Structure 247*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 248*53ee8cc1Swenshuai.xi typedef enum 249*53ee8cc1Swenshuai.xi { 250*53ee8cc1Swenshuai.xi E_MVD_MMAP_FW = 0, //firmware 251*53ee8cc1Swenshuai.xi E_MVD_MMAP_BS = 1, //bitstream buffer 252*53ee8cc1Swenshuai.xi E_MVD_MMAP_FB = 2, //framebuffer 253*53ee8cc1Swenshuai.xi E_MVD_MMAP_ALL = 3, 254*53ee8cc1Swenshuai.xi E_MVD_MMAP_DRV = 4 //driver processing buffer 255*53ee8cc1Swenshuai.xi } MVD_MMAP_Type; 256*53ee8cc1Swenshuai.xi 257*53ee8cc1Swenshuai.xi 258*53ee8cc1Swenshuai.xi typedef struct _MVD_DrvCfg 259*53ee8cc1Swenshuai.xi { 260*53ee8cc1Swenshuai.xi MS_U32 u32fmVerNum;//firmware version number 261*53ee8cc1Swenshuai.xi MS_U16 u16fmSrcID; //firmware bin source id 262*53ee8cc1Swenshuai.xi MS_U8 u8fbMode; //framebuffer mode: HD or SD 263*53ee8cc1Swenshuai.xi } MVD_DrvCfg; 264*53ee8cc1Swenshuai.xi 265*53ee8cc1Swenshuai.xi #if 0 266*53ee8cc1Swenshuai.xi typedef struct _MVD_HWCfg 267*53ee8cc1Swenshuai.xi { 268*53ee8cc1Swenshuai.xi MS_U32 MVD_HWVER; 269*53ee8cc1Swenshuai.xi MS_U32 u32MvdSlqTabLens; 270*53ee8cc1Swenshuai.xi MS_U32 u32MvdSlqTabSizes; 271*53ee8cc1Swenshuai.xi MS_U32 u32MvdSlqTabShiftMask; 272*53ee8cc1Swenshuai.xi MS_U32 u32MvdSlqTabShiftBit1; 273*53ee8cc1Swenshuai.xi MS_U32 u32MvdSlqTabShiftBit2; 274*53ee8cc1Swenshuai.xi 275*53ee8cc1Swenshuai.xi MS_U16 u16MvdTileModeMask; 276*53ee8cc1Swenshuai.xi MS_U16 u16MvdTileModePitchLens; 277*53ee8cc1Swenshuai.xi MS_U16 u16MvdTileModePitchSize; 278*53ee8cc1Swenshuai.xi 279*53ee8cc1Swenshuai.xi } MVD_HWCfg; 280*53ee8cc1Swenshuai.xi #endif 281*53ee8cc1Swenshuai.xi 282*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 283*53ee8cc1Swenshuai.xi // Function and Variable 284*53ee8cc1Swenshuai.xi //------------------------------------------------------------------------------------------------- 285*53ee8cc1Swenshuai.xi MS_U8 HAL_MVD_GetCaps(void); 286*53ee8cc1Swenshuai.xi void HAL_MVD_MemSetMap(MS_U8 u8type, MS_U32 u32addr, MS_U32 u32len); 287*53ee8cc1Swenshuai.xi void HAL_MVD_MemGetMap(MS_U8 u8type, MS_U32* pu32addr, MS_U32* pu32len); 288*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_MemRead4Byte(MS_U32 u32Address); 289*53ee8cc1Swenshuai.xi MS_U16 HAL_MVD_MemRead2Byte(MS_U32 u32Address); 290*53ee8cc1Swenshuai.xi MS_U8 HAL_MVD_MemReadByte(MS_U32 u32Address); 291*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_MemWrite4Byte(MS_U32 u32Address, MS_U32 u32Value); 292*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_MemWrite2Byte(MS_U32 u32Address, MS_U16 u16Value); 293*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_MemWriteByte(MS_U32 u32Address, MS_U8 u8Value); 294*53ee8cc1Swenshuai.xi void HAL_MVD_SetReqMask(MS_BOOL bEnMask); 295*53ee8cc1Swenshuai.xi 296*53ee8cc1Swenshuai.xi MS_PHYADDR HAL_MVD_PA2NonCacheSeg(MS_PHYADDR u32PhyAddr); 297*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_GetTime(void); 298*53ee8cc1Swenshuai.xi void HAL_MVD_Delayms(MS_U32 u32msecs); 299*53ee8cc1Swenshuai.xi void HAL_MVD_CPU_Sync(void); 300*53ee8cc1Swenshuai.xi void HAL_MVD_FlushMemory(void); 301*53ee8cc1Swenshuai.xi void HAL_MVD_ReadMemory(void); 302*53ee8cc1Swenshuai.xi 303*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_RstHW(void); 304*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_ReleaseFW(void); 305*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_LoadCode(void); 306*53ee8cc1Swenshuai.xi void HAL_MVD_SetFWBinID(MS_U32 u32SrcID); 307*53ee8cc1Swenshuai.xi 308*53ee8cc1Swenshuai.xi MS_U8 HAL_MVD_GetChipMajorID(void); 309*53ee8cc1Swenshuai.xi 310*53ee8cc1Swenshuai.xi void HAL_MVD_PowerCtrl(MS_BOOL bOn); 311*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_TimeOut(void); 312*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_MVDCommand(MS_U8 u8cmd, MVD_CmdArg *pstCmdArg); 313*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_InitHW(void); 314*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_InitFW(void); 315*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_GetFWVer(void); 316*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SoftRstHW(void); 317*53ee8cc1Swenshuai.xi void HAL_MVD_ClearIRQ(void); 318*53ee8cc1Swenshuai.xi 319*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetSpeed(MVD_SpeedType eSpeedType, MS_U8 u8Multiple); 320*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_EnableForcePlay(void); 321*53ee8cc1Swenshuai.xi void HAL_MVD_SetFrameBuffAddr(MS_U32 u32addr, MS_U8 u8fbMode); 322*53ee8cc1Swenshuai.xi void HAL_MVD_SetHeaderBufferAddr(MS_U32 u32addr); 323*53ee8cc1Swenshuai.xi void HAL_MVD_SetVolInfoBufferAddr(MS_U32 u32addr); 324*53ee8cc1Swenshuai.xi void HAL_MVD_SetFrameInfoBufferAddr(MS_U32 u32addr); 325*53ee8cc1Swenshuai.xi void HAL_MVD_SetIAPBufferAddr(MS_U32 u32addr); 326*53ee8cc1Swenshuai.xi void HAL_MVD_SetDPBufferAddr(MS_U32 u32addr); 327*53ee8cc1Swenshuai.xi void HAL_MVD_SetMVBufferAddr(MS_U32 u32addr); 328*53ee8cc1Swenshuai.xi void HAL_MVD_SetUserDataBuf(MS_U32 u32addr, MS_U32 u32size); 329*53ee8cc1Swenshuai.xi void HAL_MVD_SetSLQTblBufStartEnd(MS_U32 u32start, MS_U32 u32end); 330*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_StepDisp(void); 331*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_EnableLastFrameShow(MS_BOOL bEnable); 332*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SlqTblRst(void); 333*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SeekToPTS(MS_U32 u32Pts); 334*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SkipToPTS(MS_U32 u32Pts); 335*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetFileModeAVSync(MVD_TIMESTAMP_TYPE eSyncMode); 336*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetPtsTblAddr(MS_U32 u32addr); 337*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetScalerInfoAddr(MS_U32 u32addr); 338*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetDynamicScaleAddr(MS_U32 u32addr); 339*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetVirtualBox(MS_U16 u16Width, MS_U16 u16Height); 340*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_EnableDynamicScale(void); 341*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetBlueScreen(MS_BOOL bEn); 342*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_Resume(void); 343*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetFreezeDisp(MS_BOOL bEn); 344*53ee8cc1Swenshuai.xi void HAL_MVD_SetDecFrmInfoAddr(MS_U32 u32addr); 345*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_GetIntState(void); 346*53ee8cc1Swenshuai.xi MS_U8 HAL_MVD_GetAVSyncStatus(void); 347*53ee8cc1Swenshuai.xi void HAL_MVD_SlqTblLoadWrPtr(MS_U32 u32WrPtr); 348*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_SlqTblProbeWrPtr(void); 349*53ee8cc1Swenshuai.xi MS_U32 HAL_MVD_SlqTblProbeRdPtr(void); 350*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_SetMStreamerMode(MS_U8 u8Mode); 351*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_FrameOpt(MS_U8 u8FrmIdx, MVD_FrmOpt eOpt); 352*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_UpdatePts(void); 353*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_FrameCapture(MS_U8 u8FrmIdx, MS_BOOL bEnable); 354*53ee8cc1Swenshuai.xi MS_BOOL HAL_MVD_GetFrmRateIsSupported(MS_U16 u16HSize, MS_U16 u16VSize, MS_U32 u32FrmRate); 355*53ee8cc1Swenshuai.xi 356*53ee8cc1Swenshuai.xi void HAL_MVD_SetDbgLevel(MS_U8 level); 357*53ee8cc1Swenshuai.xi //MS_BOOL HAL_MVD_GetMVDEngineCfg(MVD_HWCfg* MvdHWCfg); 358*53ee8cc1Swenshuai.xi 359*53ee8cc1Swenshuai.xi #endif // _DEV_MVD_H_ 360