sdhci-esdhc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Freescale eSDHC controller driver generics for OF and pltfm.
  3. *
  4. * Copyright (c) 2007 Freescale Semiconductor, Inc.
  5. * Copyright (c) 2009 MontaVista Software, Inc.
  6. * Copyright (c) 2010 Pengutronix e.K.
  7. * Author: Wolfram Sang <w.sang@pengutronix.de>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License.
  12. */
  13. #ifndef _DRIVERS_MMC_SDHCI_ESDHC_H
  14. #define _DRIVERS_MMC_SDHCI_ESDHC_H
  15. /*
  16. * Ops and quirks for the Freescale eSDHC controller.
  17. */
  18. #define ESDHC_DEFAULT_QUIRKS (SDHCI_QUIRK_FORCE_BLK_SZ_2048 | \
  19. SDHCI_QUIRK_NO_BUSY_IRQ | \
  20. SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | \
  21. SDHCI_QUIRK_PIO_NEEDS_DELAY | \
  22. SDHCI_QUIRK_NO_HISPD_BIT)
  23. /* pltfm-specific */
  24. #define ESDHC_HOST_CONTROL_LE 0x20
  25. /*
  26. * eSDHC register definition
  27. */
  28. /* Present State Register */
  29. #define ESDHC_PRSSTAT 0x24
  30. #define ESDHC_CLOCK_STABLE 0x00000008
  31. /* Protocol Control Register */
  32. #define ESDHC_PROCTL 0x28
  33. #define ESDHC_VOLT_SEL 0x00000400
  34. #define ESDHC_CTRL_4BITBUS (0x1 << 1)
  35. #define ESDHC_CTRL_8BITBUS (0x2 << 1)
  36. #define ESDHC_CTRL_BUSWIDTH_MASK (0x3 << 1)
  37. #define ESDHC_HOST_CONTROL_RES 0x01
  38. /* System Control Register */
  39. #define ESDHC_SYSTEM_CONTROL 0x2c
  40. #define ESDHC_CLOCK_MASK 0x0000fff0
  41. #define ESDHC_PREDIV_SHIFT 8
  42. #define ESDHC_DIVIDER_SHIFT 4
  43. #define ESDHC_CLOCK_SDCLKEN 0x00000008
  44. #define ESDHC_CLOCK_PEREN 0x00000004
  45. #define ESDHC_CLOCK_HCKEN 0x00000002
  46. #define ESDHC_CLOCK_IPGEN 0x00000001
  47. /* Tuning Block Control Register */
  48. #define ESDHC_TBCTL 0x120
  49. #define ESDHC_TB_EN 0x00000004
  50. /* Control Register for DMA transfer */
  51. #define ESDHC_DMA_SYSCTL 0x40c
  52. #define ESDHC_PERIPHERAL_CLK_SEL 0x00080000
  53. #define ESDHC_FLUSH_ASYNC_FIFO 0x00040000
  54. #define ESDHC_DMA_SNOOP 0x00000040
  55. #endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */