Deleted Added
full compact
if_bge.c (190194) if_bge.c (190319)
1/*-
2 * Copyright (c) 2001 Wind River Systems
3 * Copyright (c) 1997, 1998, 1999, 2001
4 * Bill Paul <wpaul@windriver.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 18 unchanged lines hidden (view full) ---

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Wind River Systems
3 * Copyright (c) 1997, 1998, 1999, 2001
4 * Bill Paul <wpaul@windriver.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 18 unchanged lines hidden (view full) ---

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 190194 2009-03-21 00:23:07Z marius $");
35__FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 190319 2009-03-23 14:36:50Z marius $");
36
37/*
38 * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
39 *
40 * The Broadcom BCM5700 is based on technology originally developed by
41 * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet
42 * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has
43 * two on-board MIPS R4000 CPUs and can have as much as 16MB of external

--- 1246 unchanged lines hidden (view full) ---

1290 if (!(CSR_READ_4(sc, BGE_CPU_EVENT) & (1 << 14)))
1291 break;
1292 DELAY(10);
1293 }
1294 }
1295}
1296
1297/*
36
37/*
38 * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
39 *
40 * The Broadcom BCM5700 is based on technology originally developed by
41 * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet
42 * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has
43 * two on-board MIPS R4000 CPUs and can have as much as 16MB of external

--- 1246 unchanged lines hidden (view full) ---

1290 if (!(CSR_READ_4(sc, BGE_CPU_EVENT) & (1 << 14)))
1291 break;
1292 DELAY(10);
1293 }
1294 }
1295}
1296
1297/*
1298 * Do endian, PCI and DMA initialization. Also check the on-board ROM
1299 * self-test results.
1298 * Do endian, PCI and DMA initialization.
1300 */
1301static int
1302bge_chipinit(struct bge_softc *sc)
1303{
1304 uint32_t dma_rw_ctl;
1305 int i;
1306
1307 /* Set endianness before we access any non-PCI registers. */

--- 91 unchanged lines hidden (view full) ---

1399 /*
1400 * Tell the firmware the driver is running
1401 */
1402 if (sc->bge_asf_mode & ASF_STACKUP)
1403 BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
1404
1405 /*
1406 * Disable memory write invalidate. Apparently it is not supported
1299 */
1300static int
1301bge_chipinit(struct bge_softc *sc)
1302{
1303 uint32_t dma_rw_ctl;
1304 int i;
1305
1306 /* Set endianness before we access any non-PCI registers. */

--- 91 unchanged lines hidden (view full) ---

1398 /*
1399 * Tell the firmware the driver is running
1400 */
1401 if (sc->bge_asf_mode & ASF_STACKUP)
1402 BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
1403
1404 /*
1405 * Disable memory write invalidate. Apparently it is not supported
1407 * properly by these devices.
1406 * properly by these devices. Also ensure that INTx isn't disabled,
1407 * as these chips need it even when using MSI.
1408 */
1408 */
1409 PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_MWIEN, 4);
1409 PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD,
1410 PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4);
1410
1411 /* Set the timer prescaler (always 66Mhz) */
1412 CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
1413
1414 /* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */
1415 if (sc->bge_asicrev == BGE_ASICREV_BCM5906) {
1416 DELAY(40); /* XXX */
1417

--- 3402 unchanged lines hidden ---
1411
1412 /* Set the timer prescaler (always 66Mhz) */
1413 CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
1414
1415 /* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */
1416 if (sc->bge_asicrev == BGE_ASICREV_BCM5906) {
1417 DELAY(40); /* XXX */
1418

--- 3402 unchanged lines hidden ---