blob: afdfcf049d131a06d9d422c8238d178aecce57f6 [file] [log] [blame]
Minkyu Kang12760ab2010-07-06 20:26:06 +09001/*
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
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000024#define SDHCI_CONTROL2 0x80
25#define SDHCI_CONTROL3 0x84
26#define SDHCI_CONTROL4 0x8C
Minkyu Kang12760ab2010-07-06 20:26:06 +090027
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000028#define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31)
29#define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30)
30#define SDHCI_CTRL2_CDINVRXD3 (1 << 29)
31#define SDHCI_CTRL2_SLCARDOUT (1 << 28)
Minkyu Kang12760ab2010-07-06 20:26:06 +090032
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000033#define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
34#define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24)
35#define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24)
36
37#define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16)
38#define SDHCI_CTRL2_LVLDAT_SHIFT (16)
39#define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
40
41#define SDHCI_CTRL2_ENFBCLKTX (1 << 15)
42#define SDHCI_CTRL2_ENFBCLKRX (1 << 14)
43#define SDHCI_CTRL2_SDCDSEL (1 << 13)
44#define SDHCI_CTRL2_SDSIGPC (1 << 12)
45#define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11)
46
47#define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
48#define SDHCI_CTRL2_DFCNT_SHIFT (9)
49
50#define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8)
51#define SDHCI_CTRL2_RWAITMODE (1 << 7)
52#define SDHCI_CTRL2_DISBUFRD (1 << 6)
53#define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4)
54#define SDHCI_CTRL2_SELBASECLK_SHIFT (4)
55#define SDHCI_CTRL2_PWRSYNC (1 << 3)
56#define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
57#define SDHCI_CTRL2_HWINITFIN (1 << 0)
58
59#define SDHCI_CTRL3_FCSEL3 (1 << 31)
60#define SDHCI_CTRL3_FCSEL2 (1 << 23)
61#define SDHCI_CTRL3_FCSEL1 (1 << 15)
62#define SDHCI_CTRL3_FCSEL0 (1 << 7)
63
64#define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
65#define SDHCI_CTRL4_DRIVE_SHIFT (16)
66
Jaehoon Chunge26123b2012-08-30 16:24:10 +000067int s5p_sdhci_init(u32 regbase, int index, int bus_width);
Minkyu Kang12760ab2010-07-06 20:26:06 +090068
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000069static inline unsigned int s5p_mmc_init(int index, int bus_width)
70{
71 unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
Jaehoon Chunge26123b2012-08-30 16:24:10 +000072 return s5p_sdhci_init(base, index, bus_width);
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000073}
Minkyu Kang12760ab2010-07-06 20:26:06 +090074#endif