mmc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * (C) Copyright 2009 SAMSUNG Electronics
  3. * Minkyu Kang <mk7.kang@samsung.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __ASM_ARCH_MMC_H_
  8. #define __ASM_ARCH_MMC_H_
  9. #define S5P_MMC_DEV_OFFSET 0x10000
  10. #define SDHCI_CONTROL2 0x80
  11. #define SDHCI_CONTROL3 0x84
  12. #define SDHCI_CONTROL4 0x8C
  13. #define SDHCI_CTRL2_ENSTAASYNCCLR (1 << 31)
  14. #define SDHCI_CTRL2_ENCMDCNFMSK (1 << 30)
  15. #define SDHCI_CTRL2_CDINVRXD3 (1 << 29)
  16. #define SDHCI_CTRL2_SLCARDOUT (1 << 28)
  17. #define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
  18. #define SDHCI_CTRL2_FLTCLKSEL_SHIFT (24)
  19. #define SDHCI_CTRL2_FLTCLKSEL(_x) ((_x) << 24)
  20. #define SDHCI_CTRL2_LVLDAT_MASK (0xff << 16)
  21. #define SDHCI_CTRL2_LVLDAT_SHIFT (16)
  22. #define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
  23. #define SDHCI_CTRL2_ENFBCLKTX (1 << 15)
  24. #define SDHCI_CTRL2_ENFBCLKRX (1 << 14)
  25. #define SDHCI_CTRL2_SDCDSEL (1 << 13)
  26. #define SDHCI_CTRL2_SDSIGPC (1 << 12)
  27. #define SDHCI_CTRL2_ENBUSYCHKTXSTART (1 << 11)
  28. #define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
  29. #define SDHCI_CTRL2_DFCNT_SHIFT (9)
  30. #define SDHCI_CTRL2_ENCLKOUTHOLD (1 << 8)
  31. #define SDHCI_CTRL2_RWAITMODE (1 << 7)
  32. #define SDHCI_CTRL2_DISBUFRD (1 << 6)
  33. #define SDHCI_CTRL2_SELBASECLK_MASK(_x) ((_x) << 4)
  34. #define SDHCI_CTRL2_SELBASECLK_SHIFT (4)
  35. #define SDHCI_CTRL2_PWRSYNC (1 << 3)
  36. #define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
  37. #define SDHCI_CTRL2_HWINITFIN (1 << 0)
  38. #define SDHCI_CTRL3_FCSEL3 (1 << 31)
  39. #define SDHCI_CTRL3_FCSEL2 (1 << 23)
  40. #define SDHCI_CTRL3_FCSEL1 (1 << 15)
  41. #define SDHCI_CTRL3_FCSEL0 (1 << 7)
  42. #define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
  43. #define SDHCI_CTRL4_DRIVE_SHIFT (16)
  44. #define SDHCI_MAX_HOSTS 4
  45. int s5p_sdhci_init(u32 regbase, int index, int bus_width);
  46. static inline int s5p_mmc_init(int index, int bus_width)
  47. {
  48. unsigned int base = samsung_get_base_mmc() +
  49. (S5P_MMC_DEV_OFFSET * index);
  50. return s5p_sdhci_init(base, index, bus_width);
  51. }
  52. #ifdef CONFIG_OF_CONTROL
  53. int exynos_mmc_init(const void *blob);
  54. #endif
  55. #endif