summaryrefslogtreecommitdiffstats
path: root/drivers/mci/sdhci.h
blob: b67818485bf7d4e009226b4fe734aeecec0563d9 (plain) (blame)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef __MCI_SDHCI_H
#define __MCI_SDHCI_H

#define SDHCI_DMA_ADDRESS					0x00
#define SDHCI_BLOCK_SIZE__BLOCK_COUNT				0x04
#define SDHCI_ARGUMENT						0x08
#define SDHCI_TRANSFER_MODE__COMMAND				0x0c
#define SDHCI_RESPONSE_0					0x10
#define SDHCI_RESPONSE_1					0x14
#define SDHCI_RESPONSE_2					0x18
#define SDHCI_RESPONSE_3					0x1c
#define SDHCI_BUFFER						0x20
#define SDHCI_PRESENT_STATE					0x24
#define SDHCI_HOST_CONTROL__POWER_CONTROL__BLOCK_GAP_CONTROL	0x28
#define SDHCI_CLOCK_CONTROL__TIMEOUT_CONTROL__SOFTWARE_RESET	0x2c
#define SDHCI_INT_STATUS					0x30
#define SDHCI_INT_ENABLE					0x34
#define SDHCI_SIGNAL_ENABLE					0x38
#define SDHCI_ACMD12_ERR__HOST_CONTROL2				0x3C
#define SDHCI_CAPABILITIES					0x40

#define COMMAND_CMD(x)		((x & 0x3f) << 24)
#define COMMAND_CMDTYP_NORMAL	0x0
#define COMMAND_CMDTYP_SUSPEND	0x00400000
#define COMMAND_CMDTYP_RESUME	0x00800000
#define COMMAND_CMDTYP_ABORT	0x00c00000
#define COMMAND_DPSEL		0x00200000
#define COMMAND_CICEN		0x00100000
#define COMMAND_CCCEN		0x00080000
#define COMMAND_RSPTYP_NONE	0
#define COMMAND_RSPTYP_136	0x00010000
#define COMMAND_RSPTYP_48	0x00020000
#define COMMAND_RSPTYP_48_BUSY	0x00030000
#define TRANSFER_MODE_MSBSEL	0x00000020
#define TRANSFER_MODE_DTDSEL	0x00000010
#define TRANSFER_MODE_AC12EN	0x00000004
#define TRANSFER_MODE_BCEN	0x00000002
#define TRANSFER_MODE_DMAEN	0x00000001

#define IRQSTAT_TE		0x04000000
#define IRQSTAT_DMAE		0x02000000
#define IRQSTAT_AC12E		0x01000000
#define IRQSTAT_CLE		0x00800000
#define IRQSTAT_DEBE		0x00400000
#define IRQSTAT_DCE		0x00200000
#define IRQSTAT_DTOE		0x00100000
#define IRQSTAT_CIE		0x00080000
#define IRQSTAT_CEBE		0x00040000
#define IRQSTAT_CCE		0x00020000
#define IRQSTAT_CTOE		0x00010000
#define IRQSTAT_CINT		0x00000100
#define IRQSTAT_CRM		0x00000080
#define IRQSTAT_CINS		0x00000040
#define IRQSTAT_BRR		0x00000020
#define IRQSTAT_BWR		0x00000010
#define IRQSTAT_DINT		0x00000008
#define IRQSTAT_BGE		0x00000004
#define IRQSTAT_TC		0x00000002
#define IRQSTAT_CC		0x00000001

#define IRQSTATEN_DMAE		0x10000000
#define IRQSTATEN_AC12E		0x01000000
#define IRQSTATEN_DEBE		0x00400000
#define IRQSTATEN_DCE		0x00200000
#define IRQSTATEN_DTOE		0x00100000
#define IRQSTATEN_CIE		0x00080000
#define IRQSTATEN_CEBE		0x00040000
#define IRQSTATEN_CCE		0x00020000
#define IRQSTATEN_CTOE		0x00010000
#define IRQSTATEN_CINT		0x00000100
#define IRQSTATEN_CRM		0x00000080
#define IRQSTATEN_CINS		0x00000040
#define IRQSTATEN_BRR		0x00000020
#define IRQSTATEN_BWR		0x00000010
#define IRQSTATEN_DINT		0x00000008
#define IRQSTATEN_BGE		0x00000004
#define IRQSTATEN_TC		0x00000002
#define IRQSTATEN_CC		0x00000001

#define PRSSTAT_DAT0		0x01000000
#define PRSSTAT_CLSL		0x00800000
#define PRSSTAT_WPSPL		0x00080000
#define PRSSTAT_CDPL		0x00040000
#define PRSSTAT_CINS		0x00010000
#define PRSSTAT_BREN		0x00000800
#define PRSSTAT_BWEN		0x00000400
#define PRSSTAT_SDSTB		0x00000008
#define PRSSTAT_DLA		0x00000004
#define PRSSTAT_CIDHB		0x00000002
#define PRSSTAT_CICHB		0x00000001

#endif /* __MCI_SDHCI_H */