unipro.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /*
  2. * drivers/scsi/ufs/unipro.h
  3. *
  4. * Copyright (C) 2013 Samsung Electronics Co., Ltd.
  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
  9. * (at your option) any later version.
  10. */
  11. #ifndef _UNIPRO_H_
  12. #define _UNIPRO_H_
  13. /*
  14. * M-TX Configuration Attributes
  15. */
  16. #define TX_MODE 0x0021
  17. #define TX_HSRATE_SERIES 0x0022
  18. #define TX_HSGEAR 0x0023
  19. #define TX_PWMGEAR 0x0024
  20. #define TX_AMPLITUDE 0x0025
  21. #define TX_HS_SLEWRATE 0x0026
  22. #define TX_SYNC_SOURCE 0x0027
  23. #define TX_HS_SYNC_LENGTH 0x0028
  24. #define TX_HS_PREPARE_LENGTH 0x0029
  25. #define TX_LS_PREPARE_LENGTH 0x002A
  26. #define TX_HIBERN8_CONTROL 0x002B
  27. #define TX_LCC_ENABLE 0x002C
  28. #define TX_PWM_BURST_CLOSURE_EXTENSION 0x002D
  29. #define TX_BYPASS_8B10B_ENABLE 0x002E
  30. #define TX_DRIVER_POLARITY 0x002F
  31. #define TX_HS_UNTERMINATED_LINE_DRIVE_ENABLE 0x0030
  32. #define TX_LS_TERMINATED_LINE_DRIVE_ENABLE 0x0031
  33. #define TX_LCC_SEQUENCER 0x0032
  34. #define TX_MIN_ACTIVATETIME 0x0033
  35. #define TX_PWM_G6_G7_SYNC_LENGTH 0x0034
  36. /*
  37. * M-RX Configuration Attributes
  38. */
  39. #define RX_MODE 0x00A1
  40. #define RX_HSRATE_SERIES 0x00A2
  41. #define RX_HSGEAR 0x00A3
  42. #define RX_PWMGEAR 0x00A4
  43. #define RX_LS_TERMINATED_ENABLE 0x00A5
  44. #define RX_HS_UNTERMINATED_ENABLE 0x00A6
  45. #define RX_ENTER_HIBERN8 0x00A7
  46. #define RX_BYPASS_8B10B_ENABLE 0x00A8
  47. #define RX_TERMINATION_FORCE_ENABLE 0x0089
  48. #define is_mphy_tx_attr(attr) (attr < RX_MODE)
  49. /*
  50. * PHY Adpater attributes
  51. */
  52. #define PA_ACTIVETXDATALANES 0x1560
  53. #define PA_ACTIVERXDATALANES 0x1580
  54. #define PA_TXTRAILINGCLOCKS 0x1564
  55. #define PA_PHY_TYPE 0x1500
  56. #define PA_AVAILTXDATALANES 0x1520
  57. #define PA_AVAILRXDATALANES 0x1540
  58. #define PA_MINRXTRAILINGCLOCKS 0x1543
  59. #define PA_TXPWRSTATUS 0x1567
  60. #define PA_RXPWRSTATUS 0x1582
  61. #define PA_TXFORCECLOCK 0x1562
  62. #define PA_TXPWRMODE 0x1563
  63. #define PA_LEGACYDPHYESCDL 0x1570
  64. #define PA_MAXTXSPEEDFAST 0x1521
  65. #define PA_MAXTXSPEEDSLOW 0x1522
  66. #define PA_MAXRXSPEEDFAST 0x1541
  67. #define PA_MAXRXSPEEDSLOW 0x1542
  68. #define PA_TXLINKSTARTUPHS 0x1544
  69. #define PA_TXSPEEDFAST 0x1565
  70. #define PA_TXSPEEDSLOW 0x1566
  71. #define PA_REMOTEVERINFO 0x15A0
  72. #define PA_TXGEAR 0x1568
  73. #define PA_TXTERMINATION 0x1569
  74. #define PA_HSSERIES 0x156A
  75. #define PA_PWRMODE 0x1571
  76. #define PA_RXGEAR 0x1583
  77. #define PA_RXTERMINATION 0x1584
  78. #define PA_MAXRXPWMGEAR 0x1586
  79. #define PA_MAXRXHSGEAR 0x1587
  80. #define PA_RXHSUNTERMCAP 0x15A5
  81. #define PA_RXLSTERMCAP 0x15A6
  82. #define PA_PACPREQTIMEOUT 0x1590
  83. #define PA_PACPREQEOBTIMEOUT 0x1591
  84. #define PA_HIBERN8TIME 0x15A7
  85. #define PA_LOCALVERINFO 0x15A9
  86. #define PA_TACTIVATE 0x15A8
  87. #define PA_PACPFRAMECOUNT 0x15C0
  88. #define PA_PACPERRORCOUNT 0x15C1
  89. #define PA_PHYTESTCONTROL 0x15C2
  90. #define PA_PWRMODEUSERDATA0 0x15B0
  91. #define PA_PWRMODEUSERDATA1 0x15B1
  92. #define PA_PWRMODEUSERDATA2 0x15B2
  93. #define PA_PWRMODEUSERDATA3 0x15B3
  94. #define PA_PWRMODEUSERDATA4 0x15B4
  95. #define PA_PWRMODEUSERDATA5 0x15B5
  96. #define PA_PWRMODEUSERDATA6 0x15B6
  97. #define PA_PWRMODEUSERDATA7 0x15B7
  98. #define PA_PWRMODEUSERDATA8 0x15B8
  99. #define PA_PWRMODEUSERDATA9 0x15B9
  100. #define PA_PWRMODEUSERDATA10 0x15BA
  101. #define PA_PWRMODEUSERDATA11 0x15BB
  102. #define PA_CONNECTEDTXDATALANES 0x1561
  103. #define PA_CONNECTEDRXDATALANES 0x1581
  104. #define PA_LOGICALLANEMAP 0x15A1
  105. #define PA_SLEEPNOCONFIGTIME 0x15A2
  106. #define PA_STALLNOCONFIGTIME 0x15A3
  107. #define PA_SAVECONFIGTIME 0x15A4
  108. /* PA power modes */
  109. enum {
  110. FAST_MODE = 1,
  111. SLOW_MODE = 2,
  112. FASTAUTO_MODE = 4,
  113. SLOWAUTO_MODE = 5,
  114. UNCHANGED = 7,
  115. };
  116. /* PA TX/RX Frequency Series */
  117. enum {
  118. PA_HS_MODE_A = 1,
  119. PA_HS_MODE_B = 2,
  120. };
  121. enum ufs_pwm_gear_tag {
  122. UFS_PWM_DONT_CHANGE, /* Don't change Gear */
  123. UFS_PWM_G1, /* PWM Gear 1 (default for reset) */
  124. UFS_PWM_G2, /* PWM Gear 2 */
  125. UFS_PWM_G3, /* PWM Gear 3 */
  126. UFS_PWM_G4, /* PWM Gear 4 */
  127. UFS_PWM_G5, /* PWM Gear 5 */
  128. UFS_PWM_G6, /* PWM Gear 6 */
  129. UFS_PWM_G7, /* PWM Gear 7 */
  130. };
  131. enum ufs_hs_gear_tag {
  132. UFS_HS_DONT_CHANGE, /* Don't change Gear */
  133. UFS_HS_G1, /* HS Gear 1 (default for reset) */
  134. UFS_HS_G2, /* HS Gear 2 */
  135. UFS_HS_G3, /* HS Gear 3 */
  136. };
  137. /*
  138. * Data Link Layer Attributes
  139. */
  140. #define DL_TC0TXFCTHRESHOLD 0x2040
  141. #define DL_FC0PROTTIMEOUTVAL 0x2041
  142. #define DL_TC0REPLAYTIMEOUTVAL 0x2042
  143. #define DL_AFC0REQTIMEOUTVAL 0x2043
  144. #define DL_AFC0CREDITTHRESHOLD 0x2044
  145. #define DL_TC0OUTACKTHRESHOLD 0x2045
  146. #define DL_TC1TXFCTHRESHOLD 0x2060
  147. #define DL_FC1PROTTIMEOUTVAL 0x2061
  148. #define DL_TC1REPLAYTIMEOUTVAL 0x2062
  149. #define DL_AFC1REQTIMEOUTVAL 0x2063
  150. #define DL_AFC1CREDITTHRESHOLD 0x2064
  151. #define DL_TC1OUTACKTHRESHOLD 0x2065
  152. #define DL_TXPREEMPTIONCAP 0x2000
  153. #define DL_TC0TXMAXSDUSIZE 0x2001
  154. #define DL_TC0RXINITCREDITVAL 0x2002
  155. #define DL_TC0TXBUFFERSIZE 0x2005
  156. #define DL_PEERTC0PRESENT 0x2046
  157. #define DL_PEERTC0RXINITCREVAL 0x2047
  158. #define DL_TC1TXMAXSDUSIZE 0x2003
  159. #define DL_TC1RXINITCREDITVAL 0x2004
  160. #define DL_TC1TXBUFFERSIZE 0x2006
  161. #define DL_PEERTC1PRESENT 0x2066
  162. #define DL_PEERTC1RXINITCREVAL 0x2067
  163. /*
  164. * Network Layer Attributes
  165. */
  166. #define N_DEVICEID 0x3000
  167. #define N_DEVICEID_VALID 0x3001
  168. #define N_TC0TXMAXSDUSIZE 0x3020
  169. #define N_TC1TXMAXSDUSIZE 0x3021
  170. /*
  171. * Transport Layer Attributes
  172. */
  173. #define T_NUMCPORTS 0x4000
  174. #define T_NUMTESTFEATURES 0x4001
  175. #define T_CONNECTIONSTATE 0x4020
  176. #define T_PEERDEVICEID 0x4021
  177. #define T_PEERCPORTID 0x4022
  178. #define T_TRAFFICCLASS 0x4023
  179. #define T_PROTOCOLID 0x4024
  180. #define T_CPORTFLAGS 0x4025
  181. #define T_TXTOKENVALUE 0x4026
  182. #define T_RXTOKENVALUE 0x4027
  183. #define T_LOCALBUFFERSPACE 0x4028
  184. #define T_PEERBUFFERSPACE 0x4029
  185. #define T_CREDITSTOSEND 0x402A
  186. #define T_CPORTMODE 0x402B
  187. #define T_TC0TXMAXSDUSIZE 0x4060
  188. #define T_TC1TXMAXSDUSIZE 0x4061
  189. #ifdef FALSE
  190. #undef FALSE
  191. #endif
  192. #ifdef TRUE
  193. #undef TRUE
  194. #endif
  195. /* Boolean attribute values */
  196. enum {
  197. FALSE = 0,
  198. TRUE,
  199. };
  200. #endif /* _UNIPRO_H_ */