]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mpc83xx: wait till UPM completes the write to array
authorSelvamuthukumar <selva.muthukumar@e-coninfotech.com>
Thu, 9 Oct 2008 04:59:14 +0000 (10:29 +0530)
committerKim Phillips <kim.phillips@freescale.com>
Tue, 14 Oct 2008 23:10:51 +0000 (18:10 -0500)
Reference manual states that MxMR[MAD] increment is the indication
of write to UPM array is complete. Honour that. Also, make the dummy
write explicit.

also fix the comment.

Signed-off-by: Selvamuthukumar <selva.muthukumar@e-coninfotech.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
cpu/mpc83xx/cpu.c

index 5862acdc459fcc284ee21cfdca8c03b0e8665cb3..99ab2168e869a3e7ac80235ab832af9b1ef790ba 100644 (file)
@@ -124,8 +124,8 @@ int checkcpu(void)
  * The 'dummy' variable is used to increment the MAD. 'dummy' is
  * supposed to be a pointer to the memory of the device being
  * programmed by the UPM.  The data in the MDR is written into
- * memory and the MAD is incremented every time there's a read
- * from 'dummy'. Unfortunately, the current prototype for this
+ * memory and the MAD is incremented every time there's a write
+ * to 'dummy'. Unfortunately, the current prototype for this
  * function doesn't allow for passing the address of this
  * device, and changing the prototype will break a number lots
  * of other code, so we need to use a round-about way of finding
@@ -174,8 +174,9 @@ void upmconfig (uint upm, uint *table, uint size)
        for (i = 0; i < size; i++) {
                lbus->mdr = table[i];
                __asm__ __volatile__ ("sync");
-               *dummy; /* Write the value to memory and increment MAD */
+               *dummy = 0;     /* Write the value to memory and increment MAD */
                __asm__ __volatile__ ("sync");
+               while(((*mxmr & 0x3f) != ((i + 1) & 0x3f)));
        }
 
        /* Set the OP field in the MxMR to "normal" and the MAD field to 000000 */