ddr3_axp_config.h 3.9 KB

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