bfin_sdh.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2008 Analog Device Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __BLACKFIN_SDH_H__
  23. #define __BLACKFIN_SDH_H__
  24. #define MMC_RSP_PRESENT (1 << 0)
  25. #define MMC_RSP_136 (1 << 1) /* 136 bit response */
  26. #define MMC_RSP_CRC (1 << 2) /* expect valid crc */
  27. #define MMC_RSP_BUSY (1 << 3) /* card may send busy */
  28. #define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */
  29. #define MMC_CMD_MASK (3 << 5) /* non-SPI command type */
  30. #define MMC_CMD_AC (0 << 5)
  31. #define MMC_CMD_ADTC (1 << 5)
  32. #define MMC_CMD_BC (2 << 5)
  33. #define MMC_CMD_BCR (3 << 5)
  34. #define MMC_RSP_SPI_S1 (1 << 7) /* one status byte */
  35. #define MMC_RSP_SPI_S2 (1 << 8) /* second byte */
  36. #define MMC_RSP_SPI_B4 (1 << 9) /* four data bytes */
  37. #define MMC_RSP_SPI_BUSY (1 << 10) /* card may send busy */
  38. /*
  39. * These are the native response types, and correspond to valid bit
  40. * patterns of the above flags. One additional valid pattern
  41. * is all zeros, which means we don't expect a response.
  42. */
  43. #define MMC_RSP_NONE (0)
  44. #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
  45. #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
  46. #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
  47. #define MMC_RSP_R3 (MMC_RSP_PRESENT)
  48. #define MMC_RSP_R4 (MMC_RSP_PRESENT)
  49. #define MMC_RSP_R5 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
  50. #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
  51. #define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
  52. #define ILLEGAL_COMMAND (1 << 22)
  53. #define APP_CMD (1 << 5)
  54. #endif