| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. |
| 3 * |
| 4 * See file CREDITS for list of people who contributed to this |
| 5 * project. |
| 6 * |
| 7 * This program is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU General Public License as |
| 9 * published by the Free Software Foundation; either version 2 of |
| 10 * the License, or (at your option) any later version. |
| 11 * |
| 12 * This program is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 * GNU General Public License for more details. |
| 16 * |
| 17 * You should have received a copy of the GNU General Public License |
| 18 * along with this program; if not, write to the Free Software |
| 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 20 * MA 02111-1307 USA |
| 21 */ |
| 22 |
| 23 /** |
| 24 * Defines the SDRAM parameter structure. |
| 25 * |
| 26 * Note that PLLM is used by EMC. |
| 27 */ |
| 28 |
| 29 #ifndef INCLUDED_NVBOOT_SDRAM_PARAM_H |
| 30 #define INCLUDED_NVBOOT_SDRAM_PARAM_H |
| 31 |
| 32 #define NVBOOT_BCT_SDRAM_ARB_CONFIG_WORDS 27 |
| 33 |
| 34 typedef enum |
| 35 { |
| 36 /// Specifies the memory type to be undefined |
| 37 nvboot_memory_type_none = 0, |
| 38 |
| 39 /// Specifies the memory type to be DDR SDRAM |
| 40 nvboot_memory_type_ddr, |
| 41 |
| 42 /// Specifies the memory type to be LPDDR SDRAM |
| 43 nvboot_memory_type_lpddr, |
| 44 |
| 45 /// Specifies the memory type to be DDR2 SDRAM |
| 46 nvboot_memory_type_ddr2, |
| 47 |
| 48 /// Specifies the memory type to be LPDDR2 SDRAM |
| 49 nvboot_memory_type_lpddr2, |
| 50 |
| 51 nvboot_memory_type_num, |
| 52 nvboot_memory_type_force32 = 0x7FFFFFF |
| 53 } nvboot_memory_type; |
| 54 |
| 55 |
| 56 /** |
| 57 * Defines the SDRAM parameter structure |
| 58 */ |
| 59 typedef struct nvboot_sdram_params_rec |
| 60 { |
| 61 /// Specifies the type of memory device |
| 62 nvboot_memory_type memory_type; |
| 63 |
| 64 /// Specifies the CPCON value for PllM |
| 65 u_int32_t pllm_charge_pump_setup_ctrl; |
| 66 /// Specifies the LPCON value for PllM |
| 67 u_int32_t pllm_loop_filter_setup_ctrl; |
| 68 /// Specifies the M value for PllM |
| 69 u_int32_t pllm_input_divider; |
| 70 /// Specifies the N value for PllM |
| 71 u_int32_t pllm_feedback_divider; |
| 72 /// Specifies the P value for PllM |
| 73 u_int32_t pllm_post_divider; |
| 74 /// Specifies the time to wait for PLLM to lock (in microseconds) |
| 75 u_int32_t pllm_stable_time; |
| 76 |
| 77 /// Specifies the divider for the EMC Clock Source |
| 78 u_int32_t emc_clock_divider; |
| 79 |
| 80 /// |
| 81 /// Auto-calibration of EMC pads |
| 82 /// |
| 83 /// Specifies the value for EMC_AUTO_CAL_INTERVAL |
| 84 u_int32_t emc_auto_cal_interval; |
| 85 /// Specifies the value for EMC_AUTO_CAL_CONFIG |
| 86 /// Note: Trigger bits are set by the SDRAM code. |
| 87 u_int32_t emc_auto_cal_config; |
| 88 /// Specifies the time for the calibration to |
| 89 /// stabilize (in microseconds) |
| 90 u_int32_t emc_auto_cal_wait; |
| 91 |
| 92 /// Specifies the time to wait after pin programming (in microseconds) |
| 93 /// Dram vendors require at least 200us. |
| 94 u_int32_t emc_pin_program_wait; |
| 95 |
| 96 /// |
| 97 /// Timing parameters required for the SDRAM |
| 98 /// |
| 99 /// Specifies the value for EMC_RC |
| 100 u_int32_t emc_rc; |
| 101 /// Specifies the value for EMC_RFC |
| 102 u_int32_t emc_rfc; |
| 103 /// Specifies the value for EMC_RAS |
| 104 u_int32_t emc_ras; |
| 105 /// Specifies the value for EMC_RP |
| 106 u_int32_t emc_rp; |
| 107 /// Specifies the value for EMC_R2W |
| 108 u_int32_t emc_r2w; |
| 109 /// Specifies the value for EMC_R2W |
| 110 u_int32_t emc_w2r; |
| 111 /// Specifies the value for EMC_R2P |
| 112 u_int32_t emc_r2p; |
| 113 /// Specifies the value for EMC_W2P |
| 114 u_int32_t emc_w2p; |
| 115 /// Specifies the value for EMC_RD_RCD |
| 116 u_int32_t emc_rd_rcd; |
| 117 /// Specifies the value for EMC_WR_RCD |
| 118 u_int32_t emc_wr_rcd; |
| 119 /// Specifies the value for EMC_RRD |
| 120 u_int32_t emc_rrd; |
| 121 /// Specifies the value for EMC_REXT |
| 122 u_int32_t emc_rext; |
| 123 /// Specifies the value for EMC_WDV |
| 124 u_int32_t emc_wdv; |
| 125 /// Specifies the value for EMC_QUSE |
| 126 u_int32_t emc_quse; |
| 127 /// Specifies the value for EMC_QRST |
| 128 u_int32_t emc_qrst; |
| 129 /// Specifies the value for EMC_QSAFE |
| 130 u_int32_t emc_qsafe; |
| 131 /// Specifies the value for EMC_RDV |
| 132 u_int32_t emc_rdv; |
| 133 /// Specifies the value for EMC_REFRESH |
| 134 u_int32_t emc_refresh; |
| 135 /// Specifies the value for EMC_BURST_REFRESH_NUM |
| 136 u_int32_t emc_burst_refresh_num; |
| 137 /// Specifies the value for EMC_PDEX2WR |
| 138 u_int32_t emc_pdex2wr; |
| 139 /// Specifies the value for EMC_PDEX2RD |
| 140 u_int32_t emc_pdex2rd; |
| 141 /// Specifies the value for EMC_PCHG2PDEN |
| 142 u_int32_t emc_pchg2pden; |
| 143 /// Specifies the value for EMC_ACT2PDEN |
| 144 u_int32_t emc_act2pden; |
| 145 /// Specifies the value for EMC_AR2PDEN |
| 146 u_int32_t emc_ar2pden; |
| 147 /// Specifies the value for EMC_RW2PDEN |
| 148 u_int32_t emc_rw2pden; |
| 149 /// Specifies the value for EMC_TXSR |
| 150 u_int32_t emc_txsr; |
| 151 /// Specifies the value for EMC_TCKE |
| 152 u_int32_t emc_tcke; |
| 153 /// Specifies the value for EMC_TFAW |
| 154 u_int32_t emc_tfaw; |
| 155 /// Specifies the value for EMC_TRPAB |
| 156 u_int32_t emc_trpab; |
| 157 /// Specifies the value for EMC_TCLKSTABLE |
| 158 u_int32_t emc_tclkstable; |
| 159 /// Specifies the value for EMC_TCLKSTOP |
| 160 u_int32_t emc_tclkstop; |
| 161 /// Specifies the value for EMC_TREFBW |
| 162 u_int32_t emc_trefbw; |
| 163 /// Specifies the value for EMC_QUSE_EXTRA |
| 164 u_int32_t emc_quse_extra; |
| 165 |
| 166 /// |
| 167 /// FBIO configuration values |
| 168 /// |
| 169 /// Specifies the value for EMC_FBIO_CFG1 |
| 170 u_int32_t emc_fbio_cfg1; |
| 171 /// Specifies the value for EMC_FBIO_DQSIB_DLY |
| 172 u_int32_t emc_fbio_dqsib_dly; |
| 173 /// Specifies the value for EMC_FBIO_DQSIB_DLY_MSB |
| 174 u_int32_t emc_fbio_dqsib_dly_msb; |
| 175 /// Specifies the value for EMC_FBIO_QUSE_DLY |
| 176 u_int32_t emc_fbio_quse_dly; |
| 177 /// Specifies the value for EMC_FBIO_QUSE_DLY_MSB |
| 178 u_int32_t emc_fbio_quse_dly_msb; |
| 179 /// Specifies the value for EMC_FBIO_CFG5 |
| 180 u_int32_t emc_fbio_cfg5; |
| 181 /// Specifies the value for EMC_FBIO_CFG6 |
| 182 u_int32_t emc_fbio_cfg6; |
| 183 /// Specifies the value for EMC_FBIO_SPARE |
| 184 u_int32_t emc_fbio_spare; |
| 185 |
| 186 /// |
| 187 /// MRS command values |
| 188 /// |
| 189 /// Specifies the value for EMC_MRS |
| 190 u_int32_t emc_mrs; |
| 191 /// Specifies the value for EMC_EMRS |
| 192 u_int32_t emc_emrs; |
| 193 /// Specifies the first of a sequence of three values for EMC_MRW |
| 194 u_int32_t emc_mrw1; |
| 195 /// Specifies the second of a sequence of three values for EMC_MRW |
| 196 u_int32_t emc_mrw2; |
| 197 /// Specifies the third of a sequence of three values for EMC_MRW |
| 198 u_int32_t emc_mrw3; |
| 199 |
| 200 /// Specifies the EMC_MRW reset command value |
| 201 u_int32_t emc_mrw_reset_command; |
| 202 /// Specifies the EMC Reset wait time (in microseconds) |
| 203 u_int32_t emc_mrw_reset_ninit_wait; |
| 204 |
| 205 /// Specifies the value for EMC_ADR_CFG |
| 206 /// The same value is also used for MC_EMC_ADR_CFG |
| 207 u_int32_t emc_adr_cfg; |
| 208 /// Specifies the value for EMC_ADR_CFG_1 |
| 209 u_int32_t emc_adr_cfg1; |
| 210 |
| 211 /// Specifies the value for MC_EMEM_CFG which holds the external memory |
| 212 /// size (in KBytes) |
| 213 /// EMEM_SIZE_KB must be <= (Device size in KB * Number of Devices) |
| 214 u_int32_t mc_emem_Cfg; |
| 215 |
| 216 /// Specifies the value for MC_LOWLATENCY_CONFIG |
| 217 /// Mainly for LL_DRAM_INTERLEAVE: Some DRAMs do not support interleave |
| 218 /// mode. If so, turn off this bit to get the correct low-latency path |
| 219 /// behavior. Reset is ENABLED. |
| 220 u_int32_t mc_lowlatency_config; |
| 221 /// Specifies the value for EMC_CFG |
| 222 u_int32_t emc_cfg; |
| 223 /// Specifies the value for EMC_CFG_2 |
| 224 u_int32_t emc_cfg2; |
| 225 /// Specifies the value for EMC_DBG |
| 226 u_int32_t emc_dbg; |
| 227 |
| 228 /// Specifies the value for AHB_ARBITRATION_XBAR_CTRL. |
| 229 /// This is used to set the Memory Inid done |
| 230 u_int32_t ahb_arbitration_xbar_ctrl; |
| 231 |
| 232 /// Specifies the value for EMC_CFG_DIG_DLL |
| 233 /// Note: Trigger bits are set by the SDRAM code. |
| 234 u_int32_t emc_cfg_dig_dll; |
| 235 /// Specifies the value for EMC_DLL_XFORM_DQS |
| 236 u_int32_t emc_dll_xform_dqs; |
| 237 /// Specifies the value for EMC_DLL_XFORM_QUSE |
| 238 u_int32_t emc_dll_xform_quse; |
| 239 |
| 240 /// Specifies the delay after prgramming the PIN/NOP register during a |
| 241 /// WarmBoot0 sequence (in microseconds) |
| 242 u_int32_t warm_boot_wait; |
| 243 |
| 244 /// Specifies the value for EMC_CTT_TERM_CTRL |
| 245 u_int32_t emc_ctt_term_ctrl; |
| 246 |
| 247 /// Specifies the value for EMC_ODT_WRITE |
| 248 u_int32_t emc_odt_write; |
| 249 /// Specifies the value for EMC_ODT_WRITE |
| 250 u_int32_t emc_odt_read; |
| 251 |
| 252 /// Specifies the value for EMC_ZCAL_REF_CNT |
| 253 /// Only meaningful for LPDDR2. Set to 0 for all other memory types. |
| 254 u_int32_t emc_zcal_ref_cnt; |
| 255 /// Specifies the value for EMC_ZCAL_WAIT_CNT |
| 256 /// Only meaningful for LPDDR2. Set to 0 for all other memory types. |
| 257 u_int32_t emc_zcal_wait_cnt; |
| 258 /// Specifies the value for EMC_ZCAL_MRW_CMD |
| 259 /// Only meaningful for LPDDR2. Set to 0 for all other memory types. |
| 260 u_int32_t emc_zcal_mrw_cmd; |
| 261 |
| 262 /// Specifies the MRS command value for initilizing the mode register. |
| 263 u_int32_t emc_mrs_reset_dll; |
| 264 /// Specifies the MRW command for ZQ initialization of device 0 |
| 265 u_int32_t emc_mrw_zq_init_dev0; |
| 266 /// Specifies the MRW command for ZQ initialization of device 1 |
| 267 u_int32_t emc_mrw_zq_init_dev1; |
| 268 /// Specifies the wait time after programming a ZQ initialization |
| 269 /// command (in microseconds) |
| 270 u_int32_t emc_mrw_zq_init_wait; |
| 271 /// Specifies the wait time after sending an MRS DLL reset command |
| 272 /// (in microseconds) |
| 273 u_int32_t emc_mrs_reset_dll_wait; |
| 274 /// Specifies the first of two EMRS commands to initialize mode |
| 275 /// registers |
| 276 u_int32_t emc_emrs_emr2; |
| 277 /// Specifies the second of two EMRS commands to initialize mode |
| 278 /// registers |
| 279 u_int32_t emc_emrs_emr3; |
| 280 /// Specifies the EMRS command to enable the DDR2 DLL |
| 281 u_int32_t emc_emrs_ddr2_dll_enable; |
| 282 /// Specifies the MRS command to reset the DDR2 DLL |
| 283 u_int32_t emc_mrs_ddr2_dll_reset; |
| 284 /// Specifies the EMRS command to set OCD calibration |
| 285 u_int32_t emc_emrs_ddr2_ocd_calib; |
| 286 /// Specifies the wait between initializing DDR and setting OCD |
| 287 /// calibration (in microseconds) |
| 288 u_int32_t emc_ddr2_wait; |
| 289 |
| 290 /// |
| 291 /// Clock trimmers |
| 292 /// |
| 293 /// Specifies the value for EMC_CFG_CLKTRIM_0 |
| 294 u_int32_t emc_cfg_clktrim0; |
| 295 /// Specifies the value for EMC_CFG_CLKTRIM_1 |
| 296 u_int32_t emc_cfg_clktrim1; |
| 297 /// Specifies the value for EMC_CFG_CLKTRIM_2 |
| 298 u_int32_t emc_cfg_clktrim2; |
| 299 |
| 300 /// |
| 301 /// Pad controls |
| 302 /// |
| 303 /// Specifies the value for PMC_DDR_PWR |
| 304 u_int32_t pmc_ddr_pwr; |
| 305 /// Specifies the value for APB_MISC_GP_XM2CFGAPADCTRL |
| 306 u_int32_t apb_misc_gp_xm2cfga_pad_ctrl; |
| 307 /// Specifies the value for APB_MISC_GP_XM2CFGCPADCTRL |
| 308 u_int32_t apb_misc_gp_xm2cfgc_pad_ctrl; |
| 309 /// Specifies the value for APB_MISC_GP_XM2CFGCPADCTRL2 |
| 310 u_int32_t apb_misc_gp_xm2cfgc_pad_ctrl2; |
| 311 /// Specifies the value for APB_MISC_GP_XM2CFGDPADCTRL |
| 312 u_int32_t apb_misc_gp_xm2cfgd_pad_ctrl; |
| 313 /// Specifies the value for APB_MISC_GP_XM2CFGDPADCTRL2 |
| 314 u_int32_t apb_misc_gp_xm2cfgd_pad_ctrl2; |
| 315 /// Specifies the value for APB_MISC_GP_XM2CLKCFGPADCTRL |
| 316 u_int32_t apb_misc_gp_xm2clkcfg_Pad_ctrl; |
| 317 /// Specifies the value for APB_MISC_GP_XM2COMPPADCTRL |
| 318 u_int32_t apb_misc_gp_xm2comp_pad_ctrl; |
| 319 /// Specifies the value for APB_MISC_GP_XM2VTTGENPADCTRL |
| 320 u_int32_t apb_misc_gp_xm2vttgen_pad_ctrl; |
| 321 |
| 322 /// Specifies storage for arbitration configuration registers |
| 323 /// Data passed through to the Bootloader but not used by the Boot ROM |
| 324 u_int32_t arbitration_config[NVBOOT_BCT_SDRAM_ARB_CONFIG_WORDS]; |
| 325 } nvboot_sdram_params; |
| 326 |
| 327 #endif /* #ifndef INCLUDED_NVBOOT_SDRAM_PARAM_H */ |
| 328 |
| OLD | NEW |