5 * Texas Instruments, <www.ti.com>
7 * Aneesh V <aneesh@ti.com>
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #include <asm/arch/sys_proto.h>
31 #include <asm/utils.h>
33 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
34 u32 *const T_num = (u32 *)OMAP4_SRAM_SCRATCH_EMIF_T_NUM;
35 u32 *const T_den = (u32 *)OMAP4_SRAM_SCRATCH_EMIF_T_DEN;
36 u32 *const emif_sizes = (u32 *)OMAP4_SRAM_SCRATCH_EMIF_SIZE;
39 #ifdef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
40 /* Base AC Timing values specified by JESD209-2 for 400MHz operation */
41 static const struct lpddr2_ac_timings timings_jedec_400_mhz = {
42 .max_freq = 400000000,
64 /* Base AC Timing values specified by JESD209-2 for 200 MHz operation */
65 static const struct lpddr2_ac_timings timings_jedec_200_mhz = {
66 .max_freq = 200000000,
89 * Min tCK values specified by JESD209-2
90 * Min tCK specifies the minimum duration of some AC timing parameters in terms
91 * of the number of cycles. If the calculated number of cycles based on the
92 * absolute time value is less than the min tCK value, min tCK value should
93 * be used instead. This typically happens at low frequencies.
95 static const struct lpddr2_min_tck min_tck_jedec = {
110 static const struct lpddr2_ac_timings const*
111 jedec_ac_timings[MAX_NUM_SPEEDBINS] = {
112 &timings_jedec_200_mhz,
113 &timings_jedec_400_mhz
116 static const struct lpddr2_device_timings jedec_default_timings = {
117 .ac_timings = jedec_ac_timings,
118 .min_tck = &min_tck_jedec
121 void emif_get_device_timings(u32 emif_nr,
122 const struct lpddr2_device_timings **cs0_device_timings,
123 const struct lpddr2_device_timings **cs1_device_timings)
125 /* Assume Identical devices on EMIF1 & EMIF2 */
126 *cs0_device_timings = &jedec_default_timings;
127 *cs1_device_timings = &jedec_default_timings;
129 #endif /* CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS */