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