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 // 81 // Copyright (c) 2008-2009 MStar Semiconductor, Inc. 82 // All rights reserved. 83 // 84 // Unless otherwise stipulated in writing, any and all information contained 85 // herein regardless in any format shall remain the sole proprietary of 86 // MStar Semiconductor Inc. and be kept in strict confidence 87 // ("MStar Confidential Information") by the recipient. 88 // Any unauthorized act including without limitation unauthorized disclosure, 89 // copying, use, reproduction, sale, distribution, modification, disassembling, 90 // reverse engineering and compiling of the contents of MStar Confidential 91 // Information is unlawful and strictly prohibited. MStar hereby reserves the 92 // rights to any and all damages, losses, costs and expenses resulting therefrom. 93 // 94 /////////////////////////////////////////////////////////////////////////////// 95 96 #ifndef __PRANA_DEVICE_H__ 97 #define __PRANA_DEVICE_H__ 98 99 #include "MsTypes.h" 100 101 #define DEVICE_NULL ((device_t)0) 102 103 typedef unsigned long device_t; 104 105 // 106 // device PM event 107 // 108 typedef enum 109 { 110 E_EVT_SUSPEND = 1, 111 E_EVT_SHUTDOWN = 2, 112 } eDEVEVT; 113 114 typedef enum 115 { 116 E_POWER_SUSPEND = 1, // State is backup in DRAM, components power off. 117 E_POWER_RESUME = 2, // Resume from Suspend or Hibernate mode 118 E_POWER_MECHANICAL = 3, // Full power off mode. System return to working state only after full reboot 119 E_POWER_SOFT_OFF = 4, // The system appears to be off, but some components remain powered for trigging boot-up. 120 } EN_POWER_MODE; 121 122 // 123 // poll types 124 // 125 126 #ifndef POLLIN 127 #define POLLIN 0x01 128 #endif 129 130 #ifndef POLLOUT 131 #define POLLOUT 0x02 132 #endif 133 134 #ifndef POLLHUP 135 #define POLLHUP 0x04 136 #endif 137 138 // 139 // device I/O operations 140 // 141 struct devio 142 { 143 int (*open) (device_t dev, int mode); 144 int (*close)(device_t dev); 145 // int (*read) (device_t dev, char *buf, size_t len, int off); 146 int (*read) (device_t dev, char *buf, MS_U32 len, int off); 147 // int (*write)(device_t dev, const char *buf, size_t len, int off); 148 int (*write)(device_t dev, const char *buf, MS_U32 len, int off); 149 int (*poll) (device_t dev, int types); 150 int (*ioctl)(device_t dev, int request, unsigned long arg); 151 int (*event)(eDEVEVT evt); 152 }; 153 154 155 #define DEVICE_MAGIC (('D' << 24) | ('E' << 16) | ('V' << 8) | 'I') 156 157 // 158 // device structure 159 // 160 #ifndef MSOS_TYPE_LINUX_KERNEL 161 struct device 162 { 163 int magic; // magic number 164 int refcnt; // reference count 165 int flags; // device characteristics 166 struct devio *devio; // device i/o table 167 }; 168 #endif 169 #define device_valid(dev) ((dev)->magic == DEVICE_MAGIC) 170 #endif /* __PRANA_DEVICE_H__ */ 171 172 //MSTAR Module ID 173 /******************************************************************************* 174 !!!! WARNING NOT ALLOW MODIFY EXISTED VALUE !!!! 175 !!!! ONLY ALLOW ADD NEW VALUE AFTER END OF THIS LIST !!!! 176 *******************************************************************************/ 177 #define MS_MODULE_HW 0x0000 178 179 #define MS_MODULE_CHIPTOP 0x0011 180 #define MS_MODULE_MIU 0x0012 181 #define MS_MODULE_WDT 0x003C 182 #define MS_MODULE_CFG 0x00F0 // Chip hard configuration info 183 #define MS_MODULE_OTP 0x00F4 184 #define MS_MODULE_SPRAM 0x00F5 185 #define MS_MODULE_OTP2 0x00F6 //OTP raw data read for dolby info 186 187 #define MS_MODULE_ACE 0x0101 188 #define MS_MODULE_AUDIO 0x0102 189 #define MS_MODULE_AVD 0x0103 190 #define MS_MODULE_BDMA 0x0104 191 #define MS_MODULE_DLC 0x0105 192 #define MS_MODULE_FLASH 0x0106 193 #define MS_MODULE_GE 0x0107 194 #define MS_MODULE_GOP 0x0108 195 #define MS_MODULE_HVD 0x0109 196 #define MS_MODULE_HWI2C 0x010a 197 #define MS_MODULE_IR 0x010b 198 #define MS_MODULE_IRQ 0x010c 199 #define MS_MODULE_JPD 0x010d 200 #define MS_MODULE_MBX 0x010e 201 #define MS_MODULE_MVD 0x010f 202 #define MS_MODULE_MVOP 0x0120 203 #define MS_MODULE_RVD 0x0122 204 #define MS_MODULE_SC 0x0123 205 #define MS_MODULE_TSP 0x0124 206 #define MS_MODULE_UART 0x0125 207 #define MS_MODULE_VPU 0x0126 208 #define MS_MODULE_XC 0x0127 209 #define MS_MODULE_PNL 0x0128 210 #define MS_MODULE_ISP 0x0129 211 #define MS_MODULE_PFSH 0x012a 212 #define MS_MODULE_GPIO 0x012b 213 #define MS_MODULE_PM 0x012c 214 #define MS_MODULE_VBI 0x012d 215 #define MS_MODULE_PCMCIA 0x012e 216 #define MS_MODULE_PIU 0x012f 217 #define MS_MODULE_MHEG5 0x0130 218 #define MS_MODULE_RTC_0 0x0131 219 #define MS_MODULE_RTC_2 0x0132 220 #define MS_MODULE_VIF 0x0133 221 #define MS_MODULE_MFE 0x0134 222 #define MS_MODULE_DIP 0x0135 223 #define MS_MODULE_RASP 0x0136 224 #define MS_MODULE_MMFILEIN 0x0137 225 #define MS_MODULE_MPIF 0x0138 226 #define MS_MODULE_GPD 0x0139 227 #define MS_MODULE_TSO 0x013a 228 #define MS_MODULE_CMDQ 0x013b 229 #define MS_MODULE_MSPI 0x013c 230 231 #define MS_MODULE_SEM 0x02f0 232 233 #define MS_MODULE_CA 0x0300 // CA reserved 234 #define MS_MODULE_NDS 0x0310 // NDS 235 #define MS_MODULE_NSK 0x0311 236 #define MS_MODULE_CAM 0x0312 237 #define MS_MODULE_NGA 0x0313 238 239 #define MS_MODULE_PWM 0x1032 240 #define MS_MODULE_DMD 0x1033 241 #define MS_MODULE_PWS 0x1034 242 #define MS_MODULE_EFUSE 0x1035 243 244 #define MS_MODULE_FRC 0x2000 // A5 only 245 246 247