18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Definitions for TI EMIF device platform data 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Texas Instruments, Inc. 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Aneesh V <aneesh@ti.com> 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci#ifndef __EMIF_PLAT_H 108c2ecf20Sopenharmony_ci#define __EMIF_PLAT_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci/* Low power modes - EMIF_PWR_MGMT_CTRL */ 138c2ecf20Sopenharmony_ci#define EMIF_LP_MODE_DISABLE 0 148c2ecf20Sopenharmony_ci#define EMIF_LP_MODE_CLOCK_STOP 1 158c2ecf20Sopenharmony_ci#define EMIF_LP_MODE_SELF_REFRESH 2 168c2ecf20Sopenharmony_ci#define EMIF_LP_MODE_PWR_DN 4 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* Hardware capabilities */ 198c2ecf20Sopenharmony_ci#define EMIF_HW_CAPS_LL_INTERFACE 0x00000001 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* 228c2ecf20Sopenharmony_ci * EMIF IP Revisions 238c2ecf20Sopenharmony_ci * EMIF4D - Used in OMAP4 248c2ecf20Sopenharmony_ci * EMIF4D5 - Used in OMAP5 258c2ecf20Sopenharmony_ci */ 268c2ecf20Sopenharmony_ci#define EMIF_4D 1 278c2ecf20Sopenharmony_ci#define EMIF_4D5 2 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* 308c2ecf20Sopenharmony_ci * PHY types 318c2ecf20Sopenharmony_ci * ATTILAPHY - Used in OMAP4 328c2ecf20Sopenharmony_ci * INTELLIPHY - Used in OMAP5 338c2ecf20Sopenharmony_ci */ 348c2ecf20Sopenharmony_ci#define EMIF_PHY_TYPE_ATTILAPHY 1 358c2ecf20Sopenharmony_ci#define EMIF_PHY_TYPE_INTELLIPHY 2 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* Custom config requests */ 388c2ecf20Sopenharmony_ci#define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001 398c2ecf20Sopenharmony_ci#define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002 408c2ecf20Sopenharmony_ci#define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART 0x00000004 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 438c2ecf20Sopenharmony_ci/** 448c2ecf20Sopenharmony_ci * struct ddr_device_info - All information about the DDR device except AC 458c2ecf20Sopenharmony_ci * timing parameters 468c2ecf20Sopenharmony_ci * @type: Device type (LPDDR2-S4, LPDDR2-S2 etc) 478c2ecf20Sopenharmony_ci * @density: Device density 488c2ecf20Sopenharmony_ci * @io_width: Bus width 498c2ecf20Sopenharmony_ci * @cs1_used: Whether there is a DDR device attached to the second 508c2ecf20Sopenharmony_ci * chip-select(CS1) of this EMIF instance 518c2ecf20Sopenharmony_ci * @cal_resistors_per_cs: Whether there is one calibration resistor per 528c2ecf20Sopenharmony_ci * chip-select or whether it's a single one for both 538c2ecf20Sopenharmony_ci * @manufacturer: Manufacturer name string 548c2ecf20Sopenharmony_ci */ 558c2ecf20Sopenharmony_cistruct ddr_device_info { 568c2ecf20Sopenharmony_ci u32 type; 578c2ecf20Sopenharmony_ci u32 density; 588c2ecf20Sopenharmony_ci u32 io_width; 598c2ecf20Sopenharmony_ci u32 cs1_used; 608c2ecf20Sopenharmony_ci u32 cal_resistors_per_cs; 618c2ecf20Sopenharmony_ci char manufacturer[10]; 628c2ecf20Sopenharmony_ci}; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/** 658c2ecf20Sopenharmony_ci * struct emif_custom_configs - Custom configuration parameters/policies 668c2ecf20Sopenharmony_ci * passed from the platform layer 678c2ecf20Sopenharmony_ci * @mask: Mask to indicate which configs are requested 688c2ecf20Sopenharmony_ci * @lpmode: LPMODE to be used in PWR_MGMT_CTRL register 698c2ecf20Sopenharmony_ci * @lpmode_timeout_performance: Timeout before LPMODE entry when higher 708c2ecf20Sopenharmony_ci * performance is desired at the cost of power (typically 718c2ecf20Sopenharmony_ci * at higher OPPs) 728c2ecf20Sopenharmony_ci * @lpmode_timeout_power: Timeout before LPMODE entry when better power 738c2ecf20Sopenharmony_ci * savings is desired and performance is not important 748c2ecf20Sopenharmony_ci * (typically at lower loads indicated by lower OPPs) 758c2ecf20Sopenharmony_ci * @lpmode_freq_threshold: The DDR frequency threshold to identify between 768c2ecf20Sopenharmony_ci * the above two cases: 778c2ecf20Sopenharmony_ci * timeout = (freq >= lpmode_freq_threshold) ? 788c2ecf20Sopenharmony_ci * lpmode_timeout_performance : 798c2ecf20Sopenharmony_ci * lpmode_timeout_power; 808c2ecf20Sopenharmony_ci * @temp_alert_poll_interval_ms: LPDDR2 MR4 polling interval at nominal 818c2ecf20Sopenharmony_ci * temperature(in milliseconds). When temperature is high 828c2ecf20Sopenharmony_ci * polling is done 4 times as frequently. 838c2ecf20Sopenharmony_ci */ 848c2ecf20Sopenharmony_cistruct emif_custom_configs { 858c2ecf20Sopenharmony_ci u32 mask; 868c2ecf20Sopenharmony_ci u32 lpmode; 878c2ecf20Sopenharmony_ci u32 lpmode_timeout_performance; 888c2ecf20Sopenharmony_ci u32 lpmode_timeout_power; 898c2ecf20Sopenharmony_ci u32 lpmode_freq_threshold; 908c2ecf20Sopenharmony_ci u32 temp_alert_poll_interval_ms; 918c2ecf20Sopenharmony_ci}; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci/** 948c2ecf20Sopenharmony_ci * struct emif_platform_data - Platform data passed on EMIF platform 958c2ecf20Sopenharmony_ci * device creation. Used by the driver. 968c2ecf20Sopenharmony_ci * @hw_caps: Hw capabilities of the EMIF IP in the respective SoC 978c2ecf20Sopenharmony_ci * @device_info: Device info structure containing information such 988c2ecf20Sopenharmony_ci * as type, bus width, density etc 998c2ecf20Sopenharmony_ci * @timings: Timings information from device datasheet passed 1008c2ecf20Sopenharmony_ci * as an array of 'struct lpddr2_timings'. Can be NULL 1018c2ecf20Sopenharmony_ci * if if default timings are ok 1028c2ecf20Sopenharmony_ci * @timings_arr_size: Size of the timings array. Depends on the number 1038c2ecf20Sopenharmony_ci * of different frequencies for which timings data 1048c2ecf20Sopenharmony_ci * is provided 1058c2ecf20Sopenharmony_ci * @min_tck: Minimum value of some timing parameters in terms 1068c2ecf20Sopenharmony_ci * of number of cycles. Can be NULL if default values 1078c2ecf20Sopenharmony_ci * are ok 1088c2ecf20Sopenharmony_ci * @custom_configs: Custom configurations requested by SoC or board 1098c2ecf20Sopenharmony_ci * code and the data for them. Can be NULL if default 1108c2ecf20Sopenharmony_ci * configurations done by the driver are ok. See 1118c2ecf20Sopenharmony_ci * documentation for 'struct emif_custom_configs' for 1128c2ecf20Sopenharmony_ci * more details 1138c2ecf20Sopenharmony_ci */ 1148c2ecf20Sopenharmony_cistruct emif_platform_data { 1158c2ecf20Sopenharmony_ci u32 hw_caps; 1168c2ecf20Sopenharmony_ci struct ddr_device_info *device_info; 1178c2ecf20Sopenharmony_ci const struct lpddr2_timings *timings; 1188c2ecf20Sopenharmony_ci u32 timings_arr_size; 1198c2ecf20Sopenharmony_ci const struct lpddr2_min_tck *min_tck; 1208c2ecf20Sopenharmony_ci struct emif_custom_configs *custom_configs; 1218c2ecf20Sopenharmony_ci u32 ip_rev; 1228c2ecf20Sopenharmony_ci u32 phy_type; 1238c2ecf20Sopenharmony_ci}; 1248c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */ 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci#endif /* __LINUX_EMIF_H */ 127