cmn_plat_def.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2015 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CMN_PLAT_DEF_H
  7. #define CMN_PLAT_DEF_H
  8. #include <bcm_elog.h>
  9. #include <platform_def.h>
  10. #ifndef GET_LOG_LEVEL
  11. #define GET_LOG_LEVEL() LOG_LEVEL
  12. #endif
  13. #ifndef SET_LOG_LEVEL
  14. #define SET_LOG_LEVEL(x) ((void)(x))
  15. #endif
  16. #define PLAT_LOG_NOTICE(...) \
  17. do { \
  18. if (GET_LOG_LEVEL() >= LOG_LEVEL_NOTICE) { \
  19. bcm_elog(LOG_MARKER_NOTICE __VA_ARGS__); \
  20. tf_log(LOG_MARKER_NOTICE __VA_ARGS__); \
  21. } \
  22. } while (0)
  23. #define PLAT_LOG_ERROR(...) \
  24. do { \
  25. if (GET_LOG_LEVEL() >= LOG_LEVEL_ERROR) { \
  26. bcm_elog(LOG_MARKER_ERROR, __VA_ARGS__); \
  27. tf_log(LOG_MARKER_ERROR __VA_ARGS__); \
  28. } \
  29. } while (0)
  30. #define PLAT_LOG_WARN(...) \
  31. do { \
  32. if (GET_LOG_LEVEL() >= LOG_LEVEL_WARNING) { \
  33. bcm_elog(LOG_MARKER_WARNING, __VA_ARGS__);\
  34. tf_log(LOG_MARKER_WARNING __VA_ARGS__); \
  35. } \
  36. } while (0)
  37. #define PLAT_LOG_INFO(...) \
  38. do { \
  39. if (GET_LOG_LEVEL() >= LOG_LEVEL_INFO) { \
  40. bcm_elog(LOG_MARKER_INFO __VA_ARGS__); \
  41. tf_log(LOG_MARKER_INFO __VA_ARGS__); \
  42. } \
  43. } while (0)
  44. #define PLAT_LOG_VERBOSE(...) \
  45. do { \
  46. if (GET_LOG_LEVEL() >= LOG_LEVEL_VERBOSE) { \
  47. bcm_elog(LOG_MARKER_VERBOSE __VA_ARGS__);\
  48. tf_log(LOG_MARKER_VERBOSE __VA_ARGS__); \
  49. } \
  50. } while (0)
  51. /*
  52. * The number of regions like RO(code), coherent and data required by
  53. * different BL stages which need to be mapped in the MMU.
  54. */
  55. #if USE_COHERENT_MEM
  56. #define CMN_BL_REGIONS 3
  57. #else
  58. #define CMN_BL_REGIONS 2
  59. #endif
  60. /*
  61. * FIP definitions
  62. */
  63. #define PLAT_FIP_ATTEMPT_OFFSET 0x20000
  64. #define PLAT_FIP_NUM_ATTEMPTS 128
  65. #define PLAT_BRCM_FIP_QSPI_BASE QSPI_BASE_ADDR
  66. #define PLAT_BRCM_FIP_NAND_BASE NAND_BASE_ADDR
  67. #define PLAT_BRCM_FIP_MAX_SIZE 0x01000000
  68. #define PLAT_BRCM_FIP_BASE PLAT_BRCM_FIP_QSPI_BASE
  69. #endif