sdioh.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /*
  2. * SDIO Host Controller Spec header file
  3. * Register map and definitions for the Standard Host Controller
  4. *
  5. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  6. *
  7. * Copyright (C) 1999-2020, Broadcom Corporation
  8. *
  9. * Unless you and Broadcom execute a separate written software license
  10. * agreement governing use of this software, this software is licensed to you
  11. * under the terms of the GNU General Public License version 2 (the "GPL"),
  12. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  13. * following added to such license:
  14. *
  15. * As a special exception, the copyright holders of this software give you
  16. * permission to link this software with independent modules, and to copy and
  17. * distribute the resulting executable under terms of your choice, provided that
  18. * you also meet, for each linked independent module, the terms and conditions of
  19. * the license of that module. An independent module is a module which is not
  20. * derived from this software. The special exception does not apply to any
  21. * modifications of the software.
  22. *
  23. * Notwithstanding the above, under no circumstances may you combine this
  24. * software in any way with any other Broadcom software provided under a license
  25. * other than the GPL, without Broadcom's express prior written consent.
  26. *
  27. *
  28. * <<Broadcom-WL-IPTag/Open:>>
  29. *
  30. * $Id: sdioh.h 514727 2014-11-12 03:02:48Z $
  31. */
  32. #ifndef _SDIOH_H
  33. #define _SDIOH_H
  34. #define SD_SysAddr 0x000
  35. #define SD_BlockSize 0x004
  36. #define SD_BlockCount 0x006
  37. #define SD_Arg0 0x008
  38. #define SD_Arg1 0x00A
  39. #define SD_TransferMode 0x00C
  40. #define SD_Command 0x00E
  41. #define SD_Response0 0x010
  42. #define SD_Response1 0x012
  43. #define SD_Response2 0x014
  44. #define SD_Response3 0x016
  45. #define SD_Response4 0x018
  46. #define SD_Response5 0x01A
  47. #define SD_Response6 0x01C
  48. #define SD_Response7 0x01E
  49. #define SD_BufferDataPort0 0x020
  50. #define SD_BufferDataPort1 0x022
  51. #define SD_PresentState 0x024
  52. #define SD_HostCntrl 0x028
  53. #define SD_PwrCntrl 0x029
  54. #define SD_BlockGapCntrl 0x02A
  55. #define SD_WakeupCntrl 0x02B
  56. #define SD_ClockCntrl 0x02C
  57. #define SD_TimeoutCntrl 0x02E
  58. #define SD_SoftwareReset 0x02F
  59. #define SD_IntrStatus 0x030
  60. #define SD_ErrorIntrStatus 0x032
  61. #define SD_IntrStatusEnable 0x034
  62. #define SD_ErrorIntrStatusEnable 0x036
  63. #define SD_IntrSignalEnable 0x038
  64. #define SD_ErrorIntrSignalEnable 0x03A
  65. #define SD_CMD12ErrorStatus 0x03C
  66. #define SD_Capabilities 0x040
  67. #define SD_Capabilities3 0x044
  68. #define SD_MaxCurCap 0x048
  69. #define SD_MaxCurCap_Reserved 0x04C
  70. #define SD_ADMA_ErrStatus 0x054
  71. #define SD_ADMA_SysAddr 0x58
  72. #define SD_SlotInterruptStatus 0x0FC
  73. #define SD_HostControllerVersion 0x0FE
  74. #define SD_GPIO_Reg 0x100
  75. #define SD_GPIO_OE 0x104
  76. #define SD_GPIO_Enable 0x108
  77. /* SD specific registers in PCI config space */
  78. #define SD_SlotInfo 0x40
  79. /* HC 3.0 specific registers and offsets */
  80. #define SD3_HostCntrl2 0x03E
  81. /* preset regsstart and count */
  82. #define SD3_PresetValStart 0x060
  83. #define SD3_PresetValCount 8
  84. /* preset-indiv regs */
  85. #define SD3_PresetVal_init 0x060
  86. #define SD3_PresetVal_default 0x062
  87. #define SD3_PresetVal_HS 0x064
  88. #define SD3_PresetVal_SDR12 0x066
  89. #define SD3_PresetVal_SDR25 0x068
  90. #define SD3_PresetVal_SDR50 0x06a
  91. #define SD3_PresetVal_SDR104 0x06c
  92. #define SD3_PresetVal_DDR50 0x06e
  93. /* SDIO3.0 Revx specific Registers */
  94. #define SD3_Tuning_Info_Register 0x0EC
  95. #define SD3_WL_BT_reset_register 0x0F0
  96. /* preset value indices */
  97. #define SD3_PRESETVAL_INITIAL_IX 0
  98. #define SD3_PRESETVAL_DESPEED_IX 1
  99. #define SD3_PRESETVAL_HISPEED_IX 2
  100. #define SD3_PRESETVAL_SDR12_IX 3
  101. #define SD3_PRESETVAL_SDR25_IX 4
  102. #define SD3_PRESETVAL_SDR50_IX 5
  103. #define SD3_PRESETVAL_SDR104_IX 6
  104. #define SD3_PRESETVAL_DDR50_IX 7
  105. /* SD_Capabilities reg (0x040) */
  106. #define CAP_TO_CLKFREQ_M BITFIELD_MASK(6)
  107. #define CAP_TO_CLKFREQ_S 0
  108. #define CAP_TO_CLKUNIT_M BITFIELD_MASK(1)
  109. #define CAP_TO_CLKUNIT_S 7
  110. /* Note: for sdio-2.0 case, this mask has to be 6 bits, but msb 2
  111. bits are reserved. going ahead with 8 bits, as it is req for 3.0
  112. */
  113. #define CAP_BASECLK_M BITFIELD_MASK(8)
  114. #define CAP_BASECLK_S 8
  115. #define CAP_MAXBLOCK_M BITFIELD_MASK(2)
  116. #define CAP_MAXBLOCK_S 16
  117. #define CAP_ADMA2_M BITFIELD_MASK(1)
  118. #define CAP_ADMA2_S 19
  119. #define CAP_ADMA1_M BITFIELD_MASK(1)
  120. #define CAP_ADMA1_S 20
  121. #define CAP_HIGHSPEED_M BITFIELD_MASK(1)
  122. #define CAP_HIGHSPEED_S 21
  123. #define CAP_DMA_M BITFIELD_MASK(1)
  124. #define CAP_DMA_S 22
  125. #define CAP_SUSPEND_M BITFIELD_MASK(1)
  126. #define CAP_SUSPEND_S 23
  127. #define CAP_VOLT_3_3_M BITFIELD_MASK(1)
  128. #define CAP_VOLT_3_3_S 24
  129. #define CAP_VOLT_3_0_M BITFIELD_MASK(1)
  130. #define CAP_VOLT_3_0_S 25
  131. #define CAP_VOLT_1_8_M BITFIELD_MASK(1)
  132. #define CAP_VOLT_1_8_S 26
  133. #define CAP_64BIT_HOST_M BITFIELD_MASK(1)
  134. #define CAP_64BIT_HOST_S 28
  135. #define SDIO_OCR_READ_FAIL (2)
  136. #define CAP_ASYNCINT_SUP_M BITFIELD_MASK(1)
  137. #define CAP_ASYNCINT_SUP_S 29
  138. #define CAP_SLOTTYPE_M BITFIELD_MASK(2)
  139. #define CAP_SLOTTYPE_S 30
  140. #define CAP3_MSBits_OFFSET (32)
  141. /* note: following are caps MSB32 bits.
  142. So the bits start from 0, instead of 32. that is why
  143. CAP3_MSBits_OFFSET is subtracted.
  144. */
  145. #define CAP3_SDR50_SUP_M BITFIELD_MASK(1)
  146. #define CAP3_SDR50_SUP_S (32 - CAP3_MSBits_OFFSET)
  147. #define CAP3_SDR104_SUP_M BITFIELD_MASK(1)
  148. #define CAP3_SDR104_SUP_S (33 - CAP3_MSBits_OFFSET)
  149. #define CAP3_DDR50_SUP_M BITFIELD_MASK(1)
  150. #define CAP3_DDR50_SUP_S (34 - CAP3_MSBits_OFFSET)
  151. /* for knowing the clk caps in a single read */
  152. #define CAP3_30CLKCAP_M BITFIELD_MASK(3)
  153. #define CAP3_30CLKCAP_S (32 - CAP3_MSBits_OFFSET)
  154. #define CAP3_DRIVTYPE_A_M BITFIELD_MASK(1)
  155. #define CAP3_DRIVTYPE_A_S (36 - CAP3_MSBits_OFFSET)
  156. #define CAP3_DRIVTYPE_C_M BITFIELD_MASK(1)
  157. #define CAP3_DRIVTYPE_C_S (37 - CAP3_MSBits_OFFSET)
  158. #define CAP3_DRIVTYPE_D_M BITFIELD_MASK(1)
  159. #define CAP3_DRIVTYPE_D_S (38 - CAP3_MSBits_OFFSET)
  160. #define CAP3_RETUNING_TC_M BITFIELD_MASK(4)
  161. #define CAP3_RETUNING_TC_S (40 - CAP3_MSBits_OFFSET)
  162. #define CAP3_TUNING_SDR50_M BITFIELD_MASK(1)
  163. #define CAP3_TUNING_SDR50_S (45 - CAP3_MSBits_OFFSET)
  164. #define CAP3_RETUNING_MODES_M BITFIELD_MASK(2)
  165. #define CAP3_RETUNING_MODES_S (46 - CAP3_MSBits_OFFSET)
  166. #define CAP3_RETUNING_TC_DISABLED (0x0)
  167. #define CAP3_RETUNING_TC_1024S (0xB)
  168. #define CAP3_RETUNING_TC_OTHER (0xF)
  169. #define CAP3_CLK_MULT_M BITFIELD_MASK(8)
  170. #define CAP3_CLK_MULT_S (48 - CAP3_MSBits_OFFSET)
  171. #define PRESET_DRIVR_SELECT_M BITFIELD_MASK(2)
  172. #define PRESET_DRIVR_SELECT_S 14
  173. #define PRESET_CLK_DIV_M BITFIELD_MASK(10)
  174. #define PRESET_CLK_DIV_S 0
  175. /* SD_MaxCurCap reg (0x048) */
  176. #define CAP_CURR_3_3_M BITFIELD_MASK(8)
  177. #define CAP_CURR_3_3_S 0
  178. #define CAP_CURR_3_0_M BITFIELD_MASK(8)
  179. #define CAP_CURR_3_0_S 8
  180. #define CAP_CURR_1_8_M BITFIELD_MASK(8)
  181. #define CAP_CURR_1_8_S 16
  182. /* SD_SysAddr: Offset 0x0000, Size 4 bytes */
  183. /* SD_BlockSize: Offset 0x004, Size 2 bytes */
  184. #define BLKSZ_BLKSZ_M BITFIELD_MASK(12)
  185. #define BLKSZ_BLKSZ_S 0
  186. #define BLKSZ_BNDRY_M BITFIELD_MASK(3)
  187. #define BLKSZ_BNDRY_S 12
  188. /* SD_BlockCount: Offset 0x006, size 2 bytes */
  189. /* SD_Arg0: Offset 0x008, size = 4 bytes */
  190. /* SD_TransferMode Offset 0x00C, size = 2 bytes */
  191. #define XFER_DMA_ENABLE_M BITFIELD_MASK(1)
  192. #define XFER_DMA_ENABLE_S 0
  193. #define XFER_BLK_COUNT_EN_M BITFIELD_MASK(1)
  194. #define XFER_BLK_COUNT_EN_S 1
  195. #define XFER_CMD_12_EN_M BITFIELD_MASK(1)
  196. #define XFER_CMD_12_EN_S 2
  197. #define XFER_DATA_DIRECTION_M BITFIELD_MASK(1)
  198. #define XFER_DATA_DIRECTION_S 4
  199. #define XFER_MULTI_BLOCK_M BITFIELD_MASK(1)
  200. #define XFER_MULTI_BLOCK_S 5
  201. /* SD_Command: Offset 0x00E, size = 2 bytes */
  202. /* resp_type field */
  203. #define RESP_TYPE_NONE 0
  204. #define RESP_TYPE_136 1
  205. #define RESP_TYPE_48 2
  206. #define RESP_TYPE_48_BUSY 3
  207. /* type field */
  208. #define CMD_TYPE_NORMAL 0
  209. #define CMD_TYPE_SUSPEND 1
  210. #define CMD_TYPE_RESUME 2
  211. #define CMD_TYPE_ABORT 3
  212. #define CMD_RESP_TYPE_M BITFIELD_MASK(2) /* Bits [0-1] - Response type */
  213. #define CMD_RESP_TYPE_S 0
  214. #define CMD_CRC_EN_M BITFIELD_MASK(1) /* Bit 3 - CRC enable */
  215. #define CMD_CRC_EN_S 3
  216. #define CMD_INDEX_EN_M BITFIELD_MASK(1) /* Bit 4 - Enable index checking */
  217. #define CMD_INDEX_EN_S 4
  218. #define CMD_DATA_EN_M BITFIELD_MASK(1) /* Bit 5 - Using DAT line */
  219. #define CMD_DATA_EN_S 5
  220. #define CMD_TYPE_M BITFIELD_MASK(2) /* Bit [6-7] - Normal, abort, resume, etc
  221. */
  222. #define CMD_TYPE_S 6
  223. #define CMD_INDEX_M BITFIELD_MASK(6) /* Bits [8-13] - Command number */
  224. #define CMD_INDEX_S 8
  225. /* SD_BufferDataPort0 : Offset 0x020, size = 2 or 4 bytes */
  226. /* SD_BufferDataPort1 : Offset 0x022, size = 2 bytes */
  227. /* SD_PresentState : Offset 0x024, size = 4 bytes */
  228. #define PRES_CMD_INHIBIT_M BITFIELD_MASK(1) /* Bit 0 May use CMD */
  229. #define PRES_CMD_INHIBIT_S 0
  230. #define PRES_DAT_INHIBIT_M BITFIELD_MASK(1) /* Bit 1 May use DAT */
  231. #define PRES_DAT_INHIBIT_S 1
  232. #define PRES_DAT_BUSY_M BITFIELD_MASK(1) /* Bit 2 DAT is busy */
  233. #define PRES_DAT_BUSY_S 2
  234. #define PRES_PRESENT_RSVD_M BITFIELD_MASK(5) /* Bit [3-7] rsvd */
  235. #define PRES_PRESENT_RSVD_S 3
  236. #define PRES_WRITE_ACTIVE_M BITFIELD_MASK(1) /* Bit 8 Write is active */
  237. #define PRES_WRITE_ACTIVE_S 8
  238. #define PRES_READ_ACTIVE_M BITFIELD_MASK(1) /* Bit 9 Read is active */
  239. #define PRES_READ_ACTIVE_S 9
  240. #define PRES_WRITE_DATA_RDY_M BITFIELD_MASK(1) /* Bit 10 Write buf is avail */
  241. #define PRES_WRITE_DATA_RDY_S 10
  242. #define PRES_READ_DATA_RDY_M BITFIELD_MASK(1) /* Bit 11 Read buf data avail */
  243. #define PRES_READ_DATA_RDY_S 11
  244. #define PRES_CARD_PRESENT_M BITFIELD_MASK(1) /* Bit 16 Card present - debounced */
  245. #define PRES_CARD_PRESENT_S 16
  246. #define PRES_CARD_STABLE_M BITFIELD_MASK(1) /* Bit 17 Debugging */
  247. #define PRES_CARD_STABLE_S 17
  248. #define PRES_CARD_PRESENT_RAW_M BITFIELD_MASK(1) /* Bit 18 Not debounced */
  249. #define PRES_CARD_PRESENT_RAW_S 18
  250. #define PRES_WRITE_ENABLED_M BITFIELD_MASK(1) /* Bit 19 Write protected? */
  251. #define PRES_WRITE_ENABLED_S 19
  252. #define PRES_DAT_SIGNAL_M BITFIELD_MASK(4) /* Bit [20-23] Debugging */
  253. #define PRES_DAT_SIGNAL_S 20
  254. #define PRES_CMD_SIGNAL_M BITFIELD_MASK(1) /* Bit 24 Debugging */
  255. #define PRES_CMD_SIGNAL_S 24
  256. /* SD_HostCntrl: Offset 0x028, size = 1 bytes */
  257. #define HOST_LED_M BITFIELD_MASK(1) /* Bit 0 LED On/Off */
  258. #define HOST_LED_S 0
  259. #define HOST_DATA_WIDTH_M BITFIELD_MASK(1) /* Bit 1 4 bit enable */
  260. #define HOST_DATA_WIDTH_S 1
  261. #define HOST_HI_SPEED_EN_M BITFIELD_MASK(1) /* Bit 2 High speed vs low speed */
  262. #define HOST_DMA_SEL_S 3
  263. #define HOST_DMA_SEL_M BITFIELD_MASK(2) /* Bit 4:3 DMA Select */
  264. #define HOST_HI_SPEED_EN_S 2
  265. /* Host Control2: */
  266. #define HOSTCtrl2_PRESVAL_EN_M BITFIELD_MASK(1) /* 1 bit */
  267. #define HOSTCtrl2_PRESVAL_EN_S 15 /* bit# */
  268. #define HOSTCtrl2_ASYINT_EN_M BITFIELD_MASK(1) /* 1 bit */
  269. #define HOSTCtrl2_ASYINT_EN_S 14 /* bit# */
  270. #define HOSTCtrl2_SAMPCLK_SEL_M BITFIELD_MASK(1) /* 1 bit */
  271. #define HOSTCtrl2_SAMPCLK_SEL_S 7 /* bit# */
  272. #define HOSTCtrl2_EXEC_TUNING_M BITFIELD_MASK(1) /* 1 bit */
  273. #define HOSTCtrl2_EXEC_TUNING_S 6 /* bit# */
  274. #define HOSTCtrl2_DRIVSTRENGTH_SEL_M BITFIELD_MASK(2) /* 2 bit */
  275. #define HOSTCtrl2_DRIVSTRENGTH_SEL_S 4 /* bit# */
  276. #define HOSTCtrl2_1_8SIG_EN_M BITFIELD_MASK(1) /* 1 bit */
  277. #define HOSTCtrl2_1_8SIG_EN_S 3 /* bit# */
  278. #define HOSTCtrl2_UHSMODE_SEL_M BITFIELD_MASK(3) /* 3 bit */
  279. #define HOSTCtrl2_UHSMODE_SEL_S 0 /* bit# */
  280. #define HOST_CONTR_VER_2 (1)
  281. #define HOST_CONTR_VER_3 (2)
  282. /* misc defines */
  283. #define SD1_MODE 0x1 /* SD Host Cntrlr Spec */
  284. #define SD4_MODE 0x2 /* SD Host Cntrlr Spec */
  285. /* SD_PwrCntrl: Offset 0x029, size = 1 bytes */
  286. #define PWR_BUS_EN_M BITFIELD_MASK(1) /* Bit 0 Power the bus */
  287. #define PWR_BUS_EN_S 0
  288. #define PWR_VOLTS_M BITFIELD_MASK(3) /* Bit [1-3] Voltage Select */
  289. #define PWR_VOLTS_S 1
  290. /* SD_SoftwareReset: Offset 0x02F, size = 1 byte */
  291. #define SW_RESET_ALL_M BITFIELD_MASK(1) /* Bit 0 Reset All */
  292. #define SW_RESET_ALL_S 0
  293. #define SW_RESET_CMD_M BITFIELD_MASK(1) /* Bit 1 CMD Line Reset */
  294. #define SW_RESET_CMD_S 1
  295. #define SW_RESET_DAT_M BITFIELD_MASK(1) /* Bit 2 DAT Line Reset */
  296. #define SW_RESET_DAT_S 2
  297. /* SD_IntrStatus: Offset 0x030, size = 2 bytes */
  298. /* Defs also serve SD_IntrStatusEnable and SD_IntrSignalEnable */
  299. #define INTSTAT_CMD_COMPLETE_M BITFIELD_MASK(1) /* Bit 0 */
  300. #define INTSTAT_CMD_COMPLETE_S 0
  301. #define INTSTAT_XFER_COMPLETE_M BITFIELD_MASK(1)
  302. #define INTSTAT_XFER_COMPLETE_S 1
  303. #define INTSTAT_BLOCK_GAP_EVENT_M BITFIELD_MASK(1)
  304. #define INTSTAT_BLOCK_GAP_EVENT_S 2
  305. #define INTSTAT_DMA_INT_M BITFIELD_MASK(1)
  306. #define INTSTAT_DMA_INT_S 3
  307. #define INTSTAT_BUF_WRITE_READY_M BITFIELD_MASK(1)
  308. #define INTSTAT_BUF_WRITE_READY_S 4
  309. #define INTSTAT_BUF_READ_READY_M BITFIELD_MASK(1)
  310. #define INTSTAT_BUF_READ_READY_S 5
  311. #define INTSTAT_CARD_INSERTION_M BITFIELD_MASK(1)
  312. #define INTSTAT_CARD_INSERTION_S 6
  313. #define INTSTAT_CARD_REMOVAL_M BITFIELD_MASK(1)
  314. #define INTSTAT_CARD_REMOVAL_S 7
  315. #define INTSTAT_CARD_INT_M BITFIELD_MASK(1)
  316. #define INTSTAT_CARD_INT_S 8
  317. #define INTSTAT_RETUNING_INT_M BITFIELD_MASK(1) /* Bit 12 */
  318. #define INTSTAT_RETUNING_INT_S 12
  319. #define INTSTAT_ERROR_INT_M BITFIELD_MASK(1) /* Bit 15 */
  320. #define INTSTAT_ERROR_INT_S 15
  321. /* SD_ErrorIntrStatus: Offset 0x032, size = 2 bytes */
  322. /* Defs also serve SD_ErrorIntrStatusEnable and SD_ErrorIntrSignalEnable */
  323. #define ERRINT_CMD_TIMEOUT_M BITFIELD_MASK(1)
  324. #define ERRINT_CMD_TIMEOUT_S 0
  325. #define ERRINT_CMD_CRC_M BITFIELD_MASK(1)
  326. #define ERRINT_CMD_CRC_S 1
  327. #define ERRINT_CMD_ENDBIT_M BITFIELD_MASK(1)
  328. #define ERRINT_CMD_ENDBIT_S 2
  329. #define ERRINT_CMD_INDEX_M BITFIELD_MASK(1)
  330. #define ERRINT_CMD_INDEX_S 3
  331. #define ERRINT_DATA_TIMEOUT_M BITFIELD_MASK(1)
  332. #define ERRINT_DATA_TIMEOUT_S 4
  333. #define ERRINT_DATA_CRC_M BITFIELD_MASK(1)
  334. #define ERRINT_DATA_CRC_S 5
  335. #define ERRINT_DATA_ENDBIT_M BITFIELD_MASK(1)
  336. #define ERRINT_DATA_ENDBIT_S 6
  337. #define ERRINT_CURRENT_LIMIT_M BITFIELD_MASK(1)
  338. #define ERRINT_CURRENT_LIMIT_S 7
  339. #define ERRINT_AUTO_CMD12_M BITFIELD_MASK(1)
  340. #define ERRINT_AUTO_CMD12_S 8
  341. #define ERRINT_VENDOR_M BITFIELD_MASK(4)
  342. #define ERRINT_VENDOR_S 12
  343. #define ERRINT_ADMA_M BITFIELD_MASK(1)
  344. #define ERRINT_ADMA_S 9
  345. /* Also provide definitions in "normal" form to allow combined masks */
  346. #define ERRINT_CMD_TIMEOUT_BIT 0x0001
  347. #define ERRINT_CMD_CRC_BIT 0x0002
  348. #define ERRINT_CMD_ENDBIT_BIT 0x0004
  349. #define ERRINT_CMD_INDEX_BIT 0x0008
  350. #define ERRINT_DATA_TIMEOUT_BIT 0x0010
  351. #define ERRINT_DATA_CRC_BIT 0x0020
  352. #define ERRINT_DATA_ENDBIT_BIT 0x0040
  353. #define ERRINT_CURRENT_LIMIT_BIT 0x0080
  354. #define ERRINT_AUTO_CMD12_BIT 0x0100
  355. #define ERRINT_ADMA_BIT 0x0200
  356. /* Masks to select CMD vs. DATA errors */
  357. #define ERRINT_CMD_ERRS (ERRINT_CMD_TIMEOUT_BIT | ERRINT_CMD_CRC_BIT |\
  358. ERRINT_CMD_ENDBIT_BIT | ERRINT_CMD_INDEX_BIT)
  359. #define ERRINT_DATA_ERRS (ERRINT_DATA_TIMEOUT_BIT | ERRINT_DATA_CRC_BIT |\
  360. ERRINT_DATA_ENDBIT_BIT | ERRINT_ADMA_BIT)
  361. #define ERRINT_TRANSFER_ERRS (ERRINT_CMD_ERRS | ERRINT_DATA_ERRS)
  362. /* SD_WakeupCntr_BlockGapCntrl : Offset 0x02A , size = bytes */
  363. /* SD_ClockCntrl : Offset 0x02C , size = bytes */
  364. /* SD_SoftwareReset_TimeoutCntrl : Offset 0x02E , size = bytes */
  365. /* SD_IntrStatus : Offset 0x030 , size = bytes */
  366. /* SD_ErrorIntrStatus : Offset 0x032 , size = bytes */
  367. /* SD_IntrStatusEnable : Offset 0x034 , size = bytes */
  368. /* SD_ErrorIntrStatusEnable : Offset 0x036 , size = bytes */
  369. /* SD_IntrSignalEnable : Offset 0x038 , size = bytes */
  370. /* SD_ErrorIntrSignalEnable : Offset 0x03A , size = bytes */
  371. /* SD_CMD12ErrorStatus : Offset 0x03C , size = bytes */
  372. /* SD_Capabilities : Offset 0x040 , size = bytes */
  373. /* SD_MaxCurCap : Offset 0x048 , size = bytes */
  374. /* SD_MaxCurCap_Reserved: Offset 0x04C , size = bytes */
  375. /* SD_SlotInterruptStatus: Offset 0x0FC , size = bytes */
  376. /* SD_HostControllerVersion : Offset 0x0FE , size = bytes */
  377. /* SDIO Host Control Register DMA Mode Definitions */
  378. #define SDIOH_SDMA_MODE 0
  379. #define SDIOH_ADMA1_MODE 1
  380. #define SDIOH_ADMA2_MODE 2
  381. #define SDIOH_ADMA2_64_MODE 3
  382. #define ADMA2_ATTRIBUTE_VALID (1 << 0) /* ADMA Descriptor line valid */
  383. #define ADMA2_ATTRIBUTE_END (1 << 1) /* End of Descriptor */
  384. #define ADMA2_ATTRIBUTE_INT (1 << 2) /* Interrupt when line is done */
  385. #define ADMA2_ATTRIBUTE_ACT_NOP (0 << 4) /* Skip current line, go to next. */
  386. #define ADMA2_ATTRIBUTE_ACT_RSV (1 << 4) /* Same as NOP */
  387. #define ADMA1_ATTRIBUTE_ACT_SET (1 << 4) /* ADMA1 Only - set transfer length */
  388. #define ADMA2_ATTRIBUTE_ACT_TRAN (2 << 4) /* Transfer Data of one descriptor line. */
  389. #define ADMA2_ATTRIBUTE_ACT_LINK (3 << 4) /* Link Descriptor */
  390. /* ADMA2 Descriptor Table Entry for 32-bit Address */
  391. typedef struct adma2_dscr_32b {
  392. uint32 len_attr;
  393. uint32 phys_addr;
  394. } adma2_dscr_32b_t;
  395. /* ADMA1 Descriptor Table Entry */
  396. typedef struct adma1_dscr {
  397. uint32 phys_addr_attr;
  398. } adma1_dscr_t;
  399. #endif /* _SDIOH_H */