ddr3_axp_config.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) Marvell International Ltd. and its affiliates
  4. */
  5. #ifndef __DDR3_AXP_CONFIG_H
  6. #define __DDR3_AXP_CONFIG_H
  7. /*
  8. * DDR3_LOG_LEVEL Information
  9. *
  10. * Level 0: Provides an error code in a case of failure, RL, WL errors
  11. * and other algorithm failure
  12. * Level 1: Provides the D-Unit setup (SPD/Static configuration)
  13. * Level 2: Provides the windows margin as a results of DQS centeralization
  14. * Level 3: Provides the windows margin of each DQ as a results of DQS
  15. * centeralization
  16. */
  17. #ifdef CONFIG_DDR_LOG_LEVEL
  18. #define DDR3_LOG_LEVEL CONFIG_DDR_LOG_LEVEL
  19. #else
  20. #define DDR3_LOG_LEVEL 0
  21. #endif
  22. #define DDR3_PBS 1
  23. /* This flag allows the execution of SW WL/RL upon HW failure */
  24. #define DDR3_RUN_SW_WHEN_HW_FAIL 1
  25. /*
  26. * General Configurations
  27. *
  28. * The following parameters are required for proper setup:
  29. *
  30. * DDR_TARGET_FABRIC - Set desired fabric configuration
  31. * (for sample@Reset fabfreq parameter)
  32. * DRAM_ECC - Set ECC support 1/0
  33. * BUS_WIDTH - 64/32 bit
  34. * CONFIG_SPD_EEPROM - Enables auto detection of DIMMs and their timing values
  35. * DQS_CLK_ALIGNED - Set this if CLK and DQS signals are aligned on board
  36. * MIXED_DIMM_STATIC - Mixed DIMM + On board devices support (ODT registers
  37. * values are taken statically)
  38. * DDR3_TRAINING_DEBUG - Debug prints of internal code
  39. */
  40. #define DDR_TARGET_FABRIC 5
  41. /* Only enable ECC if the board selects it */
  42. #ifdef CONFIG_BOARD_ECC_SUPPORT
  43. #define DRAM_ECC 1
  44. #else
  45. #define DRAM_ECC 0
  46. #endif
  47. #ifdef CONFIG_DDR_32BIT
  48. #define BUS_WIDTH 32
  49. #else
  50. #define BUS_WIDTH 64
  51. #endif
  52. #undef DQS_CLK_ALIGNED
  53. #undef MIXED_DIMM_STATIC
  54. #define DDR3_TRAINING_DEBUG 0
  55. #define REG_DIMM_SKIP_WL 0
  56. /* Marvell boards specific configurations */
  57. #if defined(DB_78X60_PCAC)
  58. #undef CONFIG_SPD_EEPROM
  59. #define STATIC_TRAINING
  60. #endif
  61. #if defined(DB_78X60_AMC)
  62. #undef CONFIG_SPD_EEPROM
  63. #undef DRAM_ECC
  64. #define DRAM_ECC 1
  65. #endif
  66. #ifdef CONFIG_SPD_EEPROM
  67. /*
  68. * DIMM support parameters:
  69. * DRAM_2T - Set Desired 2T Mode - 0 - 1T, 0x1 - 2T, 0x2 - 3T
  70. * DIMM_CS_BITMAP - bitmap representing the optional CS in DIMMs
  71. * (0xF=CS0+CS1+CS2+CS3, 0xC=CS2+CS3...)
  72. */
  73. #define DRAM_2T 0x0
  74. #define DIMM_CS_BITMAP 0xF
  75. #define DUNIT_SPD
  76. #endif
  77. #ifdef DRAM_ECC
  78. /*
  79. * ECC support parameters:
  80. *
  81. * U_BOOT_START_ADDR, U_BOOT_SCRUB_SIZE - relevant when using ECC and need
  82. * to configure the scrubbing area
  83. */
  84. #define TRAINING_SIZE 0x20000
  85. #define U_BOOT_START_ADDR 0
  86. #define U_BOOT_SCRUB_SIZE 0x1000000 /* TRAINING_SIZE */
  87. #endif
  88. /*
  89. * Registered DIMM Support - In case registered DIMM is attached,
  90. * please supply the following values:
  91. * (see JEDEC - JESD82-29A "Definition of the SSTE32882 Registering Clock
  92. * Driver with Parity and Quad Chip
  93. * Selects for DDR3/DDR3L/DDR3U RDIMM 1.5 V/1.35 V/1.25 V Applications")
  94. * RC0: Global Features Control Word
  95. * RC1: Clock Driver Enable Control Word
  96. * RC2: Timing Control Word
  97. * RC3-RC5 - taken from SPD
  98. * RC8: Additional IBT Setting Control Word
  99. * RC9: Power Saving Settings Control Word
  100. * RC10: Encoding for RDIMM Operating Speed
  101. * RC11: Operating Voltage VDD and VREFCA Control Word
  102. */
  103. #define RDIMM_RC0 0
  104. #define RDIMM_RC1 0
  105. #define RDIMM_RC2 0
  106. #define RDIMM_RC8 0
  107. #define RDIMM_RC9 0
  108. #define RDIMM_RC10 0x2
  109. #define RDIMM_RC11 0x0
  110. #if defined(MIXED_DIMM_STATIC) || !defined(CONFIG_SPD_EEPROM)
  111. #define DUNIT_STATIC
  112. #endif
  113. #if defined(MIXED_DIMM_STATIC) || defined(CONFIG_SPD_EEPROM)
  114. /*
  115. * This flag allows the user to change the dram refresh cycle in ps,
  116. * only in case of SPD or MIX DIMM topology
  117. */
  118. #define TREFI_USER_EN
  119. #ifdef TREFI_USER_EN
  120. #define TREFI_USER 3900000
  121. #endif
  122. #endif
  123. #ifdef CONFIG_SPD_EEPROM
  124. /*
  125. * AUTO_DETECTION_SUPPORT - relevant ONLY for Marvell DB boards.
  126. * Enables I2C auto detection different options
  127. */
  128. #if defined(CONFIG_DB_88F78X60) || defined(CONFIG_DB_88F78X60_REV2) || \
  129. defined(CONFIG_DB_784MP_GP)
  130. #define AUTO_DETECTION_SUPPORT
  131. #endif
  132. #endif
  133. #endif /* __DDR3_AXP_CONFIG_H */