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