Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. toshiba.h
  5. Abstract:
  6. This module provides the definitions for the Toshiba host controller
  7. Author(s):
  8. Neil Sandlin (neilsa)
  9. Revisions:
  10. --*/
  11. #ifndef _SDBUS_TOSHIBA_H_
  12. #define _SDBUS_TOSHIBA_H_
  13. //
  14. // Memory registers
  15. //
  16. #define TOMHC_COMMAND 0x00
  17. #define TOMHC_PORT_SEL 0x02
  18. #define TOMHC_ARGUMENT 0x04
  19. #define TOMHC_STOP_INTERNAL 0x08
  20. #define TOMHC_TRANSFER_SECTOR_COUNT 0x0a
  21. #define TOMHC_RESPONSE 0x0c
  22. #define TOMHC_CARD_STATUS 0x1c
  23. #define TOMHC_BUFFER_CTL_AND_ERR 0x1e
  24. #define TOMHC_INTERRUPT_MASK 0x20
  25. #define TOMHC_CARD_CLOCK_CTL 0x24
  26. #define TOMHC_CARD_TRANSFER_LENGTH 0x26
  27. #define TOMHC_OPTIONS 0x28
  28. #define TOMHC_GENERAL_PORT 0x2a
  29. #define TOMHC_ERROR_STATUS 0x2c
  30. #define TOMHC_DATA_PORT 0x30
  31. #define TOMHC_TRANSACTION_CONTROL 0x34
  32. #define TOMHC_SOFTWARE_RESET 0xe0
  33. #define TOMHC_HOST_CORE_VERSION 0xe2
  34. #define TOMHC_MONITOR 0xe6
  35. #define TOMHC_EXT_WRITE_PROTECT_STATUS 0xf6
  36. #define TOMHC_EXT_CARD_DETECT_BY_CTCTZ 0xf8
  37. #define TOMHC_EXT_CARD_DETECT_BY_DATA3 0xfa
  38. #define TOMHC_EXT_CARD_DETECT_BY_CTCTZ_MASK 0xfc
  39. #define TOMHC_EXT_CARD_DETECT_BY_DATA3_MASK 0xfe
  40. //
  41. // Bits defined in TOMHC_COMMAND (0x0)
  42. //
  43. #define TOMHC_CMD_MSSL 0x2000
  44. #define TOMHC_CMD_RWDI 0x1000
  45. #define TOMHC_CMD_NTDT 0x0800
  46. #define TOMHC_CMD_RESP_NORM 0x0000
  47. #define TOMHC_CMD_RESP_NONE 0x0300
  48. #define TOMHC_CMD_RESP_R1456 0x0400
  49. #define TOMHC_CMD_RESP_R1B 0x0500
  50. #define TOMHC_CMD_RESP_R2 0x0600
  51. #define TOMHC_CMD_RESP_R3 0x0700
  52. #define TOMHC_CMD_ACMD 0x0040
  53. #define TOMHC_CMD_AUTHENTICATE 0x0080
  54. //
  55. // Bits defined in TOMHC_CARD_STATUS (0x1c)
  56. //
  57. #define TO_EVT_RESPONSE 0x00000001
  58. #define TO_EVT_RW_END 0x00000004
  59. #define TO_EVT_CARD_REMOVAL 0x00000008
  60. #define TO_EVT_CARD_INSERTION 0x00000010
  61. #define TO_STS_CARD_PRESENT 0x00000020
  62. #define TO_STS_WRITE_PROTECT 0x00000080
  63. #define TOMHC_BCE_CMD_INDEX_ERROR 0x00010000
  64. #define TOMHC_BCE_CRC_ERROR 0x00020000
  65. #define TOMHC_BCE_END_BIT_ERROR 0x00040000
  66. #define TOMHC_BCE_DATA_TIMEOUT 0x00080000
  67. #define TOMHC_BCE_FIFO_OVERFLOW 0x00100000
  68. #define TOMHC_BCE_FIFO_UNDERFLOW 0x00200000
  69. #define TOMHC_BCE_CMD_TIMEOUT 0x00400000
  70. #define TOMHC_BCE_MEMORY_IDLE 0x00800000
  71. #define TO_EVT_BUFFER_FULL 0x01000000
  72. #define TO_EVT_BUFFER_EMPTY 0x02000000
  73. #define TOMHC_BCE_CMD_BUSY 0x40000000
  74. #define TOMHC_BCE_ILLEGAL_ACCESS 0x80000000
  75. //
  76. // Bit defined in TOMHC_CARD_CLOCK_CTL
  77. //
  78. #define TO_CCC_CLOCK_ENABLE 0x0100
  79. #define TO_CCC_CLOCK_DIVISOR_128 0x0020
  80. //------------------------------------------------
  81. // IO registers
  82. //------------------------------------------------
  83. #define TOIOHC_COMMAND 0x100
  84. #define TOIOHC_CARD_SLOT_SELECT 0x102
  85. #define TOIOHC_ARGUMENT 0x104
  86. #define TOIOHC_TRANSFER_DATA_NUM_SET 0x10a
  87. #define TOIOHC_RESPONSE_0 0x10c
  88. #define TOIOHC_RESPONSE_1 0x10e
  89. #define TOIOHC_RESPONSE_2 0x110
  90. #define TOIOHC_RESPONSE_3 0x112
  91. #define TOIOHC_RESPONSE_4 0x114
  92. #define TOIOHC_RESPONSE_5 0x116
  93. #define TOIOHC_RESPONSE_6 0x118
  94. #define TOIOHC_RESPONSE_7 0x11a
  95. #define TOIOHC_CARD_STATUS 0x11c
  96. #define TOIOHC_INTERRUPT_MASK 0x120
  97. #define TOIOHC_TRANSFER_DATA_LEN_SELECT 0x126
  98. #define TOIOHC_CARD_OPTION 0x128
  99. #define TOIOHC_GENERAL_PURPOSE 0x12a
  100. #define TOIOHC_ERROR_DETAIL_1 0x12c
  101. #define TOIOHC_ERROR_DETAIL_2 0x12e
  102. #define TOIOHC_DATA_TRANSFER 0x130
  103. #define TOIOHC_TRANSACTION_CONTROL 0x134
  104. #define TOIOHC_CARD_INTERRUPT_CONTROL 0x136
  105. #define TOIOHC_CLOCK_AND_WAIT_CONTROL 0x138
  106. #define TOIOHC_HOST_INFORMATION 0x13a
  107. #define TOIOHC_ERROR_CONTROL 0x13c
  108. #define TOIOHC_LED_CONTROL 0x13e
  109. #define TOIOHC_SOFTWARE_RESET 0x1e0
  110. #define TOIOHC_SDIO_CORE_REVISION 0x1e2
  111. #define TOIOHC_TOSHIBA_CORE_REVISION 0x1f0
  112. //
  113. // Bits defined in TOIOHC_CLOCK_AND_WAIT_CONTROL
  114. //
  115. #define TOIO_CWCF_CLOCK_ENABLE 0x0100
  116. #define TOIO_CWCF_CARD_WAIT 0x0001
  117. //
  118. // Bits defined in TOIOHC_CARD_INTERRUPT_CONTROL
  119. //
  120. #define TOIO_CICF_CARD_INTERRUPT 0x1000
  121. #define TOIO_CICF_CARD_INTMASK 0x0100
  122. //-----------------------------------------------
  123. // PCI Config definitions
  124. //-----------------------------------------------
  125. #define TOCFG_CLOCK_CONTROL 0x40
  126. #define TOCFG_POWER_CTL1 0x48
  127. #define TOCFG_POWER_CTL2 0x49
  128. #define TOCFG_POWER_CTL3 0x4A
  129. #define TOCFG_CARD_DETECT_MODE 0x4C
  130. #define TOCFG_SD_SLOT_REGISTER 0x50
  131. #define TO_POWER_18 0x01
  132. #define TO_POWER_33 0x02
  133. #endif // _SDBUS_DATA_H_