fsl_errata.h 2.0 KB

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