sd.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * include/linux/mmc/sd.h
  3. *
  4. * Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or (at
  9. * your option) any later version.
  10. */
  11. #ifndef MMC_SD_H
  12. #define MMC_SD_H
  13. /* SD commands type argument response */
  14. /* class 0 */
  15. /* This is basically the same command as for MMC with some quirks. */
  16. #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
  17. #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
  18. /* class 10 */
  19. #define SD_SWITCH 6 /* adtc [31:0] See below R1 */
  20. /* Application commands */
  21. #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
  22. #define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
  23. #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
  24. #define SD_APP_SEND_SCR 51 /* adtc R1 */
  25. /*
  26. * SD_SWITCH argument format:
  27. *
  28. * [31] Check (0) or switch (1)
  29. * [30:24] Reserved (0)
  30. * [23:20] Function group 6
  31. * [19:16] Function group 5
  32. * [15:12] Function group 4
  33. * [11:8] Function group 3
  34. * [7:4] Function group 2
  35. * [3:0] Function group 1
  36. */
  37. /*
  38. * SD_SEND_IF_COND argument format:
  39. *
  40. * [31:12] Reserved (0)
  41. * [11:8] Host Voltage Supply Flags
  42. * [7:0] Check Pattern (0xAA)
  43. */
  44. /*
  45. * SCR field definitions
  46. */
  47. #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
  48. #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
  49. #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
  50. /*
  51. * SD bus widths
  52. */
  53. #define SD_BUS_WIDTH_1 0
  54. #define SD_BUS_WIDTH_4 2
  55. /*
  56. * SD_SWITCH mode
  57. */
  58. #define SD_SWITCH_CHECK 0
  59. #define SD_SWITCH_SET 1
  60. /*
  61. * SD_SWITCH function groups
  62. */
  63. #define SD_SWITCH_GRP_ACCESS 0
  64. /*
  65. * SD_SWITCH access modes
  66. */
  67. #define SD_SWITCH_ACCESS_DEF 0
  68. #define SD_SWITCH_ACCESS_HS 1
  69. #endif