summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2013-11-08 11:18:46 +0000
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2013-11-09 17:21:01 +0100
commit62715a2c57c01630af8198ed108874def5a99cf7 (patch)
tree1aa7ed2d1a1a4a4f54c1351fd6da9d43602f7854 /drivers
parentf3ac866c78f7f0d91eb345967350830d46c3a563 (diff)
downloadu-boot-imx-62715a2c57c01630af8198ed108874def5a99cf7.zip
u-boot-imx-62715a2c57c01630af8198ed108874def5a99cf7.tar.gz
u-boot-imx-62715a2c57c01630af8198ed108874def5a99cf7.tar.bz2
pcnet: enable the NOUFLO feature
On relatively slow boards (such as the MIPS Malta with an FPGA core card) it can be extremely common for transmits to underflow - to the point where it appears they simply do not work at all. Setting the NOUFLO bit causes the ethernet controller to not begin transmission on the wire until a transmit start point is reached. Setting that transmit start point to the full packet will cause the controller to only transmit the packet once it has buffered it entirely thus preventing any transmit underflows from occuring and allowing the controller to function on slower boards. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/pcnet.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 7b87660..5b248be 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -312,6 +312,21 @@ static int pcnet_init(struct eth_device *dev, bd_t *bis)
pcnet_write_bcr(dev, 32, val);
/*
+ * Enable NOUFLO on supported controllers, with the transmit
+ * start point set to the full packet. This will cause entire
+ * packets to be buffered by the ethernet controller before
+ * transmission, eliminating underflows which are common on
+ * slower devices. Controllers which do not support NOUFLO will
+ * simply be left with a larger transmit FIFO threshold.
+ */
+ val = pcnet_read_bcr(dev, 18);
+ val |= 1 << 11;
+ pcnet_write_bcr(dev, 18, val);
+ val = pcnet_read_csr(dev, 80);
+ val |= 0x3 << 10;
+ pcnet_write_csr(dev, 80, val);
+
+ /*
* We only maintain one structure because the drivers will never
* be used concurrently. In 32bit mode the RX and TX ring entries
* must be aligned on 16-byte boundaries.