]> Git Repo - u-boot.git/blobdiff - drivers/ddr/fsl/lc_common_dimm_params.c
tools: kwboot: Fix parsing UART image without data checksum
[u-boot.git] / drivers / ddr / fsl / lc_common_dimm_params.c
index 3d28abda5422d2539231917b5b091c0e5ee12c38..5e4ad56f0714eb4d87e7e943a3dfb31b5b3b2611 100644 (file)
@@ -1,12 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2008-2016 Freescale Semiconductor, Inc.
- * Copyright 2017-2018 NXP Semiconductor
- *
- * SPDX-License-Identifier:    GPL-2.0 BSD-3-Clause
+ * Copyright 2017-2021 NXP Semiconductor
  */
 
 #include <common.h>
 #include <fsl_ddr_sdram.h>
+#include <log.h>
+#include <asm/bitops.h>
 
 #include <fsl_ddr.h>
 
@@ -22,7 +23,7 @@ compute_cas_latency(const unsigned int ctrl_num,
        unsigned int caslat_actual;
        unsigned int retry = 16;
        unsigned int tmp = ~0;
-       const unsigned int mclk_ps = get_memory_clk_period_ps(ctrl_num);
+       unsigned int mclk_ps = get_memory_clk_period_ps(ctrl_num);
 #ifdef CONFIG_SYS_FSL_DDR3
        const unsigned int taamax = 20000;
 #else
@@ -36,6 +37,12 @@ compute_cas_latency(const unsigned int ctrl_num,
        }
        common_caslat = tmp;
 
+       if (!mclk_ps) {
+               printf("DDR clock (MCLK cycle was 0 ps), So setting it to slowest DIMM(s) (tCKmin %u ps).\n",
+                      outpdimm->tckmin_x_ps);
+               mclk_ps = outpdimm->tckmin_x_ps;
+       }
+
        /* validate if the memory clk is in the range of dimms */
        if (mclk_ps < outpdimm->tckmin_x_ps) {
                printf("DDR clock (MCLK cycle %u ps) is faster than "
@@ -415,6 +422,9 @@ compute_lowest_common_dimm_parameters(const unsigned int ctrl_num,
                                        dimm_params[i].mpart);
 #endif
                        }
+#ifndef CONFIG_SPL_BUILD
+                       puts("       ");
+#endif
                }
        }
 
This page took 0.030959 seconds and 4 git commands to generate.