blob: 317c6b0a9f55cc930292ae11ff7b00189f532d3b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Kumar Gala01135a82008-08-26 22:56:56 -05002/*
3 * Copyright 2008 Freescale Semiconductor, Inc.
Kumar Gala01135a82008-08-26 22:56:56 -05004 */
5
York Sunf0626592013-09-30 09:22:09 -07006#include <fsl_ddr_sdram.h>
7#include <fsl_ddr_dimm_params.h>
Kumar Gala01135a82008-08-26 22:56:56 -05008
Haiying Wangfa440362008-10-03 12:36:55 -04009void fsl_ddr_board_options(memctl_options_t *popts,
10 dimm_params_t *pdimm,
11 unsigned int ctrl_num)
Kumar Gala01135a82008-08-26 22:56:56 -050012{
13 /*
14 * Factors to consider for clock adjust:
15 * - number of chips on bus
16 * - position of slot
17 * - DDR1 vs. DDR2?
18 * - ???
19 *
20 * This needs to be determined on a board-by-board basis.
21 * 0110 3/4 cycle late
22 * 0111 7/8 cycle late
23 */
24 popts->clk_adjust = 7;
25
26 /*
27 * Factors to consider for CPO:
28 * - frequency
29 * - ddr1 vs. ddr2
30 */
Anatolij Gustschin9f3dd702008-09-17 12:34:45 +020031 popts->cpo_override = 0;
Kumar Gala01135a82008-08-26 22:56:56 -050032
33 /*
34 * Factors to consider for write data delay:
35 * - number of DIMMs
36 *
37 * 1 = 1/4 clock delay
38 * 2 = 1/2 clock delay
39 * 3 = 3/4 clock delay
40 * 4 = 1 clock delay
41 * 5 = 5/4 clock delay
42 * 6 = 3/2 clock delay
43 */
44 popts->write_data_delay = 3;
45
46 /*
47 * Factors to consider for half-strength driver enable:
48 * - number of DIMMs installed
49 */
50 popts->half_strength_driver_enable = 0;
51}