5 * Texas Instruments, <www.ti.com>
7 * Aneesh V <aneesh@ti.com>
9 * SPDX-License-Identifier: GPL-2.0+
14 #include <asm/arch/sys_proto.h>
15 #include <asm/utils.h>
17 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
18 u32 *const T_num = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_NUM;
19 u32 *const T_den = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_DEN;
22 #ifdef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
23 /* Base AC Timing values specified by JESD209-2 for 400MHz operation */
24 static const struct lpddr2_ac_timings timings_jedec_400_mhz = {
25 .max_freq = 400000000,
47 /* Base AC Timing values specified by JESD209-2 for 200 MHz operation */
48 static const struct lpddr2_ac_timings timings_jedec_200_mhz = {
49 .max_freq = 200000000,
72 * Min tCK values specified by JESD209-2
73 * Min tCK specifies the minimum duration of some AC timing parameters in terms
74 * of the number of cycles. If the calculated number of cycles based on the
75 * absolute time value is less than the min tCK value, min tCK value should
76 * be used instead. This typically happens at low frequencies.
78 static const struct lpddr2_min_tck min_tck_jedec = {
93 static const struct lpddr2_ac_timings const*
94 jedec_ac_timings[MAX_NUM_SPEEDBINS] = {
95 &timings_jedec_200_mhz,
96 &timings_jedec_400_mhz
99 static const struct lpddr2_device_timings jedec_default_timings = {
100 .ac_timings = jedec_ac_timings,
101 .min_tck = &min_tck_jedec
104 void emif_get_device_timings(u32 emif_nr,
105 const struct lpddr2_device_timings **cs0_device_timings,
106 const struct lpddr2_device_timings **cs1_device_timings)
108 /* Assume Identical devices on EMIF1 & EMIF2 */
109 *cs0_device_timings = &jedec_default_timings;
110 *cs1_device_timings = &jedec_default_timings;
112 #endif /* CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS */