[U-Boot] [PATCH 2/3]: arm: Kirkwood: Check the error summary bit for error detection

Simon Kagstrom simon.kagstrom at netinsight.net
Thu Jul 2 15:03:03 CEST 2009


Check the error summary bit for error detection

The Marvell documentation for the 88f6281 states that the error coding
is only valid if the error summary and last frame bits in the transmit
descriptor status field are set. This patch adds checks for these for
transmit (I would get transmit errors on bootp with the current check,
which I believe are spurious).

Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
---
 drivers/net/kirkwood_egiga.c |    4 +++-
 drivers/net/kirkwood_egiga.h |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index db55d9d..ecd3a28 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -509,7 +509,9 @@ static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
 	 */
 	while (p_txdesc->cmd_sts & KWGBE_BUFFER_OWNED_BY_DMA) {
 		/* return fail if error is detected */
-		if (p_txdesc->cmd_sts & (KWGBE_UR_ERROR | KWGBE_RL_ERROR)) {
+		if ((p_txdesc->cmd_sts & (KWGBE_ERROR_SUMMARY | KWGBE_TX_LAST_FRAME)) ==
+				(KWGBE_ERROR_SUMMARY | KWGBE_TX_LAST_FRAME) &&
+				p_txdesc->cmd_sts & (KWGBE_UR_ERROR | KWGBE_RL_ERROR)) {
 			printf("Err..(%s) in xmit packet\n", __FUNCTION__);
 			return -1;
 		}
diff --git a/drivers/net/kirkwood_egiga.h b/drivers/net/kirkwood_egiga.h
index 8b67c9c..be85280 100644
--- a/drivers/net/kirkwood_egiga.h
+++ b/drivers/net/kirkwood_egiga.h
@@ -256,6 +256,7 @@
 #define KWGBE_UR_ERROR			(1 << 1)
 #define KWGBE_RL_ERROR			(1 << 2)
 #define KWGBE_LLC_SNAP_FORMAT		(1 << 9)
+#define KWGBE_TX_LAST_FRAME     (1 << 20)
 
 /* Rx descriptors status */
 #define KWGBE_CRC_ERROR			0
-- 
1.6.0.4



More information about the U-Boot mailing list