Tizen 2.0 Release
[platform/kernel/u-boot.git] / arch / arm / include / asm / arch-exynos / mmc.h
1 /*
2  * (C) Copyright 2009 SAMSUNG Electronics
3  * Minkyu Kang <mk7.kang@samsung.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef __ASM_ARCH_MMC_H_
22 #define __ASM_ARCH_MMC_H_
23
24 #define RX_DELAY1       ((0 << 15) | (1 << 7))
25 #define RX_DELAY2       ((1 << 15) | (1 << 7))
26 #define RX_DELAY3       ((0 << 15) | (0 << 7))
27 #define RX_DELAY4       ((1 << 15) | (0 << 7))
28
29 #define TX_DELAY1       (RX_DELAY1 << 16)
30 #define TX_DELAY2       (RX_DELAY2 << 16)
31 #define TX_DELAY3       (RX_DELAY3 << 16)
32 #define TX_DELAY4       (RX_DELAY4 << 16)
33
34 #ifndef __ASSEMBLY__
35 struct s5p_mmc {
36         unsigned int    sysad;
37         unsigned short  blksize;
38         unsigned short  blkcnt;
39         unsigned int    argument;
40         unsigned short  trnmod;
41         unsigned short  cmdreg;
42         unsigned int    rspreg0;
43         unsigned int    rspreg1;
44         unsigned int    rspreg2;
45         unsigned int    rspreg3;
46         unsigned int    bdata;
47         unsigned int    prnsts;
48         unsigned char   hostctl;
49         unsigned char   pwrcon;
50         unsigned char   blkgap;
51         unsigned char   wakcon;
52         unsigned short  clkcon;
53         unsigned char   timeoutcon;
54         unsigned char   swrst;
55         unsigned int    norintsts;      /* errintsts */
56         unsigned int    norintstsen;    /* errintstsen */
57         unsigned int    norintsigen;    /* errintsigen */
58         unsigned short  acmd12errsts;
59         unsigned char   res1[2];
60         unsigned int    capareg;
61         unsigned char   res2[4];
62         unsigned int    maxcurr;
63         unsigned char   res3[0x34];
64         unsigned int    control2;
65         unsigned int    control3;
66         unsigned char   res4[4];
67         unsigned int    control4;
68         unsigned char   res5[0x6e];
69         unsigned short  hcver;
70         unsigned char   res6[0xFF00];
71 };
72
73 struct mmc_host {
74         struct s5p_mmc *reg;
75         unsigned int version;   /* SDHCI spec. version */
76         unsigned int clock;     /* Current clock (MHz) */
77         int dev_index;
78 #ifdef CONFIG_MMC_ASYNC_WRITE
79         int async_write;
80         int async_on;
81         int env_write;
82 #endif
83 };
84
85 int s5p_mmc_init(int dev_index, int bus_width);
86
87 #endif  /* __ASSEMBLY__ */
88 #endif