X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fddr%2Ffsl%2Foptions.c;h=3c09c643febd87085957a865a237f30381d5c674;hb=cbb0b7e03641bbeea558b7d0497d0267578459a2;hp=5beb11b02b429a8d3f69a23355991ab9ccc813b5;hpb=03e664d8f4065010ccb6c75648192200a832fd8b;p=oweals%2Fu-boot.git diff --git a/drivers/ddr/fsl/options.c b/drivers/ddr/fsl/options.c index 5beb11b02b..3c09c643fe 100644 --- a/drivers/ddr/fsl/options.c +++ b/drivers/ddr/fsl/options.c @@ -499,7 +499,7 @@ static inline unsigned int auto_bank_intlv(dimm_params_t *pdimm) return 0; } -unsigned int populate_memctl_options(int all_dimms_registered, +unsigned int populate_memctl_options(const common_timing_params_t *common_dimm, memctl_options_t *popts, dimm_params_t *pdimm, unsigned int ctrl_num) @@ -640,7 +640,7 @@ unsigned int populate_memctl_options(int all_dimms_registered, popts->ba_intlv_ctl = 0; /* Memory Organization Parameters */ - popts->registered_dimm_en = all_dimms_registered; + popts->registered_dimm_en = common_dimm->all_dimms_registered; /* Operational Mode Paramters */ @@ -728,7 +728,12 @@ unsigned int populate_memctl_options(int all_dimms_registered, /* Choose ddr controller address mirror mode */ #if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4) - popts->mirrored_dimm = pdimm[0].mirrored_dimm; + for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) { + if (pdimm[i].n_ranks) { + popts->mirrored_dimm = pdimm[i].mirrored_dimm; + break; + } + } #endif /* Global Timing Parameters. */ @@ -773,9 +778,11 @@ unsigned int populate_memctl_options(int all_dimms_registered, * Set this to 0 for global auto precharge * The value of 0x100 has been used for DDR1, DDR2, DDR3. * It is not wrong. Any value should be OK. The performance depends on - * applications. There is no one good value for all. + * applications. There is no one good value for all. One way to set + * is to use 1/4 of refint value. */ - popts->bstopre = 0x100; + popts->bstopre = picos_to_mclk(ctrl_num, common_dimm->refresh_rate_ps) + >> 2; /* * Window for four activates -- tFAW