driver/ddr/fsl: Add support for multiple DDR clocks
[oweals/u-boot.git] / drivers / ddr / fsl / arm_ddr_gen3.c
index c139da6da94de92e6df54b0dbf71c0730ea9432c..7160da4ec89722b5c9f6023e6908eac4e1fd2002 100644 (file)
@@ -222,7 +222,7 @@ step2:
        bus_width = 3 - ((ddr_in32(&ddr->sdram_cfg) & SDRAM_CFG_DBW_MASK)
                        >> SDRAM_CFG_DBW_SHIFT);
        timeout = ((total_gb_size_per_controller << (6 - bus_width)) * 100 /
-               (get_ddr_freq(0) >> 20)) << 1;
+               (get_ddr_freq(ctrl_num) >> 20)) << 1;
        total_gb_size_per_controller >>= 4;     /* shift down to gb size */
        debug("total %d GB\n", total_gb_size_per_controller);
        debug("Need to wait up to %d * 10ms\n", timeout);