ddr_topology_def.h 2.1 KB

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