Patchwork [U-Boot] microblaze: ll_temac driver: mask of length for newer h/w versions

login
register
mail settings
Submitter John Linn
Date Dec. 21, 2010, 5:05 p.m.
Message ID <3e3f7b0c-8cc5-4c96-a7d2-362d4c5dc263@SG2EHSMHS008.ehs.local>
Download mbox | patch
Permalink /patch/76305/
State Changes Requested
Headers show

Comments

John Linn - Dec. 21, 2010, 5:05 p.m.
The LL TEMAC h/w changed at some point quite some time ago such that
the length field in the BD is used for other stuff also such that the
length needs to be masked correctly.  This change is backward
compatible with older h/w also.

This change was tested on the 12.2 EDK system on the SP605 board.

Signed-off-by: John Linn <john.linn@xilinx.com>
---
 drivers/net/xilinx_ll_temac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Michal Simek - Dec. 21, 2010, 5:39 p.m.
Hi John,

John Linn wrote:
> The LL TEMAC h/w changed at some point quite some time ago such that
> the length field in the BD is used for other stuff also such that the
> length needs to be masked correctly.  This change is backward
> compatible with older h/w also.
> 
> This change was tested on the 12.2 EDK system on the SP605 board.
> 
> Signed-off-by: John Linn <john.linn@xilinx.com>
> ---
>  drivers/net/xilinx_ll_temac.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

This patch is in my custodian u-boot tree.
We have discussed the ll_temac driver some weeks ago and there are some 
things which needs to be done before this driver will be possible to 
merge to the mainline. The main thing is phy lib and complete driver review.

Thanks,
Michal

Patch

diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c
index d73e22e..c31b943 100644
--- a/drivers/net/xilinx_ll_temac.c
+++ b/drivers/net/xilinx_ll_temac.c
@@ -344,7 +344,7 @@  static int xps_ll_temac_recv_sdma(struct eth_device *dev)
 		return 0;
 	}
 
-	length = rx_bd.app5;
+	length = rx_bd.app5 & 0x3FFF;
 	flush_cache ((u32)rx_bd.phys_buf_p, length);
 
 	rx_bd.buf_len = ETHER_MTU;