fsl-errata.c 4.3 KB

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