]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/davinci/lowlevel_init.S
DaVinci: fix ddr2 vtp i/o calibration
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / davinci / lowlevel_init.S
index 0a4b2cf674db80008fd36fae32ef993fce800a65..0e45426fbc996b6eab32d05b3c78c6c2c701145e 100644 (file)
 
 #include <config.h>
 
+#define MDSTAT_STATE   0x3f
+
 .globl lowlevel_init
 lowlevel_init:
+#ifdef CONFIG_SOC_DM644X
 
        /*-------------------------------------------------------*
         * Mask all IRQs by setting all bits in the EINT default *
@@ -268,7 +271,7 @@ checkStatClkStop:
 checkDDRStatClkStop:
        ldr     r6, MDSTAT_DDR2
        ldr     r7, [r6]
-       and     r7, r7, $0x1f
+       and     r7, r7, $MDSTAT_STATE
        cmp     r7, $0x03
        bne     checkDDRStatClkStop
 
@@ -343,7 +346,7 @@ checkStatClkStop2:
 checkDDRStatClkStop2:
        ldr     r6, MDSTAT_DDR2
        ldr     r7, [r6]
-       and     r7, r7, $0x1f
+       and     r7, r7, $MDSTAT_STATE
        cmp     r7, $0x01
        bne     checkDDRStatClkStop2
 
@@ -374,7 +377,7 @@ checkStatClkEn2:
 checkDDRStatClkEn2:
        ldr     r6, MDSTAT_DDR2
        ldr     r7, [r6]
-       and     r7, r7, $0x1f
+       and     r7, r7, $MDSTAT_STATE
        cmp     r7, $0x03
        bne     checkDDRStatClkEn2
 
@@ -520,9 +523,8 @@ VTPLock:
 
        ldr     r6, DDRVTPR
        ldr     r7, [r6]
-       and     r7, r7, $0x1f
-       and     r8, r7, $0x3e0
-       orr     r8, r7, r8
+       mov     r8, r7, LSL #32-10
+       mov     r8, r8, LSR #32-10        /* grab low 10 bits  */
        ldr     r7, VTP_RECAL
        orr     r8, r7, r8
        ldr     r7, VTP_EN
@@ -641,7 +643,7 @@ VTP_LOCK_COUNT:
 VTP_MASK:
        .word   0xffffdfff
 VTP_RECAL:
-       .word   0x40000
+       .word   0x08000
 VTP_EN:
        .word   0x02000
 CFGTEST:
@@ -705,3 +707,6 @@ DDR2_START_ADDR:
        .word   0x80000000
 DUMMY_VAL:
        .word   0xa55aa55a
+#else /* CONFIG_SOC_DM644X */
+       mov pc, lr
+#endif