emmc_csl_sdprot.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. /*
  2. * Copyright (c) 2016 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CSL_SD_PROT_H
  7. #define CSL_SD_PROT_H
  8. #define SD_CARD_UNKNOWN 0 /* bad type or unrecognized */
  9. #define SD_CARD_SD 1 /* IO only card */
  10. #define SD_CARD_SDIO 2 /* memory only card */
  11. #define SD_CARD_COMBO 3 /* IO and memory combo card */
  12. #define SD_CARD_MMC 4 /* memory only card */
  13. #define SD_CARD_CEATA 5 /* IO and memory combo card */
  14. #define SD_IO_FIXED_ADDRESS 0 /* fix Address */
  15. #define SD_IO_INCREMENT_ADDRESS 1
  16. #define SD_HIGH_CAPACITY_CARD 0x40000000
  17. #define MMC_CMD_IDLE_RESET_ARG 0xF0F0F0F0
  18. /* Supported operating voltages are 3.2-3.3 and 3.3-3.4 */
  19. #define MMC_OCR_OP_VOLT 0x00300000
  20. /* Enable sector access mode */
  21. #define MMC_OCR_SECTOR_ACCESS_MODE 0x40000000
  22. /* command index */
  23. #define SD_CMD_GO_IDLE_STATE 0 /* mandatory for SDIO */
  24. #define SD_CMD_SEND_OPCOND 1
  25. #define SD_CMD_ALL_SEND_CID 2
  26. #define SD_CMD_MMC_SET_RCA 3
  27. #define SD_CMD_MMC_SET_DSR 4
  28. #define SD_CMD_IO_SEND_OP_COND 5 /* mandatory for SDIO */
  29. #define SD_ACMD_SET_BUS_WIDTH 6
  30. #define SD_CMD_SWITCH_FUNC 6
  31. #define SD_CMD_SELECT_DESELECT_CARD 7
  32. #define SD_CMD_READ_EXT_CSD 8
  33. #define SD_CMD_SEND_CSD 9
  34. #define SD_CMD_SEND_CID 10
  35. #define SD_CMD_STOP_TRANSMISSION 12
  36. #define SD_CMD_SEND_STATUS 13
  37. #define SD_ACMD_SD_STATUS 13
  38. #define SD_CMD_GO_INACTIVE_STATE 15
  39. #define SD_CMD_SET_BLOCKLEN 16
  40. #define SD_CMD_READ_SINGLE_BLOCK 17
  41. #define SD_CMD_READ_MULTIPLE_BLOCK 18
  42. #define SD_CMD_WRITE_BLOCK 24
  43. #define SD_CMD_WRITE_MULTIPLE_BLOCK 25
  44. #define SD_CMD_PROGRAM_CSD 27
  45. #define SD_CMD_SET_WRITE_PROT 28
  46. #define SD_CMD_CLR_WRITE_PROT 29
  47. #define SD_CMD_SEND_WRITE_PROT 30
  48. #define SD_CMD_ERASE_WR_BLK_START 32
  49. #define SD_CMD_ERASE_WR_BLK_END 33
  50. #define SD_CMD_ERASE_GROUP_START 35
  51. #define SD_CMD_ERASE_GROUP_END 36
  52. #define SD_CMD_ERASE 38
  53. #define SD_CMD_LOCK_UNLOCK 42
  54. #define SD_CMD_IO_RW_DIRECT 52 /* mandatory for SDIO */
  55. #define SD_CMD_IO_RW_EXTENDED 53 /* mandatory for SDIO */
  56. #define SD_CMD_APP_CMD 55
  57. #define SD_CMD_GEN_CMD 56
  58. #define SD_CMD_READ_OCR 58
  59. #define SD_CMD_CRC_ON_OFF 59 /* mandatory for SDIO */
  60. #define SD_ACMD_SEND_NUM_WR_BLOCKS 22
  61. #define SD_ACMD_SET_WR_BLOCK_ERASE_CNT 23
  62. #define SD_ACMD_SD_SEND_OP_COND 41
  63. #define SD_ACMD_SET_CLR_CARD_DETECT 42
  64. #define SD_ACMD_SEND_SCR 51
  65. /* response parameters */
  66. #define SD_RSP_NO_NONE 0
  67. #define SD_RSP_NO_1 1
  68. #define SD_RSP_NO_2 2
  69. #define SD_RSP_NO_3 3
  70. #define SD_RSP_NO_4 4
  71. #define SD_RSP_NO_5 5
  72. #define SD_RSP_NO_6 6
  73. /* Modified R6 response (to CMD3) */
  74. #define SD_RSP_MR6_COM_CRC_ERROR 0x8000
  75. #define SD_RSP_MR6_ILLEGAL_COMMAND 0x4000
  76. #define SD_RSP_MR6_ERROR 0x2000
  77. /* Modified R1 in R4 Response (to CMD5) */
  78. #define SD_RSP_MR1_SBIT 0x80
  79. #define SD_RSP_MR1_PARAMETER_ERROR 0x40
  80. #define SD_RSP_MR1_RFU5 0x20
  81. #define SD_RSP_MR1_FUNC_NUM_ERROR 0x10
  82. #define SD_RSP_MR1_COM_CRC_ERROR 0x80
  83. #define SD_RSP_MR1_ILLEGAL_COMMAND 0x40
  84. #define SD_RSP_MR1_RFU1 0x20
  85. #define SD_RSP_MR1_IDLE_STATE 0x01
  86. /* R5 response (to CMD52 and CMD53) */
  87. #define SD_RSP_R5_COM_CRC_ERROR 0x80
  88. #define SD_RSP_R5_ILLEGAL_COMMAND 0x40
  89. #define SD_RSP_R5_IO_CURRENTSTATE1 0x20
  90. #define SD_RSP_R5_IO_CURRENTSTATE0 0x10
  91. #define SD_RSP_R5_ERROR 0x80
  92. #define SD_RSP_R5_RFU 0x40
  93. #define SD_RSP_R5_FUNC_NUM_ERROR 0x20
  94. #define SD_RSP_R5_OUT_OF_RANGE 0x01
  95. /* argument for SD_CMD_IO_RW_DIRECT and SD_CMD_IO_RW_EXTENDED */
  96. #define SD_OP_READ 0 /* Read_Write */
  97. #define SD_OP_WRITE 1 /* Read_Write */
  98. #define SD_RW_NORMAL 0 /* no RAW */
  99. #define SD_RW_RAW 1 /* RAW */
  100. #define SD_BYTE_MODE 0 /* Byte Mode */
  101. #define SD_BLOCK_MODE 1 /* BlockMode */
  102. #define SD_FIXED_ADDRESS 0 /* fix Address */
  103. #define SD_INCREMENT_ADDRESS 1 /* IncrementAddress */
  104. #define SD_CMD5_ARG_IO_OCR_MASK 0x00FFFFFF
  105. #define SD_CMD5_ARG_IO_OCR_SHIFT 0
  106. #define SD_CMD55_ARG_RCA_SHIFT 16
  107. #define SD_CMD59_ARG_CRC_OPTION_MASK 0x01
  108. #define SD_CMD59_ARG_CRC_OPTION_SHIFT 0
  109. /* SD_CMD_IO_RW_DIRECT Argument */
  110. #define SdioIoRWDirectArg(rw, raw, func, addr, data) \
  111. (((rw & 1) << 31) | ((func & 0x7) << 28) | \
  112. ((raw & 1) << 27) | ((addr & 0x1FFFF) << 9) | \
  113. (data & 0xFF))
  114. /* build SD_CMD_IO_RW_EXTENDED Argument */
  115. #define SdioIoRWExtArg(rw, blk, func, addr, inc_addr, count) \
  116. (((rw & 1) << 31) | ((func & 0x7) << 28) | \
  117. ((blk & 1) << 27) | ((inc_addr & 1) << 26) | \
  118. ((addr & 0x1FFFF) << 9) | (count & 0x1FF))
  119. /*
  120. * The Common I/O area shall be implemented on all SDIO cards and
  121. * is accessed the the host via I/O reads and writes to function 0,
  122. * the registers within the CIA are provided to enable/disable
  123. * the operationo fthe i/o function.
  124. */
  125. /* cccr_sdio_rev */
  126. #define SDIO_REV_SDIOID_MASK 0xf0 /* SDIO spec revision number */
  127. #define SDIO_REV_CCCRID_MASK 0x0f /* CCCR format version number */
  128. /* sd_rev */
  129. #define SDIO_REV_PHY_MASK 0x0f /* SD format version number */
  130. #define SDIO_FUNC_ENABLE_1 0x02 /* function 1 I/O enable */
  131. #define SDIO_FUNC_READY_1 0x02 /* function 1 I/O ready */
  132. #define SDIO_INTR_CTL_FUNC1_EN 0x2 /* interrupt enable for function 1 */
  133. #define SDIO_INTR_CTL_MASTER_EN 0x1 /* interrupt enable master */
  134. #define SDIO_INTR_STATUS_FUNC1 0x2 /* interrupt pending for function 1 */
  135. #define SDIO_IO_ABORT_RESET_ALL 0x08 /* I/O card reset */
  136. #define SDIO_IO_ABORT_FUNC_MASK 0x07 /* abort selection: function x */
  137. #define SDIO_BUS_CARD_DETECT_DIS 0x80 /* Card Detect disable */
  138. #define SDIO_BUS_SPI_CONT_INTR_CAP 0x40 /* support continuous SPI interrupt */
  139. #define SDIO_BUS_SPI_CONT_INTR_EN 0x20 /* continuous SPI interrupt enable */
  140. #define SDIO_BUS_DATA_WIDTH_MASK 0x03 /* bus width mask */
  141. #define SDIO_BUS_DATA_WIDTH_4BIT 0x02 /* bus width 4-bit mode */
  142. #define SDIO_BUS_DATA_WIDTH_1BIT 0x00 /* bus width 1-bit mode */
  143. /* capability */
  144. #define SDIO_CAP_4BLS 0x80 /* 4-bit support for low speed card */
  145. #define SDIO_CAP_LSC 0x40 /* low speed card */
  146. #define SDIO_CAP_E4MI 0x20 /* enable int between block in 4-bit mode */
  147. #define SDIO_CAP_S4MI 0x10 /* support int between block in 4-bit mode */
  148. #define SDIO_CAP_SBS 0x08 /* support suspend/resume */
  149. #define SDIO_CAP_SRW 0x04 /* support read wait */
  150. #define SDIO_CAP_SMB 0x02 /* support multi-block transfer */
  151. #define SDIO_CAP_SDC 0x01 /* Support Direct cmd during multi-uint8 transfer */
  152. /* CIA FBR1 registers */
  153. #define SDIO_FUNC1_INFO 0x100 /* basic info for function 1 */
  154. #define SDIO_FUNC1_EXT 0x101 /* extension of standard I/O device */
  155. #define SDIO_CIS_FUNC1_BASE_LOW 0x109 /* function 1 cis address bit 0-7 */
  156. #define SDIO_CIS_FUNC1_BASE_MID 0x10A /* function 1 cis address bit 8-15 */
  157. #define SDIO_CIS_FUNC1_BASE_HIGH 0x10B /* function 1 cis address bit 16 */
  158. #define SDIO_CSA_BASE_LOW 0x10C /* CSA base address uint8_t 0 */
  159. #define SDIO_CSA_BASE_MID 0x10D /* CSA base address uint8_t 1 */
  160. #define SDIO_CSA_BASE_HIGH 0x10E /* CSA base address uint8_t 2 */
  161. #define SDIO_CSA_DATA_OFFSET 0x10F /* CSA data register */
  162. #define SDIO_IO_BLK_SIZE_LOW 0x110 /* I/O block size uint8_t 0 */
  163. #define SDIO_IO_BLK_SIZE_HIGH 0x111 /* I/O block size uint8_t 1 */
  164. /* SD_SDIO_FUNC1_INFO bits */
  165. #define SDIO_FUNC1_INFO_DIC 0x0f /* device interface code */
  166. #define SDIO_FUNC1_INFO_CSA 0x40 /* CSA support flag */
  167. #define SDIO_FUNC1_INFO_CSA_EN 0x80 /* CSA enabled */
  168. /* SD_SDIO_FUNC1_EXT bits */
  169. #define SDIO_FUNC1_EXT_SHP 0x03 /* support high power */
  170. #define SDIO_FUNC1_EXT_EHP 0x04 /* enable high power */
  171. /* devctr */
  172. /* I/O device interface code */
  173. #define SDIO_DEVCTR_DEVINTER 0x0f
  174. /* support CSA */
  175. #define SDIO_DEVCTR_CSA_SUP 0x40
  176. /* enable CSA */
  177. #define SDIO_DEVCTR_CSA_EN 0x80
  178. /* ext_dev */
  179. /* supports high-power mask */
  180. #define SDIO_HIGHPWR_SUPPORT_M 0x3
  181. /* enable high power */
  182. #define SDIO_HIGHPWR_EN 0x4
  183. /* standard power function(up to 200mA */
  184. #define SDIO_HP_STD 0
  185. /* need high power to operate */
  186. #define SDIO_HP_REQUIRED 0x2
  187. /* can work with standard power, but prefer high power */
  188. #define SDIO_HP_DESIRED 0x3
  189. /* misc define */
  190. /* macro to calculate fbr register base */
  191. #define FBR_REG_BASE(n) (n*0x100)
  192. #define SDIO_FUNC_0 0
  193. #define SDIO_FUNC_1 1
  194. #define SDIO_FUNC_2 2
  195. #define SDIO_FUNC_3 3
  196. #define SDIO_FUNC_4 4
  197. #define SDIO_FUNC_5 5
  198. #define SDIO_FUNC_6 6
  199. #define SDIO_FUNC_7 7
  200. /* maximum block size for block mode operation */
  201. #define SDIO_MAX_BLOCK_SIZE 2048
  202. /* minimum block size for block mode operation */
  203. #define SDIO_MIN_BLOCK_SIZE 1
  204. /* Card registers: status bit position */
  205. #define SDIO_STATUS_OUTOFRANGE 31
  206. #define SDIO_STATUS_COMCRCERROR 23
  207. #define SDIO_STATUS_ILLEGALCOMMAND 22
  208. #define SDIO_STATUS_ERROR 19
  209. #define SDIO_STATUS_IOCURRENTSTATE3 12
  210. #define SDIO_STATUS_IOCURRENTSTATE2 11
  211. #define SDIO_STATUS_IOCURRENTSTATE1 10
  212. #define SDIO_STATUS_IOCURRENTSTATE0 9
  213. #define SDIO_STATUS_FUN_NUM_ERROR 4
  214. #define GET_SDIOCARD_STATUS(x) ((x >> 9) & 0x0f)
  215. #define SDIO_STATUS_STATE_IDLE 0
  216. #define SDIO_STATUS_STATE_READY 1
  217. #define SDIO_STATUS_STATE_IDENT 2
  218. #define SDIO_STATUS_STATE_STBY 3
  219. #define SDIO_STATUS_STATE_TRAN 4
  220. #define SDIO_STATUS_STATE_DATA 5
  221. #define SDIO_STATUS_STATE_RCV 6
  222. #define SDIO_STATUS_STATE_PRG 7
  223. #define SDIO_STATUS_STATE_DIS 8
  224. /* sprom */
  225. #define SBSDIO_SPROM_CS 0x10000 /* command and status */
  226. #define SBSDIO_SPROM_INFO 0x10001 /* info register */
  227. #define SBSDIO_SPROM_DATA_LOW 0x10002 /* indirect access data uint8_t 0 */
  228. #define SBSDIO_SPROM_DATA_HIGH 0x10003 /* indirect access data uint8_t 1 */
  229. #define SBSDIO_SPROM_ADDR_LOW 0x10004 /* indirect access addr uint8_t 0 */
  230. #define SBSDIO_SPROM_ADDR_HIGH 0x10005 /* indirect access addr uint8_t 0 */
  231. #define SBSDIO_CHIP_CTRL_DATA 0x10006 /* xtal_pu data output */
  232. #define SBSDIO_CHIP_CTRL_EN 0x10007 /* xtal_pu enable */
  233. #define SBSDIO_WATERMARK 0x10008 /* retired in rev 7 */
  234. #define SBSDIO_DEVICE_CTL 0x10009 /* control busy signal generation */
  235. #define SBSDIO_SPROM_IDLE 0
  236. #define SBSDIO_SPROM_WRITE 1
  237. #define SBSDIO_SPROM_READ 2
  238. #define SBSDIO_SPROM_WEN 4
  239. #define SBSDIO_SPROM_WDS 7
  240. #define SBSDIO_SPROM_DONE 8
  241. /* SBSDIO_SPROM_INFO */
  242. #define SBSDIO_SROM_SZ_MASK 0x03 /* SROM size, 1: 4k, 2: 16k */
  243. #define SBSDIO_SROM_BLANK 0x04 /* depreciated in corerev 6 */
  244. #define SBSDIO_SROM_OTP 0x80 /* OTP present */
  245. /* SBSDIO_CHIP_CTRL */
  246. /* or'd with onchip xtal_pu, 1: power on oscillator */
  247. #define SBSDIO_CHIP_CTRL_XTAL 0x01
  248. /* SBSDIO_WATERMARK */
  249. /* number of bytes minus 1 for sd device to wait before sending data to host */
  250. #define SBSDIO_WATERMARK_MASK 0x3f
  251. /* SBSDIO_DEVICE_CTL */
  252. /* 1: device will assert busy signal when receiving CMD53 */
  253. #define SBSDIO_DEVCTL_SETBUSY 0x01
  254. /* 1: assertion of sdio interrupt is synchronous to the sdio clock */
  255. #define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02
  256. /* function 1 OCP space */
  257. /* sb offset addr is <= 15 bits, 32k */
  258. #define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF
  259. #define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000
  260. /* sdsdio function 1 OCP space has 16/32 bit section */
  261. #define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000
  262. /* direct(mapped) cis space */
  263. /* MAPPED common CIS address */
  264. #define SBSDIO_CIS_BASE_COMMON 0x1000
  265. /* function 0(common) cis size in bytes */
  266. #define SBSDIO_CIS_FUNC0_LIMIT 0x020
  267. /* function 1 cis size in bytes */
  268. #define SBSDIO_CIS_SIZE_LIMIT 0x200
  269. /* cis offset addr is < 17 bits */
  270. #define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF
  271. /* manfid tuple length, include tuple, link bytes */
  272. #define SBSDIO_CIS_MANFID_TUPLE_LEN 6
  273. /* indirect cis access (in sprom) */
  274. /* 8 control bytes first, CIS starts from 8th uint8_t */
  275. #define SBSDIO_SPROM_CIS_OFFSET 0x8
  276. /* sdio uint8_t mode: maximum length of one data command */
  277. #define SBSDIO_BYTEMODE_DATALEN_MAX 64
  278. /* 4317 supports less */
  279. #define SBSDIO_BYTEMODE_DATALEN_MAX_4317 52
  280. /* sdio core function one address mask */
  281. #define SBSDIO_CORE_ADDR_MASK 0x1FFFF
  282. /* CEATA defines */
  283. #define CEATA_EXT_CSDBLOCK_SIZE 512
  284. #define CEATA_FAST_IO 39
  285. #define CEATA_MULTIPLE_REGISTER_RW 60
  286. #define CEATA_MULTIPLE_BLOCK_RW 61
  287. /* defines CE ATA task file registers */
  288. #define CEATA_SCT_CNT_EXP_REG 0x02
  289. #define CEATA_LBA_LOW_EXP_REG 0x03
  290. #define CEATA_LBA_MID_EXP_REG 0x04
  291. #define CEATA_LBA_HIGH_EXP_REG 0x05
  292. #define CEATA_CNTRL_REG 0x06
  293. #define CEATA_FEATURE_REG 0x09 /* write */
  294. #define CEATA_ERROR_REG 0x09 /* read */
  295. #define CEATA_SCT_CNT_REG 0x0A
  296. #define CEATA_LBA_LOW_REG 0x0B
  297. #define CEATA_LBA_MID_REG 0x0C
  298. #define CEATA_LBA_HIGH_REG 0x0D
  299. #define CEATA_DEV_HEAD_REG 0x0E
  300. #define CEATA_STA_REG 0x0F /* read */
  301. #define CEATA_CMD_REG 0x0F /* write */
  302. /* defines CEATA control and status registers for ce ata client driver */
  303. #define CEATA_SCR_TEMPC_REG 0x80
  304. #define CEATA_SCR_TEMPMAXP_REG 0x84
  305. #define CEATA_TEMPMINP_REG 0x88
  306. #define CEATA_SCR_STATUS_REG 0x8C
  307. #define CEATA_SCR_REALLOCSA_REG 0x90
  308. #define CEATA_SCR_ERETRACTSA_REG 0x94
  309. #define CEATA_SCR_CAPABILITIES_REG 0x98
  310. #define CEATA_SCR_CONTROL_REG 0xC0
  311. /* defines for SCR capabilities register bits for ce ata client driver */
  312. #define CEATA_SCR_CAP_512 0x00000001
  313. #define CEATA_SCR_CAP_1K 0x00000002
  314. #define CEATA_SCR_CAP_4K 0x00000004
  315. /* defines CE ATA Control reg bits for ce ata client driver */
  316. #define CEATA_CNTRL_ENABLE_INTR 0x00
  317. #define CEATA_CNTRL_DISABLE_INTR 0x02
  318. #define CEATA_CNTRL_SRST 0x04
  319. #define CEATA_CNTRL_RSRST 0x00
  320. /* define CE ATA Status reg bits for ce ata client driver */
  321. #define CEATA_STA_ERROR_BIT 0x01
  322. #define CEATA_STA_OVR_BIT 0x02
  323. #define CEATA_STA_SPT_BIT 0x04
  324. #define CEATA_STA_DRQ_BIT 0x08
  325. #define CEATA_STA_DRDY_BIT 0x40
  326. #define CEATA_STA_BSY_BIT 0x80
  327. /* define CE ATA Error reg bits for ce ata client driver */
  328. #define CEATA_ERROR_ABORTED_BIT 0x04
  329. #define CEATA_ERROR_IDNF_BIT 0x10
  330. #define CEATA_ERROR_UNCORRECTABLE_BIT 0x40
  331. #define CEATA_ERROR_ICRC_BIT 0x80
  332. /* define CE ATA Commands for ce ata client driver */
  333. #define CEATA_CMD_IDENTIFY_DEVICE 0xEC
  334. #define CEATA_CMD_READ_DMA_EXT 0x25
  335. #define CEATA_CMD_WRITE_DMA_EXT 0x35
  336. #define CEATA_CMD_STANDBY_IMMEDIATE 0xE0
  337. #define CEATA_CMD_FLUSH_CACHE_EXT 0xEA
  338. struct csd_mmc {
  339. uint32_t padding:8;
  340. uint32_t structure:2;
  341. uint32_t csdSpecVer:4;
  342. uint32_t reserved1:2;
  343. uint32_t taac:8;
  344. uint32_t nsac:8;
  345. uint32_t speed:8;
  346. uint32_t classes:12;
  347. uint32_t rdBlkLen:4;
  348. uint32_t rdBlkPartial:1;
  349. uint32_t wrBlkMisalign:1;
  350. uint32_t rdBlkMisalign:1;
  351. uint32_t dsr:1;
  352. uint32_t reserved2:2;
  353. uint32_t size:12;
  354. uint32_t vddRdCurrMin:3;
  355. uint32_t vddRdCurrMax:3;
  356. uint32_t vddWrCurrMin:3;
  357. uint32_t vddWrCurrMax:3;
  358. uint32_t devSizeMulti:3;
  359. uint32_t eraseGrpSize:5;
  360. uint32_t eraseGrpSizeMulti:5;
  361. uint32_t wrProtGroupSize:5;
  362. uint32_t wrProtGroupEnable:1;
  363. uint32_t manuDefEcc:2;
  364. uint32_t wrSpeedFactor:3;
  365. uint32_t wrBlkLen:4;
  366. uint32_t wrBlkPartial:1;
  367. uint32_t reserved5:4;
  368. uint32_t protAppl:1;
  369. uint32_t fileFormatGrp:1;
  370. uint32_t copyFlag:1;
  371. uint32_t permWrProt:1;
  372. uint32_t tmpWrProt:1;
  373. uint32_t fileFormat:2;
  374. uint32_t eccCode:2;
  375. };
  376. /* CSD register*/
  377. union sd_csd {
  378. uint32_t csd[4];
  379. struct csd_mmc mmc;
  380. };
  381. struct sd_card_data {
  382. union sd_csd csd;
  383. };
  384. #endif /* CSL_SD_PROT_H */