2 * (C) Copyright 2013 Keymile AG
3 * Valentin Longchamp <valentin.longchamp@keymile.com>
5 * Copyright 2009-2011 Freescale Semiconductor, Inc.
7 * SPDX-License-Identifier: GPL-2.0+
14 #include <fsl_ddr_sdram.h>
15 #include <fsl_ddr_dimm_params.h>
17 void fsl_ddr_board_options(memctl_options_t
*popts
,
19 unsigned int ctrl_num
)
22 printf("Wrong parameter for controller number %d", ctrl_num
);
26 /* automatic calibration for nb of cycles between read and DQS pre */
27 popts
->cpo_override
= 0xFF;
29 /* 1/2 clk delay between wr command and data strobe */
30 popts
->write_data_delay
= 4;
31 /* clk lauched 1/2 applied cylcle after address command */
32 popts
->clk_adjust
= 4;
33 /* 1T timing: command/address held for only 1 cycle */
36 /* we have only one module, half str should be OK */
37 popts
->half_strength_driver_enable
= 1;
39 /* wrlvl values overridden as recommended by ddr init func */
40 popts
->wrlvl_override
= 1;
41 popts
->wrlvl_sample
= 0xf;
42 popts
->wrlvl_start
= 0x6;
44 /* Enable ZQ calibration */
47 /* DHC_EN =1, ODT = 75 Ohm */
48 popts
->ddr_cdr1
= DDR_CDR1_DHC_EN
| DDR_CDR_ODT_75ohm
;
51 phys_size_t
initdram(void)
53 phys_size_t dram_size
= 0;
55 puts("Initializing with SPD\n");
57 dram_size
= fsl_ddr_sdram();
59 dram_size
= setup_ddr_tlbs(dram_size
/ 0x100000);
60 dram_size
*= 0x100000;