emif_plat.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Definitions for TI EMIF device platform data
  3. *
  4. * Copyright (C) 2012 Texas Instruments, Inc.
  5. *
  6. * Aneesh V <aneesh@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __EMIF_PLAT_H
  13. #define __EMIF_PLAT_H
  14. /* Low power modes - EMIF_PWR_MGMT_CTRL */
  15. #define EMIF_LP_MODE_DISABLE 0
  16. #define EMIF_LP_MODE_CLOCK_STOP 1
  17. #define EMIF_LP_MODE_SELF_REFRESH 2
  18. #define EMIF_LP_MODE_PWR_DN 4
  19. /* Hardware capabilities */
  20. #define EMIF_HW_CAPS_LL_INTERFACE 0x00000001
  21. /*
  22. * EMIF IP Revisions
  23. * EMIF4D - Used in OMAP4
  24. * EMIF4D5 - Used in OMAP5
  25. */
  26. #define EMIF_4D 1
  27. #define EMIF_4D5 2
  28. /*
  29. * PHY types
  30. * ATTILAPHY - Used in OMAP4
  31. * INTELLIPHY - Used in OMAP5
  32. */
  33. #define EMIF_PHY_TYPE_ATTILAPHY 1
  34. #define EMIF_PHY_TYPE_INTELLIPHY 2
  35. /* Custom config requests */
  36. #define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001
  37. #define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002
  38. #define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART 0x00000004
  39. #ifndef __ASSEMBLY__
  40. /**
  41. * struct ddr_device_info - All information about the DDR device except AC
  42. * timing parameters
  43. * @type: Device type (LPDDR2-S4, LPDDR2-S2 etc)
  44. * @density: Device density
  45. * @io_width: Bus width
  46. * @cs1_used: Whether there is a DDR device attached to the second
  47. * chip-select(CS1) of this EMIF instance
  48. * @cal_resistors_per_cs: Whether there is one calibration resistor per
  49. * chip-select or whether it's a single one for both
  50. * @manufacturer: Manufacturer name string
  51. */
  52. struct ddr_device_info {
  53. u32 type;
  54. u32 density;
  55. u32 io_width;
  56. u32 cs1_used;
  57. u32 cal_resistors_per_cs;
  58. char manufacturer[10];
  59. };
  60. /**
  61. * struct emif_custom_configs - Custom configuration parameters/policies
  62. * passed from the platform layer
  63. * @mask: Mask to indicate which configs are requested
  64. * @lpmode: LPMODE to be used in PWR_MGMT_CTRL register
  65. * @lpmode_timeout_performance: Timeout before LPMODE entry when higher
  66. * performance is desired at the cost of power (typically
  67. * at higher OPPs)
  68. * @lpmode_timeout_power: Timeout before LPMODE entry when better power
  69. * savings is desired and performance is not important
  70. * (typically at lower loads indicated by lower OPPs)
  71. * @lpmode_freq_threshold: The DDR frequency threshold to identify between
  72. * the above two cases:
  73. * timeout = (freq >= lpmode_freq_threshold) ?
  74. * lpmode_timeout_performance :
  75. * lpmode_timeout_power;
  76. * @temp_alert_poll_interval_ms: LPDDR2 MR4 polling interval at nominal
  77. * temperature(in milliseconds). When temperature is high
  78. * polling is done 4 times as frequently.
  79. */
  80. struct emif_custom_configs {
  81. u32 mask;
  82. u32 lpmode;
  83. u32 lpmode_timeout_performance;
  84. u32 lpmode_timeout_power;
  85. u32 lpmode_freq_threshold;
  86. u32 temp_alert_poll_interval_ms;
  87. };
  88. /**
  89. * struct emif_platform_data - Platform data passed on EMIF platform
  90. * device creation. Used by the driver.
  91. * @hw_caps: Hw capabilities of the EMIF IP in the respective SoC
  92. * @device_info: Device info structure containing information such
  93. * as type, bus width, density etc
  94. * @timings: Timings information from device datasheet passed
  95. * as an array of 'struct lpddr2_timings'. Can be NULL
  96. * if if default timings are ok
  97. * @timings_arr_size: Size of the timings array. Depends on the number
  98. * of different frequencies for which timings data
  99. * is provided
  100. * @min_tck: Minimum value of some timing parameters in terms
  101. * of number of cycles. Can be NULL if default values
  102. * are ok
  103. * @custom_configs: Custom configurations requested by SoC or board
  104. * code and the data for them. Can be NULL if default
  105. * configurations done by the driver are ok. See
  106. * documentation for 'struct emif_custom_configs' for
  107. * more details
  108. */
  109. struct emif_platform_data {
  110. u32 hw_caps;
  111. struct ddr_device_info *device_info;
  112. const struct lpddr2_timings *timings;
  113. u32 timings_arr_size;
  114. const struct lpddr2_min_tck *min_tck;
  115. struct emif_custom_configs *custom_configs;
  116. u32 ip_rev;
  117. u32 phy_type;
  118. };
  119. #endif /* __ASSEMBLY__ */
  120. #endif /* __LINUX_EMIF_H */