[U-Boot] [PATCH] Wait till UPM completes the write to array.

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.
Signed-off-by: Selvamuthukumar selva.muthukumar@e-coninfotech.com --- cpu/mpc83xx/cpu.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index be47a20..ab0a374 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -174,7 +174,8 @@ 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 */ + while(((*mxmr & 0x3f) != ((i + 1) & 0x3f))); __asm__ __volatile__ ("sync"); }

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.
Signed-off-by: Selvamuthukumar selva.muthukumar@e-coninfotech.com --- Ignore the previous patch. Sequence of doing things were wroing in that. cpu/mpc83xx/cpu.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index be47a20..63aa8a4 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -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 */

On Thu, 9 Oct 2008 10:29:14 +0530 Selvamuthukumar selva.muthukumar@e-coninfotech.com wrote:
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.
Signed-off-by: Selvamuthukumar selva.muthukumar@e-coninfotech.com
Ignore the previous patch. Sequence of doing things were wroing in that.
applied to mpc83xx/next.
Thanks,
Kim
p.s. prepending your Subject lines with "mpc83xx: " makes your mpc83xx-destined patches easier to spot. Thanks.
participants (2)
-
Kim Phillips
-
Selvamuthukumar