Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Definitions for TI EMIF device platform data
0004  *
0005  * Copyright (C) 2012 Texas Instruments, Inc.
0006  *
0007  * Aneesh V <aneesh@ti.com>
0008  */
0009 #ifndef __EMIF_PLAT_H
0010 #define __EMIF_PLAT_H
0011 
0012 /* Low power modes - EMIF_PWR_MGMT_CTRL */
0013 #define EMIF_LP_MODE_DISABLE                0
0014 #define EMIF_LP_MODE_CLOCK_STOP             1
0015 #define EMIF_LP_MODE_SELF_REFRESH           2
0016 #define EMIF_LP_MODE_PWR_DN             4
0017 
0018 /* Hardware capabilities */
0019 #define EMIF_HW_CAPS_LL_INTERFACE           0x00000001
0020 
0021 /*
0022  * EMIF IP Revisions
0023  *  EMIF4D  - Used in OMAP4
0024  *  EMIF4D5 - Used in OMAP5
0025  */
0026 #define EMIF_4D                     1
0027 #define EMIF_4D5                    2
0028 
0029 /*
0030  * PHY types
0031  *  ATTILAPHY  - Used in OMAP4
0032  *  INTELLIPHY - Used in OMAP5
0033  */
0034 #define EMIF_PHY_TYPE_ATTILAPHY             1
0035 #define EMIF_PHY_TYPE_INTELLIPHY            2
0036 
0037 /* Custom config requests */
0038 #define EMIF_CUSTOM_CONFIG_LPMODE           0x00000001
0039 #define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002
0040 #define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART       0x00000004
0041 
0042 #ifndef __ASSEMBLY__
0043 /**
0044  * struct ddr_device_info - All information about the DDR device except AC
0045  *      timing parameters
0046  * @type:   Device type (LPDDR2-S4, LPDDR2-S2 etc)
0047  * @density:    Device density
0048  * @io_width:   Bus width
0049  * @cs1_used:   Whether there is a DDR device attached to the second
0050  *      chip-select(CS1) of this EMIF instance
0051  * @cal_resistors_per_cs: Whether there is one calibration resistor per
0052  *      chip-select or whether it's a single one for both
0053  * @manufacturer: Manufacturer name string
0054  */
0055 struct ddr_device_info {
0056     u32 type;
0057     u32 density;
0058     u32 io_width;
0059     u32 cs1_used;
0060     u32 cal_resistors_per_cs;
0061     char    manufacturer[10];
0062 };
0063 
0064 /**
0065  * struct emif_custom_configs - Custom configuration parameters/policies
0066  *      passed from the platform layer
0067  * @mask:   Mask to indicate which configs are requested
0068  * @lpmode: LPMODE to be used in PWR_MGMT_CTRL register
0069  * @lpmode_timeout_performance: Timeout before LPMODE entry when higher
0070  *      performance is desired at the cost of power (typically
0071  *      at higher OPPs)
0072  * @lpmode_timeout_power: Timeout before LPMODE entry when better power
0073  *      savings is desired and performance is not important
0074  *      (typically at lower loads indicated by lower OPPs)
0075  * @lpmode_freq_threshold: The DDR frequency threshold to identify between
0076  *      the above two cases:
0077  *      timeout = (freq >= lpmode_freq_threshold) ?
0078  *          lpmode_timeout_performance :
0079  *          lpmode_timeout_power;
0080  * @temp_alert_poll_interval_ms: LPDDR2 MR4 polling interval at nominal
0081  *      temperature(in milliseconds). When temperature is high
0082  *      polling is done 4 times as frequently.
0083  */
0084 struct emif_custom_configs {
0085     u32 mask;
0086     u32 lpmode;
0087     u32 lpmode_timeout_performance;
0088     u32 lpmode_timeout_power;
0089     u32 lpmode_freq_threshold;
0090     u32 temp_alert_poll_interval_ms;
0091 };
0092 
0093 /**
0094  * struct emif_platform_data - Platform data passed on EMIF platform
0095  *              device creation. Used by the driver.
0096  * @hw_caps:        Hw capabilities of the EMIF IP in the respective SoC
0097  * @device_info:    Device info structure containing information such
0098  *          as type, bus width, density etc
0099  * @timings:        Timings information from device datasheet passed
0100  *          as an array of 'struct lpddr2_timings'. Can be NULL
0101  *          if if default timings are ok
0102  * @timings_arr_size:   Size of the timings array. Depends on the number
0103  *          of different frequencies for which timings data
0104  *          is provided
0105  * @min_tck:        Minimum value of some timing parameters in terms
0106  *          of number of cycles. Can be NULL if default values
0107  *          are ok
0108  * @custom_configs: Custom configurations requested by SoC or board
0109  *          code and the data for them. Can be NULL if default
0110  *          configurations done by the driver are ok. See
0111  *          documentation for 'struct emif_custom_configs' for
0112  *          more details
0113  */
0114 struct emif_platform_data {
0115     u32 hw_caps;
0116     struct ddr_device_info *device_info;
0117     const struct lpddr2_timings *timings;
0118     u32 timings_arr_size;
0119     const struct lpddr2_min_tck *min_tck;
0120     struct emif_custom_configs *custom_configs;
0121     u32 ip_rev;
0122     u32 phy_type;
0123 };
0124 #endif /* __ASSEMBLY__ */
0125 
0126 #endif /* __LINUX_EMIF_H */