board-mop500-sdi.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Author: Hanumath Prasad <hanumath.prasad@stericsson.com>
  5. * License terms: GNU General Public License (GPL) version 2
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/gpio.h>
  9. #include <linux/amba/bus.h>
  10. #include <linux/amba/mmci.h>
  11. #include <linux/mmc/host.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/platform_data/dma-ste-dma40.h>
  14. #include <asm/mach-types.h>
  15. #include "devices.h"
  16. #include "db8500-regs.h"
  17. #include "devices-db8500.h"
  18. #include "board-mop500.h"
  19. #include "ste-dma40-db8500.h"
  20. /*
  21. * v2 has a new version of this block that need to be forced, the number found
  22. * in hardware is incorrect
  23. */
  24. #define U8500_SDI_V2_PERIPHID 0x10480180
  25. /*
  26. * SDI 0 (MicroSD slot)
  27. */
  28. #ifdef CONFIG_STE_DMA40
  29. struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
  30. .mode = STEDMA40_MODE_LOGICAL,
  31. .dir = DMA_DEV_TO_MEM,
  32. .dev_type = DB8500_DMA_DEV29_SD_MM0,
  33. };
  34. static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
  35. .mode = STEDMA40_MODE_LOGICAL,
  36. .dir = DMA_MEM_TO_DEV,
  37. .dev_type = DB8500_DMA_DEV29_SD_MM0,
  38. };
  39. #endif
  40. struct mmci_platform_data mop500_sdi0_data = {
  41. .f_max = 100000000,
  42. .capabilities = MMC_CAP_4_BIT_DATA |
  43. MMC_CAP_SD_HIGHSPEED |
  44. MMC_CAP_MMC_HIGHSPEED |
  45. MMC_CAP_ERASE |
  46. MMC_CAP_UHS_SDR12 |
  47. MMC_CAP_UHS_SDR25,
  48. .gpio_wp = -1,
  49. .sigdir = MCI_ST_FBCLKEN |
  50. MCI_ST_CMDDIREN |
  51. MCI_ST_DATA0DIREN |
  52. MCI_ST_DATA2DIREN,
  53. #ifdef CONFIG_STE_DMA40
  54. .dma_filter = stedma40_filter,
  55. .dma_rx_param = &mop500_sdi0_dma_cfg_rx,
  56. .dma_tx_param = &mop500_sdi0_dma_cfg_tx,
  57. #endif
  58. };
  59. /*
  60. * SDI1 (SDIO WLAN)
  61. */
  62. #ifdef CONFIG_STE_DMA40
  63. static struct stedma40_chan_cfg sdi1_dma_cfg_rx = {
  64. .mode = STEDMA40_MODE_LOGICAL,
  65. .dir = DMA_DEV_TO_MEM,
  66. .dev_type = DB8500_DMA_DEV32_SD_MM1,
  67. };
  68. static struct stedma40_chan_cfg sdi1_dma_cfg_tx = {
  69. .mode = STEDMA40_MODE_LOGICAL,
  70. .dir = DMA_MEM_TO_DEV,
  71. .dev_type = DB8500_DMA_DEV32_SD_MM1,
  72. };
  73. #endif
  74. struct mmci_platform_data mop500_sdi1_data = {
  75. .ocr_mask = MMC_VDD_29_30,
  76. .f_max = 100000000,
  77. .capabilities = MMC_CAP_4_BIT_DATA |
  78. MMC_CAP_NONREMOVABLE,
  79. .gpio_cd = -1,
  80. .gpio_wp = -1,
  81. #ifdef CONFIG_STE_DMA40
  82. .dma_filter = stedma40_filter,
  83. .dma_rx_param = &sdi1_dma_cfg_rx,
  84. .dma_tx_param = &sdi1_dma_cfg_tx,
  85. #endif
  86. };
  87. /*
  88. * SDI 2 (POP eMMC, not on DB8500ed)
  89. */
  90. #ifdef CONFIG_STE_DMA40
  91. struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = {
  92. .mode = STEDMA40_MODE_LOGICAL,
  93. .dir = DMA_DEV_TO_MEM,
  94. .dev_type = DB8500_DMA_DEV28_SD_MM2,
  95. };
  96. static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
  97. .mode = STEDMA40_MODE_LOGICAL,
  98. .dir = DMA_MEM_TO_DEV,
  99. .dev_type = DB8500_DMA_DEV28_SD_MM2,
  100. };
  101. #endif
  102. struct mmci_platform_data mop500_sdi2_data = {
  103. .ocr_mask = MMC_VDD_165_195,
  104. .f_max = 100000000,
  105. .capabilities = MMC_CAP_4_BIT_DATA |
  106. MMC_CAP_8_BIT_DATA |
  107. MMC_CAP_NONREMOVABLE |
  108. MMC_CAP_MMC_HIGHSPEED |
  109. MMC_CAP_ERASE |
  110. MMC_CAP_CMD23,
  111. .gpio_cd = -1,
  112. .gpio_wp = -1,
  113. #ifdef CONFIG_STE_DMA40
  114. .dma_filter = stedma40_filter,
  115. .dma_rx_param = &mop500_sdi2_dma_cfg_rx,
  116. .dma_tx_param = &mop500_sdi2_dma_cfg_tx,
  117. #endif
  118. };
  119. /*
  120. * SDI 4 (on-board eMMC)
  121. */
  122. #ifdef CONFIG_STE_DMA40
  123. struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = {
  124. .mode = STEDMA40_MODE_LOGICAL,
  125. .dir = DMA_DEV_TO_MEM,
  126. .dev_type = DB8500_DMA_DEV42_SD_MM4,
  127. };
  128. static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
  129. .mode = STEDMA40_MODE_LOGICAL,
  130. .dir = DMA_MEM_TO_DEV,
  131. .dev_type = DB8500_DMA_DEV42_SD_MM4,
  132. };
  133. #endif
  134. struct mmci_platform_data mop500_sdi4_data = {
  135. .f_max = 100000000,
  136. .capabilities = MMC_CAP_4_BIT_DATA |
  137. MMC_CAP_8_BIT_DATA |
  138. MMC_CAP_NONREMOVABLE |
  139. MMC_CAP_MMC_HIGHSPEED |
  140. MMC_CAP_ERASE |
  141. MMC_CAP_CMD23,
  142. .gpio_cd = -1,
  143. .gpio_wp = -1,
  144. #ifdef CONFIG_STE_DMA40
  145. .dma_filter = stedma40_filter,
  146. .dma_rx_param = &mop500_sdi4_dma_cfg_rx,
  147. .dma_tx_param = &mop500_sdi4_dma_cfg_tx,
  148. #endif
  149. };