imxmmc.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #define MMC_REG_STR_STP_CLK 0x00
  2. #define MMC_REG_STATUS 0x04
  3. #define MMC_REG_CLK_RATE 0x08
  4. #define MMC_REG_CMD_DAT_CONT 0x0C
  5. #define MMC_REG_RES_TO 0x10
  6. #define MMC_REG_READ_TO 0x14
  7. #define MMC_REG_BLK_LEN 0x18
  8. #define MMC_REG_NOB 0x1C
  9. #define MMC_REG_REV_NO 0x20
  10. #define MMC_REG_INT_MASK 0x24
  11. #define MMC_REG_CMD 0x28
  12. #define MMC_REG_ARGH 0x2C
  13. #define MMC_REG_ARGL 0x30
  14. #define MMC_REG_RES_FIFO 0x34
  15. #define MMC_REG_BUFFER_ACCESS 0x38
  16. #define STR_STP_CLK_IPG_CLK_GATE_DIS (1<<15)
  17. #define STR_STP_CLK_IPG_PERCLK_GATE_DIS (1<<14)
  18. #define STR_STP_CLK_ENDIAN (1<<5)
  19. #define STR_STP_CLK_RESET (1<<3)
  20. #define STR_STP_CLK_ENABLE (1<<2)
  21. #define STR_STP_CLK_START_CLK (1<<1)
  22. #define STR_STP_CLK_STOP_CLK (1<<0)
  23. #define STATUS_CARD_PRESENCE (1<<15)
  24. #define STATUS_SDIO_INT_ACTIVE (1<<14)
  25. #define STATUS_END_CMD_RESP (1<<13)
  26. #define STATUS_WRITE_OP_DONE (1<<12)
  27. #define STATUS_DATA_TRANS_DONE (1<<11)
  28. #define STATUS_WR_CRC_ERROR_CODE_MASK (3<<10)
  29. #define STATUS_CARD_BUS_CLK_RUN (1<<8)
  30. #define STATUS_APPL_BUFF_FF (1<<7)
  31. #define STATUS_APPL_BUFF_FE (1<<6)
  32. #define STATUS_RESP_CRC_ERR (1<<5)
  33. #define STATUS_CRC_READ_ERR (1<<3)
  34. #define STATUS_CRC_WRITE_ERR (1<<2)
  35. #define STATUS_TIME_OUT_RESP (1<<1)
  36. #define STATUS_TIME_OUT_READ (1<<0)
  37. #define STATUS_ERR_MASK 0x2f
  38. #define CLK_RATE_PRESCALER(x) ((x) & 0x7)
  39. #define CLK_RATE_CLK_RATE(x) (((x) & 0x7) << 3)
  40. #define CMD_DAT_CONT_CMD_RESP_LONG_OFF (1<<12)
  41. #define CMD_DAT_CONT_STOP_READWAIT (1<<11)
  42. #define CMD_DAT_CONT_START_READWAIT (1<<10)
  43. #define CMD_DAT_CONT_BUS_WIDTH_1 (0<<8)
  44. #define CMD_DAT_CONT_BUS_WIDTH_4 (2<<8)
  45. #define CMD_DAT_CONT_INIT (1<<7)
  46. #define CMD_DAT_CONT_BUSY (1<<6)
  47. #define CMD_DAT_CONT_STREAM_BLOCK (1<<5)
  48. #define CMD_DAT_CONT_WRITE (1<<4)
  49. #define CMD_DAT_CONT_DATA_ENABLE (1<<3)
  50. #define CMD_DAT_CONT_RESPONSE_FORMAT_R1 (1)
  51. #define CMD_DAT_CONT_RESPONSE_FORMAT_R2 (2)
  52. #define CMD_DAT_CONT_RESPONSE_FORMAT_R3 (3)
  53. #define CMD_DAT_CONT_RESPONSE_FORMAT_R4 (4)
  54. #define CMD_DAT_CONT_RESPONSE_FORMAT_R5 (5)
  55. #define CMD_DAT_CONT_RESPONSE_FORMAT_R6 (6)
  56. #define INT_MASK_AUTO_CARD_DETECT (1<<6)
  57. #define INT_MASK_DAT0_EN (1<<5)
  58. #define INT_MASK_SDIO (1<<4)
  59. #define INT_MASK_BUF_READY (1<<3)
  60. #define INT_MASK_END_CMD_RES (1<<2)
  61. #define INT_MASK_WRITE_OP_DONE (1<<1)
  62. #define INT_MASK_DATA_TRAN (1<<0)
  63. #define INT_ALL (0x7f)