blob: 96610b88f4d9903686bbbab3ef25b146f8b13262 [file] [log] [blame]
Minkyu Kangb1b24682011-01-24 15:22:23 +09001/*
2 * (C) Copyright 2009 SAMSUNG Electronics
3 * Minkyu Kang <mk7.kang@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Minkyu Kangb1b24682011-01-24 15:22:23 +09006 */
7
8#ifndef __ASM_ARCH_MMC_H_
9#define __ASM_ARCH_MMC_H_
10
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000011#define SDHCI_CONTROL2 0x80
12#define SDHCI_CONTROL3 0x84
13#define SDHCI_CONTROL4 0x8C
Minkyu Kangb1b24682011-01-24 15:22:23 +090014
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000015#define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31)
16#define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30)
17#define SDHCI_CTRL2_CDINVRXD3 (1 << 29)
18#define SDHCI_CTRL2_SLCARDOUT (1 << 28)
Minkyu Kangb1b24682011-01-24 15:22:23 +090019
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000020#define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
21#define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24)
22#define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24)
23
24#define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16)
25#define SDHCI_CTRL2_LVLDAT_SHIFT (16)
26#define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
27
28#define SDHCI_CTRL2_ENFBCLKTX (1 << 15)
29#define SDHCI_CTRL2_ENFBCLKRX (1 << 14)
30#define SDHCI_CTRL2_SDCDSEL (1 << 13)
31#define SDHCI_CTRL2_SDSIGPC (1 << 12)
32#define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11)
33
34#define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
35#define SDHCI_CTRL2_DFCNT_SHIFT (9)
36
37#define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8)
38#define SDHCI_CTRL2_RWAITMODE (1 << 7)
39#define SDHCI_CTRL2_DISBUFRD (1 << 6)
40#define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4)
41#define SDHCI_CTRL2_SELBASECLK_SHIFT (4)
42#define SDHCI_CTRL2_PWRSYNC (1 << 3)
43#define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
44#define SDHCI_CTRL2_HWINITFIN (1 << 0)
45
46#define SDHCI_CTRL3_FCSEL3 (1 << 31)
47#define SDHCI_CTRL3_FCSEL2 (1 << 23)
48#define SDHCI_CTRL3_FCSEL1 (1 << 15)
49#define SDHCI_CTRL3_FCSEL0 (1 << 7)
50
51#define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
52#define SDHCI_CTRL4_DRIVE_SHIFT (16)
53
Jaehoon Chunge26123b2012-08-30 16:24:10 +000054int s5p_sdhci_init(u32 regbase, int index, int bus_width);
Minkyu Kangb1b24682011-01-24 15:22:23 +090055
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000056static inline unsigned int s5p_mmc_init(int index, int bus_width)
57{
58 unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
Jaehoon Chunge26123b2012-08-30 16:24:10 +000059 return s5p_sdhci_init(base, index, bus_width);
Jaehoon Chungb0b0c9d2012-04-23 02:36:28 +000060}
Minkyu Kangb1b24682011-01-24 15:22:23 +090061#endif