Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Set maximum read byte count to 2048 for PCI-X BC...
details: https://anonhg.NetBSD.org/src/rev/05680d09b232
branches: trunk
changeset: 790954:05680d09b232
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Mon Oct 28 05:37:24 2013 +0000
description:
Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
For PCI-X BCM5704, set maximum outstanding split transactions to 0.
Same as Linux tg3 and FreeBSD (part of FreeBSD r204978).
diffstat:
sys/dev/pci/if_bge.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (43 lines):
diff -r fd96626476cd -r 05680d09b232 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Mon Oct 28 01:47:13 2013 +0000
+++ b/sys/dev/pci/if_bge.c Mon Oct 28 05:37:24 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.259 2013/09/12 21:11:37 martin Exp $ */
+/* $NetBSD: if_bge.c,v 1.260 2013/10/28 05:37:24 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.259 2013/09/12 21:11:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.260 2013/10/28 05:37:24 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -4166,10 +4166,23 @@
pci_conf_write(sc->sc_pc, sc->sc_pcitag, BGE_PCI_CACHESZ, cachesize);
pci_conf_write(sc->sc_pc, sc->sc_pcitag, BGE_PCI_CMD, command);
- /* Step 11: disable PCI-X Relaxed Ordering. */
+ /* 57xx step 11: disable PCI-X Relaxed Ordering. */
if (sc->bge_flags & BGE_PCIX) {
reg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, sc->bge_pcixcap
+ PCIX_CMD);
+ /* Set max memory read byte count to 2K */
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703) {
+ reg &= ~PCIX_CMD_BYTECNT_MASK;
+ reg |= PCIX_CMD_BCNT_2048;
+ } else if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5704){
+ /*
+ * For 5704, set max outstanding split transaction
+ * field to 0 (0 means it supports 1 request)
+ */
+ reg &= ~(PCIX_CMD_SPLTRANS_MASK
+ | PCIX_CMD_BYTECNT_MASK);
+ reg |= PCIX_CMD_BCNT_2048;
+ }
pci_conf_write(sc->sc_pc, sc->sc_pcitag, sc->bge_pcixcap
+ PCIX_CMD, reg & ~PCIX_CMD_RELAXED_ORDER);
}
Home |
Main Index |
Thread Index |
Old Index