ddr3_logging_def.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) Marvell International Ltd. and its affiliates
  4. */
  5. #ifndef _DDR3_LOGGING_CONFIG_H
  6. #define _DDR3_LOGGING_CONFIG_H
  7. #ifdef SILENT_LIB
  8. #define DEBUG_TRAINING_BIST_ENGINE(level, s)
  9. #define DEBUG_TRAINING_IP(level, s)
  10. #define DEBUG_CENTRALIZATION_ENGINE(level, s)
  11. #define DEBUG_TRAINING_HW_ALG(level, s)
  12. #define DEBUG_TRAINING_IP_ENGINE(level, s)
  13. #define DEBUG_LEVELING(level, s)
  14. #define DEBUG_PBS_ENGINE(level, s)
  15. #define DEBUG_TRAINING_STATIC_IP(level, s)
  16. #define DEBUG_TRAINING_ACCESS(level, s)
  17. #else
  18. #ifdef LIB_FUNCTIONAL_DEBUG_ONLY
  19. #define DEBUG_TRAINING_BIST_ENGINE(level, s)
  20. #define DEBUG_TRAINING_IP_ENGINE(level, s)
  21. #define DEBUG_TRAINING_IP(level, s) \
  22. if (level >= debug_training) \
  23. printf s
  24. #define DEBUG_CENTRALIZATION_ENGINE(level, s) \
  25. if (level >= debug_centralization) \
  26. printf s
  27. #define DEBUG_TRAINING_HW_ALG(level, s) \
  28. if (level >= debug_training_hw_alg) \
  29. printf s
  30. #define DEBUG_LEVELING(level, s) \
  31. if (level >= debug_leveling) \
  32. printf s
  33. #define DEBUG_PBS_ENGINE(level, s) \
  34. if (level >= debug_pbs) \
  35. printf s
  36. #define DEBUG_TRAINING_STATIC_IP(level, s) \
  37. if (level >= debug_training_static) \
  38. printf s
  39. #define DEBUG_TRAINING_ACCESS(level, s) \
  40. if (level >= debug_training_access) \
  41. printf s
  42. #else
  43. #define DEBUG_TRAINING_BIST_ENGINE(level, s) \
  44. if (level >= debug_training_bist) \
  45. printf s
  46. #define DEBUG_TRAINING_IP_ENGINE(level, s) \
  47. if (level >= debug_training_ip) \
  48. printf s
  49. #define DEBUG_TRAINING_IP(level, s) \
  50. if (level >= debug_training) \
  51. printf s
  52. #define DEBUG_CENTRALIZATION_ENGINE(level, s) \
  53. if (level >= debug_centralization) \
  54. printf s
  55. #define DEBUG_TRAINING_HW_ALG(level, s) \
  56. if (level >= debug_training_hw_alg) \
  57. printf s
  58. #define DEBUG_LEVELING(level, s) \
  59. if (level >= debug_leveling) \
  60. printf s
  61. #define DEBUG_PBS_ENGINE(level, s) \
  62. if (level >= debug_pbs) \
  63. printf s
  64. #define DEBUG_TRAINING_STATIC_IP(level, s) \
  65. if (level >= debug_training_static) \
  66. printf s
  67. #define DEBUG_TRAINING_ACCESS(level, s) \
  68. if (level >= debug_training_access) \
  69. printf s
  70. #endif
  71. #endif
  72. /* Logging defines */
  73. enum mv_ddr_debug_level {
  74. DEBUG_LEVEL_TRACE = 1,
  75. DEBUG_LEVEL_INFO = 2,
  76. DEBUG_LEVEL_ERROR = 3,
  77. DEBUG_LEVEL_LAST
  78. };
  79. enum ddr_lib_debug_block {
  80. DEBUG_BLOCK_STATIC,
  81. DEBUG_BLOCK_TRAINING_MAIN,
  82. DEBUG_BLOCK_LEVELING,
  83. DEBUG_BLOCK_CENTRALIZATION,
  84. DEBUG_BLOCK_PBS,
  85. DEBUG_BLOCK_IP,
  86. DEBUG_BLOCK_BIST,
  87. DEBUG_BLOCK_ALG,
  88. DEBUG_BLOCK_DEVICE,
  89. DEBUG_BLOCK_ACCESS,
  90. DEBUG_STAGES_REG_DUMP,
  91. /* All excluding IP and REG_DUMP, should be enabled separatelly */
  92. DEBUG_BLOCK_ALL
  93. };
  94. int ddr3_tip_print_log(u32 dev_num, u32 mem_addr);
  95. int ddr3_tip_print_stability_log(u32 dev_num);
  96. #endif /* _DDR3_LOGGING_CONFIG_H */