fsl_errata.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2013 - 2015 Freescale Semiconductor, Inc.
  4. */
  5. #ifndef _FSL_ERRATA_H
  6. #define _FSL_ERRATA_H
  7. #include <common.h>
  8. #if defined(CONFIG_PPC)
  9. #include <asm/processor.h>
  10. #elif defined(CONFIG_ARCH_LS1021A)
  11. #include <asm/arch-ls102xa/immap_ls102xa.h>
  12. #elif defined(CONFIG_FSL_LAYERSCAPE)
  13. #include <asm/arch/soc.h>
  14. #endif
  15. #ifdef CONFIG_SYS_FSL_ERRATUM_A006379
  16. static inline bool has_erratum_a006379(void)
  17. {
  18. u32 svr = get_svr();
  19. if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
  20. ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
  21. ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
  22. ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
  23. ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
  24. ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
  25. ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
  26. return true;
  27. return false;
  28. }
  29. #endif
  30. #ifdef CONFIG_SYS_FSL_ERRATUM_A007186
  31. static inline bool has_erratum_a007186(void)
  32. {
  33. u32 svr = get_svr();
  34. u32 soc = SVR_SOC_VER(svr);
  35. switch (soc) {
  36. case SVR_T4240:
  37. return IS_SVR_REV(svr, 2, 0);
  38. case SVR_T4160:
  39. return IS_SVR_REV(svr, 2, 0);
  40. case SVR_B4860:
  41. return IS_SVR_REV(svr, 2, 0);
  42. case SVR_B4420:
  43. return IS_SVR_REV(svr, 2, 0);
  44. case SVR_T2081:
  45. case SVR_T2080:
  46. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  47. }
  48. return false;
  49. }
  50. #endif
  51. #ifdef CONFIG_SYS_FSL_ERRATUM_A008378
  52. static inline bool has_erratum_a008378(void)
  53. {
  54. u32 svr = get_svr();
  55. u32 soc = SVR_SOC_VER(svr);
  56. switch (soc) {
  57. #ifdef CONFIG_ARCH_LS1021A
  58. case SOC_VER_LS1020:
  59. case SOC_VER_LS1021:
  60. case SOC_VER_LS1022:
  61. case SOC_VER_SLS1020:
  62. return IS_SVR_REV(svr, 1, 0);
  63. #endif
  64. #ifdef CONFIG_PPC
  65. case SVR_T1023:
  66. case SVR_T1024:
  67. return IS_SVR_REV(svr, 1, 0);
  68. case SVR_T1020:
  69. case SVR_T1022:
  70. case SVR_T1040:
  71. case SVR_T1042:
  72. return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  73. #endif
  74. default:
  75. return false;
  76. }
  77. }
  78. #endif
  79. #endif /* _FSL_ERRATA_H */