Deleted Added
full compact
35c35
< __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 135359 2004-09-17 04:58:17Z wpaul $");
---
> __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 135772 2004-09-24 22:24:33Z ps $");
157a158,163
> { BCOM_VENDORID, BCOM_DEVICEID_BCM5750,
> "Broadcom BCM5750 Gigabit Ethernet" },
> { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M,
> "Broadcom BCM5750M Gigabit Ethernet" },
> { BCOM_VENDORID, BCOM_DEVICEID_BCM5751,
> "Broadcom BCM5751 Gigabit Ethernet" },
1219c1225,1229
< if (pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE, 4) &
---
> if (sc->bge_pcie) {
> dma_rw_ctl = BGE_PCI_READ_CMD|BGE_PCI_WRITE_CMD |
> (0xf << BGE_PCIDMARWCTL_RD_WAT_SHIFT) |
> (0x2 << BGE_PCIDMARWCTL_WR_WAT_SHIFT);
> } else if (pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE, 4) &
1258c1268,1269
< sc->bge_asicrev == BGE_ASICREV_BCM5705)
---
> sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750)
1311c1322,1323
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
1336c1348,1349
< if (sc->bge_asicrev == BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750) {
1350c1363,1364
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
1393c1407,1408
< if (sc->bge_asicrev == BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750)
1415c1430,1431
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
1479c1495,1496
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
1568c1585,1586
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
1576c1594,1595
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
1607c1626,1627
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
1629c1649,1650
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
1650c1671,1672
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
1984c2006,2007
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
2263a2287,2309
> /* Save ASIC rev. */
>
> sc->bge_chipid =
> pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
> BGE_PCIMISCCTL_ASICREV;
> sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
> sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
>
> /*
> * XXX: Broadcom Linux driver. Not in specs or eratta.
> * PCI-Express?
> */
> if (sc->bge_asicrev == BGE_ASICREV_BCM5750) {
> u_int32_t v;
>
> v = pci_read_config(dev, BGE_PCI_MSI_CAPID, 4);
> if (((v >> 8) & 0xff) == BGE_PCIE_CAPID_REG) {
> v = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4);
> if ((v & 0xff) == BGE_PCIE_CAPID)
> sc->bge_pcie = 1;
> }
> }
>
2294,2301d2339
< /* Save ASIC rev. */
<
< sc->bge_chipid =
< pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
< BGE_PCIMISCCTL_ASICREV;
< sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
< sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
<
2303c2341,2342
< if (sc->bge_asicrev == BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750)
2320c2359,2360
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
2468c2508,2509
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
2511c2552
< u_int32_t cachesize, command, pcistate;
---
> u_int32_t cachesize, command, pcistate, reset;
2524a2566,2578
> reset = BGE_MISCCFG_RESET_CORE_CLOCKS|(65<<1);
>
> /* XXX: Broadcom Linux driver. */
> if (sc->bge_pcie) {
> if (CSR_READ_4(sc, 0x7e2c) == 0x60) /* PCIE 1.0 */
> CSR_WRITE_4(sc, 0x7e2c, 0x20);
> if (sc->bge_chipid != BGE_CHIPID_BCM5750_A0) {
> /* Prevent PCIE link training during global reset */
> CSR_WRITE_4(sc, BGE_MISC_CFG, (1<<29));
> reset |= (1<<29);
> }
> }
>
2526,2527c2580
< bge_writereg_ind(sc, BGE_MISC_CFG,
< BGE_MISCCFG_RESET_CORE_CLOCKS|(65<<1));
---
> bge_writereg_ind(sc, BGE_MISC_CFG, reset);
2530a2584,2596
> /* XXX: Broadcom Linux driver. */
> if (sc->bge_pcie) {
> if (sc->bge_chipid == BGE_CHIPID_BCM5750_A0) {
> uint32_t v;
>
> DELAY(500000); /* wait for link training to complete */
> v = pci_read_config(dev, 0xc4, 4);
> pci_write_config(dev, 0xc4, v | (1<<15), 4);
> }
> /* Set PCIE max payload size and clear error status. */
> pci_write_config(dev, 0xd8, 0xf5000, 4);
> }
>
2540c2606,2607
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
2597a2665,2671
> /* XXX: Broadcom Linux driver. */
> if (sc->bge_pcie && sc->bge_chipid != BGE_CHIPID_BCM5750_A0) {
> uint32_t v;
>
> v = CSR_READ_4(sc, 0x7c00);
> CSR_WRITE_4(sc, 0x7c00, v | (1<<25));
> }
2627c2701,2702
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
2743c2818,2819
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
2929c3005,3006
< if (sc->bge_asicrev == BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750)
3441c3518,3519
< if ((sc->bge_asicrev == BGE_ASICREV_BCM5705 &&
---
> if (((sc->bge_asicrev == BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5750) &&
3568c3646,3647
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
3582c3661,3662
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
3592c3672,3673
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)
3596c3677,3678
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705) {
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750) {
3614c3696,3697
< if (sc->bge_asicrev != BGE_ASICREV_BCM5705)
---
> if (sc->bge_asicrev != BGE_ASICREV_BCM5705 ||
> sc->bge_asicrev != BGE_ASICREV_BCM5750)