Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src sys/dev/pci/if_bge.c 1.203-1.237, 1.239-1.241, 1.243-1.2...



details:   https://anonhg.NetBSD.org/src/rev/b42210cf0efb
branches:  netbsd-6
changeset: 776430:b42210cf0efb
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Sep 07 16:39:32 2013 +0000

description:
sys/dev/pci/if_bge.c            1.203-1.237, 1.239-1.241, 1.243-1.258 via patch
sys/dev/pci/if_bgereg.h         1.58-1.74, 1.76-1.83 via patch
sys/dev/pci/if_bgevar.h         1.10-1.16 via patch
sys/dev/pci/pcidevs             1.1149 via patch
sys/dev/pci/pcidevs.h           regen
sys/dev/pci/pcidevs_data.h      regen
sys/dev/mii/brgphy.c            1.61-1.63, 1.65, 1.67 via patch
sys/dev/mii/miivar.h            1.61 via patch
sys/dev/mii/miidevs             1.112-1.113 via patch
sys/dev/mii/miidevs.h           regen
sys/dev/mii/miidevs_data.h      regen
share/man/man4/bge.4            1.13-1.15 via patch

        Add some device support, fix a lot of bugs and add some enahcements.
        - Add Altima AC1003, APPLE BCM5701, Broadcom BCM5785F,
          BCM5785G, BCM5787F, BCM5719, BCM5720, BCM57766, BCM57782 and BCM57786.
        - brgphy(4): Add BCM5756, BCM5717C, BCM5719C, BCM5720C and BCM57780.
        - Add some bugfixes and enhancement from FreeBSD:
          - Workaround for BCM5906 silicon bug. When auto-negotiation results in
           half-duplex operation, excess collision on the ethernet link may
           cause internal chip delays that may result in subsequent valid
           frames being dropped due to insufficient receive buffer resources.
           (FreeBSD: r214219, r214251, r214292)
          - Allow write DMA to request larger DMA burst size to get better
           performance on BCM5785.
           (FreeBSD r213333: OpenBSD 1.294)
          - Enable TX MAC state machine lockup fix for both BCM5755 or higher
           and BCM5906. Publicly available data sheet just says it may happen
           due to corrupted TxMbuf.
           (FreeBSD r214216)
          - Follow Broadcom datasheet:
           Delay 100 microseconds after enabling transmit MAC.
           Delay 10 microseconds after enabling receive MAC.
           (FreeBSD r241220)
        - Insert the completion barrier between register write and the
          consecutive delay(). It will fix some device timeout problems
          we have seen before.
        - Add DELAY(40) after turning on write DMA state machine.
        - Add some workarounds for 5717 A0 and 5776[56] to be stable.
          From Linux tg3 driver.
        - Sync with *BSD. No functional change:
          - make bge_chipid() and use it.
          - use switch() instead of a lot of if()s.
        - Check BGE_RXBDFLAG_IPV6 flag for 5717_PLUS case.
          Note that {tcp,udp}6csum flag is currently not added in the
          capability.
        - Add delay after clearing BGE_MACMODE_TBI_SEND_CFGS for the link
          checking.  FreeBSD has the same delay().
        - Rename PHY related flags for the consistency. It's the same as
          FreeBSD.
        - Remove BGE_10_100_ONLY flag because this was not used.
          For 10/100 devices, when calling mii_attach(), mask BMSR_EXTSTAT
          flag to not to check Gigabit flags. It's the same as FreeBSD.
        - In brgphyattach(), set sc_isbge, sc_isbnx and sc_phyflags before
          PHY_RESET() because brgphy_reset() refers those flags.
        - Call brgpy specific autonego function in MII_TICK. Before this commit,
          only MII_MEDIACHG calls brgphy_mii_phy_auto() and MII_TICK calls MI
          mii_phy_auto(). That was not intended.
        - Sync with FreeBSD and OpenBSD. Almost the same as OpenBSD rev. 1.325:
          - Sync the ring setup code closer to FreeBSD's driver
          - Do not touch the jumbo replenish threshold register on chips that
            do not have jumbo support
        - Wait for the bootcode to complete initialization for 5717 and newer
          devices.  See BCM5718 programmer's guide's "step 13,
          Device reset Procedure, Section7".
          57781's document has the same note.
        - 5718 and 57785 document say we should wait 100us.
        - Change the order of register settings a little to match both
          Broadcom's document and Linux tg3.
        - Add detach function.
        - Fix a bug that chips which have BCM5906 ASIC touch GPIO wrongly.
        - Fix a bug that the NVRAM lock timeout occured on sparc64 onboard bge.
        - Check BGE_SGDIG_STS when the chip is NOT a 5717 A0, like freebsd
          (OpenBSD rev. 1.327).
        - Fix the setting of Tx Random Backoff Register.
        - Add BGE_PCIMISCCTL_PCISTATE_RW in BGE_INIT. It's required to set the
          PCISTATE register correctly.
        - Update comments from 57XX-PG105-R.pdf and 5718-PG106-R.pdf.
        - Add missing bus_dmamap_sync() in bge_intr(). The status word is
          in DMAed area. Same as other *BSDs.
        - Check the hardware config words and print them. This change only
          read them and print the values.
        - Set BGE_MISC_CTL's byte/word swap options before using
          bge_readmem_ind().
        - For BGE_IS_575X_PLUS() devices, don't set
          BGE_RXLPSTATCONTROL_DACK_FIX bits because these bits are reserved.
        - bge_init_tx_ring() uses BGE_RSLOTS (==256) but bge_free_tx_ring() uses
          BGE_TX_RING_CNT (== 512). Delete BGE_RSLOTS and use BGE_TX_RING_CNT.
          Same as OpenBSD's if_bge.c rev. 1.86.
        - Document says 5717 and newer chips have no
          BGE_PCISTATE_INTR_NOT_ACTIVE bit, so don't use the bit on those
          chips. Same as OpenBSD.
        - Fix a bug that the PHY address bits in MI_MODE register is wrongly
          cleard.  Set the PHY address correctly.
        - Use BGE_SETBIT() instead of CSR_WRITE_4() for the BGE_MISC_LOCAL_CTL
          register to not to modify some GPIO bits.
        - Call bge_poll_fw() before writing BGE_MODE_CTL register like the
          latest linux tg3 dirver.
        - Set DMA watermark depend on the PCI max payload size.
        - Add BGE_JUMBO_CAPABLE flag to some chips. With this commit, 5714,
          5780, 5717, 5718, 5719 (exclude rev. A0), 5720, 57765 and 57766 are
          added to support jumbo frame.
        - Fix the setting of sc->bge_flags for 5717 and newer devices.
        - Fix a link detect bug on non-autopoll systems. Same as OpenBSD
          (rev.1.329 and 1.336) and FreeBSD (r213710).
        - 57765 series is not based on 5717 series. 5717 series is based on
          57765 series.
        - Set the TX DMA segment size based on the MTU size.
        - Change the TX ring size for 5717 series and 57764 series.
        - For 57766, set BGE_RDMAMODE_JMB_2K_MMRR for non-jumbo frame.
          Same as Linux tg3.
        - For 57765 and newer devices, set BGE_MAX_RX_FRAME_LOWAT to 1.
          This value is recommended by the document.
        - Change sysctl related functions for consistency.
        - Style change.
        - Use macro. Remove duplicated macro. Remove unused variable.
        - Fix comments. Add comments.
        - Remove extra semicolon. Remove unused code.
        [msaitoh, ticket #939]

diffstat:

 share/man/man4/bge.4    |   174 +++-
 sys/dev/mii/brgphy.c    |   187 ++-
 sys/dev/mii/miidevs     |     8 +-
 sys/dev/mii/miivar.h    |     3 +-
 sys/dev/pci/if_bge.c    |  2406 +++++++++++++++++++++++++++++++++-------------
 sys/dev/pci/if_bgereg.h |   356 +++++-
 sys/dev/pci/if_bgevar.h |    67 +-
 sys/dev/pci/pcidevs     |     5 +-
 8 files changed, 2378 insertions(+), 828 deletions(-)

diffs (truncated from 5265 to 300 lines):

diff -r a4ceb121e0a6 -r b42210cf0efb share/man/man4/bge.4
--- a/share/man/man4/bge.4      Sat Sep 07 16:28:34 2013 +0000
+++ b/share/man/man4/bge.4      Sat Sep 07 16:39:32 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: bge.4,v 1.12 2009/09/26 06:47:55 wiz Exp $
+.\"    $NetBSD: bge.4,v 1.12.10.1 2013/09/07 16:39:32 bouyer Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,12 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 26, 2009
+.Dd July 4, 2013
 .Dt BGE 4
 .Os
 .Sh NAME
 .Nm bge
-.Nd Broadcom BCM570x family Gigabit Ethernet driver
+.Nd Broadcom BCM57xx/BCM590x 10/100/Gigabit Ethernet driver
 .Sh SYNOPSIS
 .Cd "bge* at pci? dev ? function ?"
 .Pp
@@ -42,27 +42,88 @@
 .Sh DESCRIPTION
 The
 .Nm
-device driver supports Gigabit Ethernet interfaces based on the Broadcom
-BCM570x family of Gigabit Ethernet chips and the BCM5906 chip.
-The interfaces supported by the
-.Nm
-driver include:
-.Bl -bullet
+driver provides support for various NICs based on the Broadcom BCM570x,
+571x, 572x, 575x, 576x, 578x, 5776x and 5778x Gigabit Ethernet controller
+chips and the 590x and 5779x Fast Ethernet controller chips,
+including the following:
+.Pp
+.Bl -bullet -compact
+.It
+3Com 3c996-T (10/100/1000baseT)
+.It
+3Com 3c996-SX (1000baseSX)
+.It
+3Com 3c996B-T (10/100/1000baseT)
+.It
+Allied-Telesis AT-2972LX10/LC
+.It
+Dell PowerEdge 1750 integrated BCM5704C NIC (10/100/1000baseT)
 .It
-3Com 3c996-T (10BASE-T/100BASE-TX/1000BASE-T)
+Dell PowerEdge 2550 integrated BCM5700 NIC (10/100/1000baseT)
+.It
+Dell PowerEdge 2650 integrated BCM5703 NIC (10/100/1000baseT)
+.It
+Fujitsu PRIMEPOWER 250/450 LAN (10/100/1000baseT)
+.It
+Fujitsu PW0G8GE1U (1000baseSX)
+.It
+Fujitsu PW0G8GE2U (10/100/1000baseT)
+.It
+Fujitsu PW008GE4 (1000baseSX)
+.It
+Fujitsu PW008GE5 (10/100/1000baseT)
+.It
+Fujitsu PW008QG1U (10/100/1000baseT)
+.It
+HP ProLiant NC320T PCI-E Gigabit NIC (10/100/1000baseT)
 .It
-Dell PowerEdge 2550 integrated BCM5700 NIC (10BASE-T/100BASE-TX/1000BASE-T)
+HP ProLiant NC320m PCI-E Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC331T PCI-E Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC332T PCI-E Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC370F PCI-X Gigabit NIC (1000baseSX)
 .It
-IBM x235 server integrated BCM5703x NIC (10BASE-T/100BASE-TX/1000BASE-T)
+HP ProLiant NC370T PCI-X Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC1020 PCI Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC6770 PCI-X Gigabit NIC (1000baseSX)
+.It
+HP ProLiant NC7760 embedded PCI Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC7770 PCI-X Gigabit NIC (10/100/1000baseT)
 .It
-Netgear GA302T (10BASE-T/100BASE-TX/1000BASE-T)
+HP ProLiant NC7771 PCI-X Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC7780 embedded PCI-X Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC7781 embedded PCI-X Gigabit NIC (10/100/1000baseT)
+.It
+HP ProLiant NC7782 embedded PCI-X Gigabit NIC (10/100/1000baseT)
+.It
+IBM ThinkPad T43/T43p integrated BCM5751M NIC (10/100/1000baseT)
 .It
-SysKonnect SK-9D21 (10BASE-T/100BASE-TX/1000BASE-T)
+IBM xSeries 235 integrated BCM5703X NIC (10/100/1000baseT)
+.It
+IBM xSeries 305 integrated BCM5703X NIC (10/100/1000baseT)
 .It
-SysKonnect SK-9D41 (1000BASE-SX)
+Netgear GA302T (10/100/1000baseT)
+.It
+SysKonnect SK-9D21 (10/100/1000baseT)
+.It
+SysKonnect SK-9D41 (1000baseSX)
 .El
 .Pp
-The BCM570x family supports IPv4/TCP/UDP checksumming in hardware.
+The
+.Nm
+driver supports IPv4 IP, TCP, and UDP checksum offload for receive,
+IP checksum offload for transmit, VLAN tag insertion and stripping,
+as well as a 256-bit multicast hash filter.
+The BCM5717, BCM5718, BCM5723, BCM5754, BCM5755, BCM5761, BCM5764, BCM5784,
+BCM5785, BCM5787 and BCM577xx chips also support IPv6 receive TCP/UDP
+checksum offload.
 The
 .Nm
 driver supports this feature of the chip.
@@ -70,6 +131,14 @@
 .Xr ifconfig 8
 for information on how to enable this feature.
 .Pp
+The BCM5700, BCM5701, BCM5702, BCM5703, BCM5704, BCM5714, BCM5717, BCM5719,
+BCM5720, BCM5780, BCM57765 and BCM57766 also support jumbo frames, which can be
+configured via the
+interface MTU setting.
+Selecting an MTU larger than 1500 bytes with the
+.Xr ifconfig 8
+utility configures the adapter to receive and transmit Jumbo frames.
+.Pp
 The level of interrupt mitigation for received packets can be adjusted
 with the
 .Li hw.bge.rx_lvl
@@ -77,13 +146,82 @@
 control.
 A value of 1 yields a
 .Nm
-interrrupt for every two full-sized Ethernet frames.
+interrupt for every two full-sized Ethernet frames.
 Each increment of the value will, roughly, halve receive interrupt rate,
 up to a maximum of 5, which interrupts about every 30 to 40 full-sized
 TCP segments.
+.Pp
+The
+.Nm
+driver supports the following media types:
+.Bl -tag -width 1000baseSX
+.It Cm autoselect
+Enable autoselection of the media type and options.
+The user can manually override
+the autoselected mode by adding media options to the appropriate
+.Xr ifconfig.if 5
+file.
+.It Cm 10baseT
+Set 10Mbps operation.
+The
+.Xr ifconfig 8
+.Ic mediaopt
+option can also be used to select either
+.Cm full-duplex
+or
+.Cm half-duplex
+modes.
+.It Cm 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
+The
+.Xr ifconfig 8
+.Ic mediaopt
+option can also be used to select either
+.Cm full-duplex
+or
+.Cm half-duplex
+modes.
+.It Cm 1000baseT
+Set 1000baseT operation over twisted pair.
+Both
+.Cm full-duplex
+and
+.Cm half-dupex
+modes are supported.
+.It Cm 1000baseSX
+Set 1000Mbps (Gigabit Ethernet) operation.
+Both
+.Cm full-duplex
+and
+.Cm half-duplex
+modes are supported.
+.El
+.Pp
+The
+.Nm
+driver supports the following media options:
+.Bl -tag -width full-duplex
+.It Cm full-duplex
+Force full duplex operation.
+.It Cm half-duplex
+Force half duplex operation.
+.El
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "bge%d: can't find mem space"
+A fatal initialization error has occurred.
+.It "bge%d: couldn't map interrupt"
+A fatal initialization error has occurred.
+.It "bge%d: watchdog timeout -- resetting"
+The device has stopped responding to the network, or there is a problem with
+the network connection (cable).
+.El
 .Sh SEE ALSO
 .Xr arp 4 ,
-.Xr bce 4 ,
+.Xr brgphy 4 ,
 .Xr ifmedia 4 ,
 .Xr mii 4 ,
 .Xr netintro 4 ,
diff -r a4ceb121e0a6 -r b42210cf0efb sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c      Sat Sep 07 16:28:34 2013 +0000
+++ b/sys/dev/mii/brgphy.c      Sat Sep 07 16:39:32 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brgphy.c,v 1.59.8.1 2013/08/26 04:00:16 msaitoh Exp $  */
+/*     $NetBSD: brgphy.c,v 1.59.8.2 2013/09/07 16:39:32 bouyer Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.59.8.1 2013/08/26 04:00:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.59.8.2 2013/09/07 16:39:32 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -196,6 +196,9 @@
        { MII_OUI_BROADCOM2,            MII_MODEL_BROADCOM2_BCM5755,
          MII_STR_BROADCOM2_BCM5755 },
 
+       { MII_OUI_BROADCOM2,            MII_MODEL_BROADCOM2_BCM5756,
+         MII_STR_BROADCOM2_BCM5756 },
+
        { MII_OUI_BROADCOM2,            MII_MODEL_BROADCOM2_BCM5761,
          MII_STR_BROADCOM2_BCM5761 },
 
@@ -205,9 +208,21 @@
        { MII_OUI_BROADCOM2,            MII_MODEL_BROADCOM2_BCM5785,
          MII_STR_BROADCOM2_BCM5785 },
 
+       { MII_OUI_BROADCOM3,            MII_MODEL_BROADCOM3_BCM5717C,
+         MII_STR_BROADCOM3_BCM5717C },
+
+       { MII_OUI_BROADCOM3,            MII_MODEL_BROADCOM3_BCM5719C,
+         MII_STR_BROADCOM3_BCM5719C },
+
+       { MII_OUI_BROADCOM3,            MII_MODEL_BROADCOM3_BCM5720C,
+         MII_STR_BROADCOM3_BCM5720C },
+
        { MII_OUI_BROADCOM3,            MII_MODEL_BROADCOM3_BCM57765,
          MII_STR_BROADCOM3_BCM57765 },
 
+       { MII_OUI_BROADCOM3,            MII_MODEL_BROADCOM3_BCM57780,
+         MII_STR_BROADCOM3_BCM57780 },
+
        { MII_OUI_xxBROADCOM_ALT1,      MII_MODEL_xxBROADCOM_ALT1_BCM5906,
          MII_STR_xxBROADCOM_ALT1_BCM5906 },
 
@@ -243,6 +258,7 @@
        sc->mii_dev = self;
        sc->mii_inst = mii->mii_instance;
        sc->mii_phy = ma->mii_phyno;
+       sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2);
        sc->mii_mpd_model = MII_MODEL(ma->mii_id2);
        sc->mii_mpd_rev = MII_REV(ma->mii_id2);
        sc->mii_pdata = mii;
@@ -250,14 +266,6 @@
        sc->mii_anegticks = MII_ANEGTICKS;
        sc->mii_funcs = &brgphy_funcs;
 
-       PHY_RESET(sc);
-
-       sc->mii_capabilities =
-           PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
-       if (sc->mii_capabilities & BMSR_EXTSTAT)
-               sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
-
-
        if (device_is_a(parent, "bge"))
                bsc->sc_isbge = true;
        else if (device_is_a(parent, "bnx"))
@@ -273,6 +281,13 @@



Home | Main Index | Thread Index | Old Index