ddr3_logging_def.h 2.7 KB

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