mmc.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (C) 2004-2006 Atmel Corporation
  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 __ASM_AVR32_MMC_H
  23. #define __ASM_AVR32_MMC_H
  24. struct mmc_cid {
  25. unsigned long psn;
  26. unsigned short oid;
  27. unsigned char mid;
  28. unsigned char prv;
  29. unsigned char mdt;
  30. char pnm[7];
  31. };
  32. struct mmc_csd
  33. {
  34. u8 csd_structure:2,
  35. spec_vers:4,
  36. rsvd1:2;
  37. u8 taac;
  38. u8 nsac;
  39. u8 tran_speed;
  40. u16 ccc:12,
  41. read_bl_len:4;
  42. u64 read_bl_partial:1,
  43. write_blk_misalign:1,
  44. read_blk_misalign:1,
  45. dsr_imp:1,
  46. rsvd2:2,
  47. c_size:12,
  48. vdd_r_curr_min:3,
  49. vdd_r_curr_max:3,
  50. vdd_w_curr_min:3,
  51. vdd_w_curr_max:3,
  52. c_size_mult:3,
  53. sector_size:5,
  54. erase_grp_size:5,
  55. wp_grp_size:5,
  56. wp_grp_enable:1,
  57. default_ecc:2,
  58. r2w_factor:3,
  59. write_bl_len:4,
  60. write_bl_partial:1,
  61. rsvd3:5;
  62. u8 file_format_grp:1,
  63. copy:1,
  64. perm_write_protect:1,
  65. tmp_write_protect:1,
  66. file_format:2,
  67. ecc:2;
  68. u8 crc:7;
  69. u8 one:1;
  70. };
  71. /* MMC Command numbers */
  72. #define MMC_CMD_GO_IDLE_STATE 0
  73. #define MMC_CMD_SEND_OP_COND 1
  74. #define MMC_CMD_ALL_SEND_CID 2
  75. #define MMC_CMD_SET_RELATIVE_ADDR 3
  76. #define MMC_CMD_SD_SEND_RELATIVE_ADDR 3
  77. #define MMC_CMD_SET_DSR 4
  78. #define MMC_CMD_SELECT_CARD 7
  79. #define MMC_CMD_SEND_CSD 9
  80. #define MMC_CMD_SEND_CID 10
  81. #define MMC_CMD_SEND_STATUS 13
  82. #define MMC_CMD_SET_BLOCKLEN 16
  83. #define MMC_CMD_READ_SINGLE_BLOCK 17
  84. #define MMC_CMD_READ_MULTIPLE_BLOCK 18
  85. #define MMC_CMD_WRITE_BLOCK 24
  86. #define MMC_CMD_APP_CMD 55
  87. #define MMC_ACMD_SD_SEND_OP_COND 41
  88. #define R1_ILLEGAL_COMMAND (1 << 22)
  89. #define R1_APP_CMD (1 << 5)
  90. #endif /* __ASM_AVR32_MMC_H */