ddr_topology_def.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) Marvell International Ltd. and its affiliates
  4. */
  5. #ifndef _DDR_TOPOLOGY_DEF_H
  6. #define _DDR_TOPOLOGY_DEF_H
  7. #include "ddr3_training_ip_def.h"
  8. #include "ddr3_topology_def.h"
  9. #if defined(CONFIG_ARMADA_38X)
  10. #include "ddr3_a38x.h"
  11. #endif
  12. /* bus width in bits */
  13. enum hws_bus_width {
  14. BUS_WIDTH_4,
  15. BUS_WIDTH_8,
  16. BUS_WIDTH_16,
  17. BUS_WIDTH_32
  18. };
  19. enum hws_temperature {
  20. HWS_TEMP_LOW,
  21. HWS_TEMP_NORMAL,
  22. HWS_TEMP_HIGH
  23. };
  24. enum hws_mem_size {
  25. MEM_512M,
  26. MEM_1G,
  27. MEM_2G,
  28. MEM_4G,
  29. MEM_8G,
  30. MEM_SIZE_LAST
  31. };
  32. enum hws_timing {
  33. HWS_TIM_DEFAULT,
  34. HWS_TIM_1T,
  35. HWS_TIM_2T
  36. };
  37. struct bus_params {
  38. /* Chip Select (CS) bitmask (bits 0-CS0, bit 1- CS1 ...) */
  39. u8 cs_bitmask;
  40. /*
  41. * mirror enable/disable
  42. * (bits 0-CS0 mirroring, bit 1- CS1 mirroring ...)
  43. */
  44. int mirror_enable_bitmask;
  45. /* DQS Swap (polarity) - true if enable */
  46. int is_dqs_swap;
  47. /* CK swap (polarity) - true if enable */
  48. int is_ck_swap;
  49. };
  50. struct if_params {
  51. /* bus configuration */
  52. struct bus_params as_bus_params[MAX_BUS_NUM];
  53. /* Speed Bin Table */
  54. enum hws_speed_bin speed_bin_index;
  55. /* bus width of memory */
  56. enum hws_bus_width bus_width;
  57. /* Bus memory size (MBit) */
  58. enum hws_mem_size memory_size;
  59. /* The DDR frequency for each interfaces */
  60. enum hws_ddr_freq memory_freq;
  61. /*
  62. * delay CAS Write Latency
  63. * - 0 for using default value (jedec suggested)
  64. */
  65. u8 cas_wl;
  66. /*
  67. * delay CAS Latency
  68. * - 0 for using default value (jedec suggested)
  69. */
  70. u8 cas_l;
  71. /* operation temperature */
  72. enum hws_temperature interface_temp;
  73. /* 2T vs 1T mode (by default computed from number of CSs) */
  74. enum hws_timing timing;
  75. };
  76. struct hws_topology_map {
  77. /* Number of interfaces (default is 12) */
  78. u8 if_act_mask;
  79. /* Controller configuration per interface */
  80. struct if_params interface_params[MAX_INTERFACE_NUM];
  81. /* BUS per interface (default is 4) */
  82. u8 num_of_bus_per_interface;
  83. /* Bit mask for active buses */
  84. u8 bus_act_mask;
  85. };
  86. /* DDR3 training global configuration parameters */
  87. struct tune_train_params {
  88. u32 ck_delay;
  89. u32 ck_delay_16;
  90. u32 p_finger;
  91. u32 n_finger;
  92. u32 phy_reg3_val;
  93. };
  94. #endif /* _DDR_TOPOLOGY_DEF_H */