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