OpenCores
URL https://opencores.org/ocsvn/test_project/test_project/trunk

Subversion Repositories test_project

[/] [test_project/] [trunk/] [linux_sd_driver/] [drivers/] [mmc/] [host/] [mmc_ocores.h] - Blame information for rev 82

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 65 AlbertVeli
/* -*- linux-c -*-
2
 *
3
 * OpenCores MMC Controller driver
4
 *
5
 * Copyright (C) 2009 ORSoC, All Rights Reserved.
6
 *
7
 * This program is free software; you can redistribute it and/or modify it
8
 * under the terms of the GNU General Public License as published
9
 * by the Free Software Foundation; version 2 of the License.
10
 *
11
 * This program is distributed in the hope that it will be useful, but
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License along
17
 * with this program; if not, write to the Free Software Foundation, Inc.,
18
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
 */
20
#define MMCOC_REG_BASE MMC_BASE_ADD
21
#define MMCOC_MAX_BLOCK_SIZE 512
22
 
23 66 tac2
#define FL_SENT_COMMAND (1 << 0)
24
#define FL_SENT_STOP    (1 << 1)
25
 
26 65 AlbertVeli
#define WORD_0 0x00
27
#define WORD_1 0x40
28
#define WORD_2 0x80
29
#define WORD_3 0xC0
30
 
31
#define SD_ARG 0x00
32
#define SD_COMMAND 0x04
33
#define SD_STATUS 0x08
34
#define SD_RESP1 0x0c
35
#define SD_CTRL 0x1c
36
#define SD_BLOCK 0x20
37
#define SD_POWER 0x24
38
#define SD_SOFTWARE_RST 0x28
39
#define SD_TIMEOUT 0x2c
40
#define SD_NORMAL_INT_STATUS 0x30
41
#define SD_ERROR_INT_STATUS 0x34
42
#define SD_NORMAL_INT_STATUS_ENABLE 0x38
43
#define SD_ERROR_INT_STATUS_ENABLE 0x3c
44 66 tac2
 
45
#define SD_NOMAL_INT_SIGNAL_ENABLE  0x38
46
#define SD_ERROR_INT_SIGNAL_ENABLE  0x3c
47 65 AlbertVeli
#define SD_CAPABILITY  0x48
48 66 tac2
#define SD_CLOCK_DIVIDER  0x4c
49 65 AlbertVeli
#define BD_STATUS 0x50
50 81 tac2
#define SD_BD_ISR 0x54
51
#define SD_BD_ISER 0x58
52 65 AlbertVeli
#define BD_RX 0x60
53
#define BD_TX 0x80
54
 
55 66 tac2
//Normal Interupt signal enable register
56
#define ECC 0x1 //Interupt on CommandComplete 
57
#define EEI 0x8000 //Interupt on CommandError
58 65 AlbertVeli
 
59 81 tac2
//Data Interupt
60 82 tac2
 
61
#define TRE 0x20
62
#define CMDE 0x10
63 81 tac2
#define FIFOE 0x04
64
#define MRC 0x02
65
#define TRS 0x01
66 65 AlbertVeli
 
67 66 tac2
#define SD_ENABLE 0
68
#define SD_DISABLE 1
69
 
70 65 AlbertVeli
/* Commands */
71
#define CMD2   0x200
72
#define CMD3   0x300
73
#define CMD7   0x700
74
#define CMD8   0x800
75
#define CMD9   0x900
76
#define CMD16  0x1000
77
#define CMD17  0x1100
78
#define CMD32  0x2000
79
#define CMD33  0x2100
80
#define CMD38  0x2600
81
#define ACMD41 0x2900
82
#define ACMD6  0x600
83
#define CMD55  0x3700
84
 
85
/* CMD ARG */
86
/* CMD8 */
87
#define VHS  0x100 //2.7-3.6V
88
#define CHECK_PATTERN 0xAA
89
/* ACMD41 */
90
#define BUSY 0x80000000
91
#define HCS 0x40000000
92
#define VOLTAGE_MASK 0xFFFFFF
93
 
94
/* CMD7 */
95
#define READY_FOR_DATA 0x100
96
#define CARD_STATUS_STB  0x600
97
 
98 68 tac2
//BIT MASK INTERNAL REGISTERS
99
 
100
/* Command setting register*/
101 65 AlbertVeli
#define CICE    0x10
102
#define CRCE    0x08
103 66 tac2
#define MMCOC_RSP_48  0x2
104
#define MMCOC_RSP_136 0x1
105
#define MMCOC_RSP_NONE 0x0
106 68 tac2
 
107
 
108
 
109
 
110 65 AlbertVeli
/* Normal interupt status */
111 68 tac2
#define CC 0x1 //Command Complete
112
#define EI 0x8000 //Error interrupt bit set
113 65 AlbertVeli
 
114
/* Error interupt status */
115 68 tac2
#define CTE 0x1 //Command timeout
116
#define CCRC 0x2 //Command CRC Error
117
#define CIE  0x8 //Command Index Error
118 65 AlbertVeli
 
119 68 tac2
//
120 65 AlbertVeli
#define CID_MID_MASK 0x7F8000
121
#define CID_OID_MASK 0x7FFF
122
#define CID_B1 0x7F800000
123
#define CID_B2 0x7F8000
124
#define CID_B3 0x7F80
125
#define CID_B4 0x7F
126
 
127
#define RCA_RCA_MASK 0xFFFF0000
128 66 tac2
 
129
#define ocores_mci_write(host, reg, val)        __raw_writel((val), (host)->base + (reg))

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.