yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2005 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * msdc_lsd.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Maui_Software |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * header file of software SD/MMC controller interface |
| 49 | * |
| 50 | * |
| 51 | * Author: |
| 52 | * ------- |
| 53 | * ------- |
| 54 | * |
| 55 | *============================================================================ |
| 56 | * HISTORY |
| 57 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 58 | *------------------------------------------------------------------------------ |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * removed! |
| 62 | * |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * removed! |
| 66 | * |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * removed! |
| 70 | * |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * removed! |
| 74 | * |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * removed! |
| 78 | * |
| 79 | * removed! |
| 80 | * removed! |
| 81 | * removed! |
| 82 | * |
| 83 | * removed! |
| 84 | * removed! |
| 85 | * removed! |
| 86 | * |
| 87 | * removed! |
| 88 | * removed! |
| 89 | * removed! |
| 90 | * |
| 91 | * removed! |
| 92 | * removed! |
| 93 | * removed! |
| 94 | * |
| 95 | * removed! |
| 96 | * removed! |
| 97 | * removed! |
| 98 | * |
| 99 | * removed! |
| 100 | * removed! |
| 101 | * removed! |
| 102 | * |
| 103 | * removed! |
| 104 | * removed! |
| 105 | * removed! |
| 106 | * |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * removed! |
| 110 | * |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * removed! |
| 114 | * |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * removed! |
| 118 | * |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * removed! |
| 122 | * |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * removed! |
| 126 | * |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * removed! |
| 130 | * |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | *------------------------------------------------------------------------------ |
| 135 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 136 | *============================================================================ |
| 137 | ****************************************************************************/ |
| 138 | #ifndef MSDC_LSD_H |
| 139 | #define MSDC_LSD_H |
| 140 | |
| 141 | /*RHR*/ |
| 142 | //MSBB remove #include "kal_non_specific_general_types.h" |
| 143 | #include "drv_features.h" |
| 144 | /*RHR*/ |
| 145 | |
| 146 | /*following 2 definitions should be defined in this file*/ |
| 147 | #define LSD_HPI |
| 148 | #define LSD_CONTROLLER |
| 149 | |
| 150 | |
| 151 | #define LSD_LCDARB_FREE 0 |
| 152 | #define LSD_LCDARB_LCD 1 |
| 153 | #define LSD_LCDARB_SD 2 |
| 154 | #define LSD_LCDARB_CAL 3 |
| 155 | |
| 156 | /*DRV_LSD macro definition*/ |
| 157 | #define LSD_MSDC_CFG 0 |
| 158 | #define LSD_MSDC_STA 1 |
| 159 | #define LSD_MSDC_INT 2 |
| 160 | #define LSD_MSDC_DAT 3 |
| 161 | #define LSD_MSDC_PS 4 |
| 162 | #define LSD_MSDC_IOCON 5 |
| 163 | #define LSD_SDC_CFG 6 |
| 164 | #define LSD_SDC_CMD 7 |
| 165 | #define LSD_SDC_ARG 8 |
| 166 | #define LSD_SDC_STA 9 |
| 167 | #define LSD_SDC_RESP0 10 |
| 168 | #define LSD_SDC_RESP1 11 |
| 169 | #define LSD_SDC_RESP2 12 |
| 170 | #define LSD_SDC_RESP3 13 |
| 171 | #define LSD_SDC_CMDSTA 14 |
| 172 | #define LSD_SDC_DATSTA 15 |
| 173 | #define LSD_SDC_CSTA 16 |
| 174 | #define LSD_SDC_IRQMASK0 17 |
| 175 | #define LSD_SDC_IRQMASK1 18 |
| 176 | #define LSD_CMD47_46 0x40 |
| 177 | #define LSD_CMD55 0x37 |
| 178 | #define LSD_CMD41 0x29 |
| 179 | |
| 180 | typedef enum { |
| 181 | LSD_SPEED_INIT = 0, |
| 182 | LSD_SPEED_26M = 2, |
| 183 | LSD_SPEED_52M = 3 |
| 184 | } T_LSD_SPEED; |
| 185 | |
| 186 | typedef enum { |
| 187 | LSD_cardInsertion = 0, |
| 188 | LSD_cardRemoval = 1 |
| 189 | }T_LSD_CardDetection; |
| 190 | |
| 191 | typedef enum { |
| 192 | LSD_MSDCCLKBPI2 = 0, |
| 193 | LSD_MSDCCLKBPI3 = 1 |
| 194 | }T_LSD_MSDCCLK; |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | extern kal_uint32 LSD_dbgInfo[]; |
| 201 | extern kal_uint32 LSD_dbgInfoIndex; |
| 202 | #define LSD_DBG_INFO_NUM 128 |
| 203 | |
| 204 | #define LSD_NOT_SUPPORTED 0x1 |
| 205 | |
| 206 | void LSD_HISR_Registration(void); |
| 207 | kal_bool LSD_Support(void); |
| 208 | void LSD_SetBit32(kal_uint32 address,kal_uint32 maskValue); |
| 209 | void LSD_ClrBit32(kal_uint32 address,kal_uint32 maskValue); |
| 210 | void LSD_WriteReg32(kal_uint32 address, kal_uint32 data); |
| 211 | void LSD_ReadReg16(kal_uint32 adrs, kal_uint16 *pdata); |
| 212 | void LSD_ReadReg32(kal_uint32 adrs, kal_uint32 *pdata); |
| 213 | kal_uint32 LSD_Reg32(kal_uint32 adrs); |
| 214 | void LSD_PDNControl(kal_bool ON); |
| 215 | void LSD_CLR_FIFO(void); |
| 216 | void LSD_Reset(void); |
| 217 | kal_uint32 LSD_IS_BUSY(void); |
| 218 | void LSD_HostSetClock(int speed); |
| 219 | void LSD_readFIFO(kal_uint32 *adrs, kal_uint32 count); |
| 220 | void LSD_HostSetBuffer(kal_uint8 *datPtr); |
| 221 | T_LSD_CardDetection LSD_cardDetection(void); |
| 222 | |
| 223 | /*following APIs is provided to FMT, DMT cant see DRV_LSD, can't use DRV_LSD seperate*/ |
| 224 | #ifdef __MTK_TARGET__ |
| 225 | void MSDC_unsealMountOperation(void); |
| 226 | void NotifyFMTWhenCardPresent(void); |
| 227 | void LSD_Slower(kal_uint8 slowFactor); |
| 228 | #else |
| 229 | #define MSDC_unsealMountOperation() |
| 230 | #define NotifyFMTWhenCardPresent() |
| 231 | #define LSD_Slower(a) |
| 232 | #endif |
| 233 | |
| 234 | #ifdef DRV_LSD |
| 235 | #define LSD_STOP_IMMEDIATLY //this should only be seen in DRV_LSD scope, can't be seen in other platform |
| 236 | |
| 237 | void LSD_TakeControl(kal_uint32 owner); |
| 238 | void LSD_GiveControl(kal_uint32 owner); |
| 239 | void LSD_startFastFormat(void); |
| 240 | void LSD_closeFastFormat(void); |
| 241 | #else |
| 242 | #define LSD_startFastFormat |
| 243 | #define LSD_closeFastFormat |
| 244 | #define LSD_TakeControl(a) |
| 245 | #define LSD_GiveControl(a) |
| 246 | #endif |
| 247 | |
| 248 | #endif |