fsl-errata.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /*
  2. * Freescale USB Controller
  3. *
  4. * Copyright 2013 Freescale Semiconductor, Inc.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.h>
  9. #include <fsl_errata.h>
  10. #include<fsl_usb.h>
  11. /* USB Erratum Checking code */
  12. #if defined(CONFIG_PPC) || defined(CONFIG_ARM)
  13. bool has_dual_phy(void)
  14. {
  15. u32 svr = get_svr();
  16. u32 soc = SVR_SOC_VER(svr);
  17. switch (soc) {
  18. #ifdef CONFIG_PPC
  19. case SVR_T1023:
  20. case SVR_T1024:
  21. case SVR_T1013:
  22. case SVR_T1014:
  23. return IS_SVR_REV(svr, 1, 0);
  24. case SVR_T1040:
  25. case SVR_T1042:
  26. case SVR_T1020:
  27. case SVR_T1022:
  28. case SVR_T2080:
  29. case SVR_T2081:
  30. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  31. case SVR_T4240:
  32. case SVR_T4160:
  33. case SVR_T4080:
  34. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  35. #endif
  36. }
  37. return false;
  38. }
  39. bool has_erratum_a006261(void)
  40. {
  41. u32 svr = get_svr();
  42. u32 soc = SVR_SOC_VER(svr);
  43. switch (soc) {
  44. #ifdef CONFIG_PPC
  45. case SVR_P1010:
  46. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  47. case SVR_P2041:
  48. case SVR_P2040:
  49. return IS_SVR_REV(svr, 1, 0) ||
  50. IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 1);
  51. case SVR_P3041:
  52. return IS_SVR_REV(svr, 1, 0) ||
  53. IS_SVR_REV(svr, 1, 1) ||
  54. IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
  55. case SVR_P5010:
  56. case SVR_P5020:
  57. case SVR_P5021:
  58. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  59. case SVR_T4240:
  60. case SVR_T4160:
  61. case SVR_T4080:
  62. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  63. case SVR_T1040:
  64. return IS_SVR_REV(svr, 1, 0);
  65. case SVR_T2080:
  66. case SVR_T2081:
  67. return IS_SVR_REV(svr, 1, 0);
  68. case SVR_P5040:
  69. return IS_SVR_REV(svr, 1, 0);
  70. #endif
  71. }
  72. return false;
  73. }
  74. bool has_erratum_a007075(void)
  75. {
  76. u32 svr = get_svr();
  77. u32 soc = SVR_SOC_VER(svr);
  78. switch (soc) {
  79. #ifdef CONFIG_PPC
  80. case SVR_B4860:
  81. case SVR_B4420:
  82. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  83. case SVR_P1010:
  84. return IS_SVR_REV(svr, 1, 0);
  85. case SVR_P4080:
  86. return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
  87. #endif
  88. }
  89. return false;
  90. }
  91. bool has_erratum_a007798(void)
  92. {
  93. #ifdef CONFIG_PPC
  94. return SVR_SOC_VER(get_svr()) == SVR_T4240 &&
  95. IS_SVR_REV(get_svr(), 2, 0);
  96. #endif
  97. return false;
  98. }
  99. bool has_erratum_a007792(void)
  100. {
  101. u32 svr = get_svr();
  102. u32 soc = SVR_SOC_VER(svr);
  103. switch (soc) {
  104. #ifdef CONFIG_PPC
  105. case SVR_T4240:
  106. case SVR_T4160:
  107. case SVR_T4080:
  108. return IS_SVR_REV(svr, 2, 0);
  109. case SVR_T1024:
  110. case SVR_T1023:
  111. return IS_SVR_REV(svr, 1, 0);
  112. case SVR_T1040:
  113. case SVR_T1042:
  114. case SVR_T1020:
  115. case SVR_T1022:
  116. case SVR_T2080:
  117. case SVR_T2081:
  118. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  119. #endif
  120. }
  121. return false;
  122. }
  123. bool has_erratum_a005697(void)
  124. {
  125. u32 svr = get_svr();
  126. u32 soc = SVR_SOC_VER(svr);
  127. switch (soc) {
  128. #ifdef CONFIG_PPC
  129. case SVR_9131:
  130. case SVR_9132:
  131. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  132. #endif
  133. }
  134. return false;
  135. }
  136. bool has_erratum_a004477(void)
  137. {
  138. u32 svr = get_svr();
  139. u32 soc = SVR_SOC_VER(svr);
  140. switch (soc) {
  141. #ifdef CONFIG_PPC
  142. case SVR_P1010:
  143. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  144. case SVR_P1022:
  145. case SVR_9131:
  146. case SVR_9132:
  147. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  148. case SVR_P2020:
  149. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) ||
  150. IS_SVR_REV(svr, 2, 1);
  151. case SVR_B4860:
  152. case SVR_B4420:
  153. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
  154. case SVR_P4080:
  155. return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
  156. #endif
  157. }
  158. return false;
  159. }
  160. bool has_erratum_a008751(void)
  161. {
  162. u32 svr = get_svr();
  163. u32 soc = SVR_SOC_VER(svr);
  164. switch (soc) {
  165. #ifdef CONFIG_ARM64
  166. case SVR_LS2080A:
  167. case SVR_LS2085A:
  168. return IS_SVR_REV(svr, 1, 0);
  169. #endif
  170. }
  171. return false;
  172. }
  173. bool has_erratum_a010151(void)
  174. {
  175. u32 svr = get_svr();
  176. u32 soc = SVR_SOC_VER(svr);
  177. switch (soc) {
  178. #ifdef CONFIG_ARM64
  179. case SVR_LS2080A:
  180. case SVR_LS2085A:
  181. case SVR_LS1046A:
  182. case SVR_LS1012A:
  183. return IS_SVR_REV(svr, 1, 0);
  184. case SVR_LS1043A:
  185. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  186. #endif
  187. #ifdef CONFIG_LS102XA
  188. case SOC_VER_LS1020:
  189. case SOC_VER_LS1021:
  190. case SOC_VER_LS1022:
  191. case SOC_VER_SLS1020:
  192. return IS_SVR_REV(svr, 2, 0);
  193. #endif
  194. }
  195. return false;
  196. }
  197. #endif