powerpc/mpc8xxx: Fix DDR 3-way interleaving
authorYork Sun <yorksun@freescale.com>
Mon, 25 Mar 2013 07:33:20 +0000 (07:33 +0000)
committerAndy Fleming <afleming@freescale.com>
Tue, 14 May 2013 21:00:27 +0000 (16:00 -0500)
Should check if interleaving is enabled before using interleaving mode.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
arch/powerpc/cpu/mpc8xxx/ddr/main.c

index 5311a262a2990ef8b52386f89a03b451772f5c26..1a8d5933ae0987ea5f0ca83c2053a453573a015d 100644 (file)
@@ -541,14 +541,17 @@ phys_size_t fsl_ddr_sdram(void)
                total_memory = fsl_ddr_compute(&info, STEP_GET_SPD, 0);
 
        /* setup 3-way interleaving before enabling DDRC */
-       switch (info.memctl_opts[0].memctl_interleaving_mode) {
-       case FSL_DDR_3WAY_1KB_INTERLEAVING:
-       case FSL_DDR_3WAY_4KB_INTERLEAVING:
-       case FSL_DDR_3WAY_8KB_INTERLEAVING:
-               fsl_ddr_set_intl3r(info.memctl_opts[0].memctl_interleaving_mode);
-               break;
-       default:
-               break;
+       if (info.memctl_opts[0].memctl_interleaving) {
+               switch (info.memctl_opts[0].memctl_interleaving_mode) {
+               case FSL_DDR_3WAY_1KB_INTERLEAVING:
+               case FSL_DDR_3WAY_4KB_INTERLEAVING:
+               case FSL_DDR_3WAY_8KB_INTERLEAVING:
+                       fsl_ddr_set_intl3r(
+                               info.memctl_opts[0].memctl_interleaving_mode);
+                       break;
+               default:
+                       break;
+               }
        }
 
        /* Program configuration registers. */