]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00220989 [MX6SL]: DDR Controller measure unit workaround
authorNancy Chen <Nancy.Chen@freescale.com>
Tue, 21 Aug 2012 21:07:49 +0000 (16:07 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:17 +0000 (08:35 +0200)
[MX6SL]MMDC: DDR Controller's measure unit may return an incorrect
value when operating below 100 MHz

Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
arch/arm/mach-mx6/mx6sl_ddr.S

index 4faa294c3aa7b61b700251e02b16d16f61526fe0..78208c192b39fc3ef3bd34c2f0ba39e7ce1e8794 100644 (file)
@@ -204,6 +204,42 @@ mmdc_podf1:
 
     .endm
 
+        .macro   mmdc_clk_lower_100MHz
+
+        /* Prior to reducing the DDR frequency (at 528/400 MHz),
+           read the Measure unit count bits (MU_UNIT_DEL_NUM) */
+        ldr     r5, =0x8B8
+        ldr   r6, [r8, r5]
+        /* Original MU unit count */
+        mov     r6, r6, LSR #16
+        ldr     r4, =0x3FF
+        and     r6, r6, r4
+        /* Original MU unit count * 2 */
+        mov     r1, r6, LSL #1
+        /* Bypass the automatic measure unit when below 100 MHz
+           by setting the Measure unit bypass enable bit (MU_BYP_EN) */
+        ldr     r6, [r8, r5]
+        orr     r6, r6, #0x400
+        str     r6, [r8, r5]
+     /* Double the measure count value read in step 1 and program it in the
+        measurement bypass bits (MU_BYP_VAL) of the MMDC PHY Measure Unit
+        Register for the reduced frequency operation below 100 MHz */
+        ldr     r6, [r8, r5]
+        ldr     r4, =0x3FF
+        bic     r6, r6, r4
+        orr     r6, r6, r1
+        str     r6, [r8, r5]
+        .endm
+
+        .macro   mmdc_clk_above_100MHz
+
+        /* Make sure that the PHY measurement unit is NOT in bypass mode */
+        ldr     r5, =0x8B8
+        ldr     r6, [r8, r5]
+        bic     r6, r6, #0x400
+        str     r6, [r8, r5]
+        .endm
+
 /*
  *  mx6sl_ddr_iram
  *
@@ -281,10 +317,12 @@ poll_dvfs_set_1:
      cmp    r0, r1
      beq     set_to_24MHz
 
+     mmdc_clk_above_100MHz
      ddr_switch_400MHz
      b    done
 
 set_to_24MHz:
+     mmdc_clk_lower_100MHz
      mx6sl_switch_to_24MHz
 
 done: