sdio_def.h
2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* Sd_def.h
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* Header file of SDIO driver
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef SDIO_DEF_H
#define SDIO_DEF_H
/*HW part*/
#define SDIO_CFG (MSDC_ADRS+0x54)
#define SDIO_STA (MSDC_ADRS+0x58)
#define SDC_CFG_SDIO 0x00080000
#define SDiO_CFG_INTEN 0x1 // enable interrupt
#define SDiO_CFG_INTSEL 0x2 // interrupt signal selection 0: use DAT[1], 1: use DAT[5]
#define SDiO_CFG_DSBSEL 0x4 // data block start bit selection
#if defined(DRV_MSDC_MT6238_SERIES)
#define SDIO_CFG2 (MSDC_ADRS2+0x54)
#define SDIO_STA2 (MSDC_ADRS2+0x58)
#endif
#define SDIO_R4_CARD_READY 0x80
#define IO_ARG_RW_FLAG 0x80000000
#define IO_ARG_RAW_FLAG 0x08000000
#define MSDC_WORK_OCR 0x8000
#define R5_COM_CRC_ERROR (1<<7)
#define R5_ILLEGAL_COMMAND (1<<6)
#define R5_IO_CURRENT_STATE (3<<4)
#define R5_ERROR (1<<3)
#define R5_RFU (1<<2)
#define R5_FUNCTION_NUMBER (1<<1)
#define R5_OUT_OF_RANGE (1<<0)
#define R5_ERROR_CHECK (R5_COM_CRC_ERROR|R5_ILLEGAL_COMMAND|R5_ERROR|R5_FUNCTION_NUMBER|R5_OUT_OF_RANGE)
#define SDIO_STATUS_CHECK \
{\
if(NO_ERROR != status)\
{\
SD_TRACE2(TRACE_GROUP_5, MSDC_GENERAL_FAIL, MSDC_DRV_TRC_FILE_SD, __LINE__);\
goto err;\
}\
}
#endif // end of SD_DEF_H