AW: mpc5200: "len bad" messages from tftp (u-boot 1.1.1)
Martin Krause
Martin.Krause at tqs.de
Thu Feb 24 02:03:09 EST 2005
Hi Caruso
linuxppc-embedded-bounces at ozlabs.org wrote on Mittwoch, 23. Februar
2005 15:12:
> We are seeing repeated errors during downloads using the tftp client
> built into u-boot version 1.1.1.
This is not the correct mailing list for U-Boot related questions.
Please use the u-boot users list (u-boot-users at lists.sourceforge.net)
next time.
Attached is a patch for the mpc5xxx FEC driver, which fixes a variable-
not-defined-as-volatile bug. I had similar Problems with the tftp command
and this patch helps. The patch ist against top of cvs. Wolfgang Denk
sends it to me last week, so I am a bit surprised, that it didn't find
its way into cvs, yet.
Regards,
Martin
Index: cpu/mpc5xxx/fec.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/cpu/mpc5xxx/fec.c,v
retrieving revision 1.18
diff -u -r1.18 fec.c
--- cpu/mpc5xxx/fec.c 16 Dec 2004 15:52:41 -0000 1.18
+++ cpu/mpc5xxx/fec.c 16 Feb 2005 09:16:55 -0000
@@ -115,7 +115,7 @@
}
/********************************************************************/
-static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, FEC_RBD * pRbd)
+static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, volatile FEC_RBD * pRbd)
{
/*
* Reset buffer descriptor as empty
@@ -141,7 +141,7 @@
/********************************************************************/
static void mpc5xxx_fec_tbd_scrub(mpc5xxx_fec_priv *fec)
{
- FEC_TBD *pUsedTbd;
+ volatile FEC_TBD *pUsedTbd;
#if (DEBUG & 0x1)
printf ("tbd_scrub: fec->cleanTbdNum = %d, fec->usedTbdIndex = %d\n",
@@ -354,10 +354,10 @@
/*
* Initialize SmartDMA parameters stored in SRAM
*/
- *(int *)FEC_TBD_BASE = (int)fec->tbdBase;
- *(int *)FEC_RBD_BASE = (int)fec->rbdBase;
- *(int *)FEC_TBD_NEXT = (int)fec->tbdBase;
- *(int *)FEC_RBD_NEXT = (int)fec->rbdBase;
+ *(volatile int *)FEC_TBD_BASE = (int)fec->tbdBase;
+ *(volatile int *)FEC_RBD_BASE = (int)fec->rbdBase;
+ *(volatile int *)FEC_TBD_NEXT = (int)fec->tbdBase;
+ *(volatile int *)FEC_RBD_NEXT = (int)fec->rbdBase;
/*
* Enable FEC-Lite controller
@@ -688,7 +688,7 @@
* 6-byte Ethernet addresses.
*/
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
- FEC_TBD *pTbd;
+ volatile FEC_TBD *pTbd;
#if (DEBUG & 0x20)
printf("tbd status: 0x%04x\n", fec->tbdBase[0].status);
@@ -779,7 +779,7 @@
* This command pulls one frame from the card
*/
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
- FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
+ volatile FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
unsigned long ievent;
int frame_length, len = 0;
NBUF *frame;
More information about the Linuxppc-embedded
mailing list