mmc.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef __ASM_ARCH_MMC_H_
  21. #define __ASM_ARCH_MMC_H_
  22. #define SDHCI_CONTROL2 0x80
  23. #define SDHCI_CONTROL3 0x84
  24. #define SDHCI_CONTROL4 0x8C
  25. #define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31)
  26. #define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30)
  27. #define SDHCI_CTRL2_CDINVRXD3 (1 << 29)
  28. #define SDHCI_CTRL2_SLCARDOUT (1 << 28)
  29. #define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
  30. #define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24)
  31. #define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24)
  32. #define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16)
  33. #define SDHCI_CTRL2_LVLDAT_SHIFT (16)
  34. #define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
  35. #define SDHCI_CTRL2_ENFBCLKTX (1 << 15)
  36. #define SDHCI_CTRL2_ENFBCLKRX (1 << 14)
  37. #define SDHCI_CTRL2_SDCDSEL (1 << 13)
  38. #define SDHCI_CTRL2_SDSIGPC (1 << 12)
  39. #define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11)
  40. #define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
  41. #define SDHCI_CTRL2_DFCNT_SHIFT (9)
  42. #define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8)
  43. #define SDHCI_CTRL2_RWAITMODE (1 << 7)
  44. #define SDHCI_CTRL2_DISBUFRD (1 << 6)
  45. #define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4)
  46. #define SDHCI_CTRL2_SELBASECLK_SHIFT (4)
  47. #define SDHCI_CTRL2_PWRSYNC (1 << 3)
  48. #define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
  49. #define SDHCI_CTRL2_HWINITFIN (1 << 0)
  50. #define SDHCI_CTRL3_FCSEL3 (1 << 31)
  51. #define SDHCI_CTRL3_FCSEL2 (1 << 23)
  52. #define SDHCI_CTRL3_FCSEL1 (1 << 15)
  53. #define SDHCI_CTRL3_FCSEL0 (1 << 7)
  54. #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
  55. #define SDHCI_CTRL4_DRIVE_SHIFT (16)
  56. int s5p_sdhci_init(u32 regbase, int index, int bus_width);
  57. static inline unsigned int s5p_mmc_init(int index, int bus_width)
  58. {
  59. unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  60. return s5p_sdhci_init(base, index, bus_width);
  61. }
  62. #endif