Deleted Added
full compact
35c35
< __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 226867 2011-10-27 22:10:52Z yongari $");
---
> __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 226871 2011-10-28 01:04:40Z yongari $");
303a304
> { BGE_CHIPID_BCM5720_A0, "BCM5720 A0" },
351a353
> { BGE_ASICREV_BCM5720, "unknown BCM5720" },
439a442
> static uint32_t bge_dma_swap_options(struct bge_softc *);
1383a1387,1404
> static uint32_t
> bge_dma_swap_options(struct bge_softc *sc)
> {
> uint32_t dma_options;
>
> dma_options = BGE_MODECTL_WORDSWAP_NONFRAME |
> BGE_MODECTL_BYTESWAP_DATA | BGE_MODECTL_WORDSWAP_DATA;
> #if BYTE_ORDER == BIG_ENDIAN
> dma_options |= BGE_MODECTL_BYTESWAP_NONFRAME;
> #endif
> if ((sc)->bge_asicrev == BGE_ASICREV_BCM5720)
> dma_options |= BGE_MODECTL_BYTESWAP_B2HRX_DATA |
> BGE_MODECTL_WORDSWAP_B2HRX_DATA | BGE_MODECTL_B2HRX_ENABLE |
> BGE_MODECTL_HTX2B_ENABLE;
>
> return (dma_options);
> }
>
1390c1411
< uint32_t dma_rw_ctl, misc_ctl;
---
> uint32_t dma_rw_ctl, misc_ctl, mode_ctl;
1508,1510c1529,1530
< CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS |
< BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS |
< BGE_MODECTL_TX_NO_PHDR_CSUM);
---
> mode_ctl = bge_dma_swap_options(sc) | BGE_MODECTL_MAC_ATTN_INTR |
> BGE_MODECTL_HOST_SEND_BDS | BGE_MODECTL_TX_NO_PHDR_CSUM;
1520c1540
< BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32);
---
> mode_ctl |= BGE_MODECTL_FORCE_PCI32;
1526c1546
< BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
---
> mode_ctl |= BGE_MODECTL_STACKUP;
1527a1548,1549
> CSR_WRITE_4(sc, BGE_MODE_CTL, mode_ctl);
>
1586,1587c1608
< if (sc->bge_asicrev == BGE_ASICREV_BCM5717 ||
< sc->bge_asicrev == BGE_ASICREV_BCM57765) {
---
> if (BGE_IS_5717_PLUS(sc)) {
1722c1743,1744
< sc->bge_asicrev == BGE_ASICREV_BCM5719)
---
> sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720)
1755c1777,1778
< sc->bge_asicrev == BGE_ASICREV_BCM5719)
---
> sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720)
1844c1867,1868
< sc->bge_asicrev == BGE_ASICREV_BCM5719)
---
> sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720)
1858c1882,1883
< sc->bge_asicrev == BGE_ASICREV_BCM5719) {
---
> sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720) {
1902c1927,1931
< CSR_WRITE_4(sc, BGE_TX_LENGTHS, 0x2620);
---
> val = 0x2620;
> if (sc->bge_asicrev == BGE_ASICREV_BCM5720)
> val |= CSR_READ_4(sc, BGE_TX_LENGTHS) &
> (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK);
> CSR_WRITE_4(sc, BGE_TX_LENGTHS, val);
2056a2086,2090
>
> if (sc->bge_asicrev == BGE_ASICREV_BCM5720)
> val |= CSR_READ_4(sc, BGE_RDMA_MODE) &
> BGE_RDMAMODE_H2BNC_VLAN_DET;
>
2067c2101,2102
< if (sc->bge_asicrev == BGE_ASICREV_BCM5719) {
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720) {
2084c2119,2120
< if (sc->bge_asicrev == BGE_ASICREV_BCM5719) {
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720) {
2242a2279
> case BCOM_DEVICEID_BCM5720:
2766a2804
> case BCOM_DEVICEID_BCM5720:
2797a2836
> * BCM5720 | 1 | 8 | 2 | 9 |
2803c2842,2843
< sc->bge_asicrev == BGE_ASICREV_BCM5719) {
---
> sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720) {
2837a2878
> case BGE_ASICREV_BCM5720:
2892a2934
> sc->bge_asicrev != BGE_ASICREV_BCM5720 &&
3013c3055,3056
< if (sc->bge_asicrev == BGE_ASICREV_BCM5719)
---
> if (sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
> sc->bge_asicrev == BGE_ASICREV_BCM5720)
3599,3600c3642
< CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS |
< BGE_MODECTL_BYTESWAP_DATA);
---
> CSR_WRITE_4(sc, BGE_MODE_CTL, bge_dma_swap_options(sc));
3630a3673,3676
> if (sc->bge_asicrev == BGE_ASICREV_BCM5720)
> BGE_CLRBIT(sc, BGE_CPMU_CLCK_ORIDE,
> CPMU_CLCK_ORIDE_MAC_ORIDE_EN);
>
4844a4891,4895
> if (sc->bge_asicrev == BGE_ASICREV_BCM5720) {
> mode &= ~(BGE_TXMODE_JMB_FRM_LEN | BGE_TXMODE_CNT_DN_MODE);
> mode |= CSR_READ_4(sc, BGE_TX_MODE) &
> (BGE_TXMODE_JMB_FRM_LEN | BGE_TXMODE_CNT_DN_MODE);
> }