2 * Copyright 2010 Freescale Semiconductor, Inc.
3 * Authors: Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
4 * Timur Tabi <timur@freescale.com>
6 * SPDX-License-Identifier: GPL-2.0+
12 #include <fsl_ddr_sdram.h>
13 #include <fsl_ddr_dimm_params.h>
15 void fsl_ddr_board_options(memctl_options_t *popts, dimm_params_t *pdimm,
16 unsigned int ctrl_num)
21 printf("Wrong parameter for controller number %d", ctrl_num);
27 /* set odt_rd_cfg and odt_wr_cfg. */
28 for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
29 popts->cs_local_opts[i].odt_rd_cfg = 0;
30 popts->cs_local_opts[i].odt_wr_cfg = 1;
33 popts->clk_adjust = 5;
34 popts->cpo_override = 0x1f;
35 popts->write_data_delay = 2;
36 popts->half_strength_driver_enable = 1;
38 /* Per AN4039, enable ZQ calibration. */
42 #ifdef CONFIG_SPD_EEPROM
44 * we only have a "fake" SPD-EEPROM here, which has 16 bit addresses
46 void get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)
48 int ret = i2c_read(i2c_address, 0, 2, (uchar *)spd,
49 sizeof(generic_spd_eeprom_t));
53 #ifdef SPD_EEPROM_ADDRESS
55 #elif defined(SPD_EEPROM_ADDRESS1)
59 printf("DDR: failed to read SPD from address %u\n",
62 debug("DDR: failed to read SPD from address %u\n",
65 memset(spd, 0, sizeof(generic_spd_eeprom_t));