2 * Copyright 2010 Freescale Semiconductor, Inc.
3 * Authors: Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
4 * Timur Tabi <timur@freescale.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
15 #include <asm/fsl_ddr_sdram.h>
16 #include <asm/fsl_ddr_dimm_params.h>
18 void fsl_ddr_board_options(memctl_options_t
*popts
, dimm_params_t
*pdimm
,
19 unsigned int ctrl_num
)
24 printf("Wrong parameter for controller number %d", ctrl_num
);
30 /* set odt_rd_cfg and odt_wr_cfg. */
31 for (i
= 0; i
< CONFIG_CHIP_SELECTS_PER_CTRL
; i
++) {
32 popts
->cs_local_opts
[i
].odt_rd_cfg
= 0;
33 popts
->cs_local_opts
[i
].odt_wr_cfg
= 1;
36 popts
->clk_adjust
= 5;
37 popts
->cpo_override
= 0x1f;
38 popts
->write_data_delay
= 2;
39 popts
->half_strength_driver_enable
= 1;
41 /* Per AN4039, enable ZQ calibration. */
45 #ifdef CONFIG_SPD_EEPROM
47 * we only have a "fake" SPD-EEPROM here, which has 16 bit addresses
49 void get_spd(generic_spd_eeprom_t
*spd
, u8 i2c_address
)
51 int ret
= i2c_read(i2c_address
, 0, 2, (uchar
*)spd
,
52 sizeof(generic_spd_eeprom_t
));
56 #ifdef SPD_EEPROM_ADDRESS
58 #elif defined(SPD_EEPROM_ADDRESS1)
62 printf("DDR: failed to read SPD from address %u\n",
65 debug("DDR: failed to read SPD from address %u\n",
68 memset(spd
, 0, sizeof(generic_spd_eeprom_t
));