public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 05/18] pcnet: enable the NOUFLO feature
Date: Mon, 11 Nov 2013 10:22:42 +0000	[thread overview]
Message-ID: <5280AFF2.9090106@imgtec.com> (raw)
In-Reply-To: <201311102102.33861.marex@denx.de>

On 10/11/13 20:02, Marek Vasut wrote:
> Dear Paul Burton,
>
>> 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>
>> ---
>> Changes in v2:
>>    - rebase atop master
>> ---
>>   drivers/net/pcnet.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> 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);
>
> Would be nice to fix this so we don't have so many magic numbers there.
>
> Best regards,
> Marek Vasut
>

I agree, the whole file is full of them. I'll submit a cleanup patch 
later if nobody else beats me to it.

Thanks,
     Paul

  reply	other threads:[~2013-11-11 10:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 11:18 [U-Boot] [PATCH v1+ 00/18] MIPS Malta board support Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 01/18] mips32: detect L1 cache sizes if they're not defined Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 02/18] pcnet: code style cleanup Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 03/18] pcnet: s/le16_to_cpu/cpu_to_le16/ in pcnet_send Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 04/18] pcnet: add cache flushing & invalidation Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 05/18] pcnet: enable the NOUFLO feature Paul Burton
2013-11-10 20:02   ` Marek Vasut
2013-11-11 10:22     ` Paul Burton [this message]
2013-11-11 13:30       ` Marek Vasut
2013-11-08 11:18 ` [U-Boot] [PATCH v2 06/18] pci.h: allow inclusion in assembly source Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v4 07/18] qemu-malta: rename to just "malta" Paul Burton
2013-11-09  0:53   ` Daniel Schwierzeck
2013-11-09 10:22     ` [U-Boot] [PATCH v5 " Paul Burton
2013-11-10 20:05       ` Marek Vasut
2013-11-11 10:24         ` Paul Burton
2013-11-11 13:30           ` Marek Vasut
2013-11-08 11:18 ` [U-Boot] [PATCH v3 08/18] malta: setup super I/O UARTs Paul Burton
2013-11-10 20:06   ` Marek Vasut
2013-11-11 10:29     ` Paul Burton
2013-11-11 13:31       ` Marek Vasut
2013-11-08 11:18 ` [U-Boot] [PATCH v3 09/18] malta: support for coreFPGA6 boards Paul Burton
2013-11-10 20:07   ` Marek Vasut
2013-11-11 10:32     ` Paul Burton
2013-11-11 10:52       ` Daniel Schwierzeck
2013-11-11 11:03         ` [U-Boot] [PATCH] malta: arch/mips/include/asm/malta.h SPDX license tag Paul Burton
2013-11-11 11:34           ` Daniel Schwierzeck
2013-11-08 11:18 ` [U-Boot] [PATCH v3 10/18] malta: display "U-boot" on the LCD screen Paul Burton
2013-11-10 20:08   ` Marek Vasut
2013-11-11 10:36     ` Paul Burton
2013-11-11 13:32       ` Marek Vasut
2013-11-08 11:18 ` [U-Boot] [PATCH v2 11/18] malta: enable CONFIG_PCNET_79C973, PCNET_HAS_PROM, CONFIG_CMD_DHCP Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 12/18] malta: remove cache size definitions Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v3 13/18] malta: disable L2 caches Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v2 14/18] malta: enable RTC support Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH 15/18] malta: store environment in flash Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH 16/18] malta: setup PIIX4 interrupt route Paul Burton
2013-11-10 20:09   ` Marek Vasut
2013-11-11 10:57     ` Paul Burton
2013-11-11 13:33       ` Marek Vasut
2013-11-11 13:59         ` Paul Burton
2013-11-11 14:01           ` Marek Vasut
2013-11-08 11:18 ` [U-Boot] [PATCH v3 17/18] malta: add script & instructions to flash U-boot Paul Burton
2013-11-08 11:18 ` [U-Boot] [PATCH v3 18/18] malta: add myself to maintainers Paul Burton
2013-11-09 20:44 ` [U-Boot] [PATCH v1+ 00/18] MIPS Malta board support Daniel Schwierzeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5280AFF2.9090106@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox