FreeBSD Bugzilla – Attachment 25725 Details for
Bug 43953
Backport of BMC5703 drivers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.84 KB, created by
Hembo
on 2002-10-12 04:00:13 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Hembo
Created:
2002-10-12 04:00:13 UTC
Size:
4.84 KB
patch
obsolete
>--- src/sys/dev/bge/if_bge.c.org Thu Oct 10 18:02:33 2002 >+++ src/sys/dev/bge/if_bge.c Fri Oct 11 19:04:25 2002 >@@ -141,6 +141,8 @@ > "Broadcom BCM5701 Gigabit Ethernet" }, > { BCOM_VENDORID, BCOM_DEVICEID_BCM5702X, > "Broadcom BCM5702X Gigabit Ethernet" }, >+ { BCOM_VENDORID, BCOM_DEVICEID_BCM5703X, >+ "Broadcom BCM5703X Gigabit Ethernet" }, > { SK_VENDORID, SK_DEVICEID_ALTIMA, > "SysKonnect Gigabit Ethernet" }, > { ALTIMA_VENDORID, ALTIMA_DEVICE_AC1000, >@@ -484,8 +486,12 @@ > sc = device_get_softc(dev); > ifp = &sc->arpcom.ac_if; > >- if (sc->bge_asicrev == BGE_ASICREV_BCM5701_B5 && phy != 1) >+ if (phy != 1) >+ switch(sc->bge_asicrev) { >+ case BGE_ASICREV_BCM5701_B5: >+ case BGE_ASICREV_BCM5703_A2: > return(0); >+ } > > CSR_WRITE_4(sc, BGE_MI_COMM, BGE_MICMD_READ|BGE_MICOMM_BUSY| > BGE_MIPHY(phy)|BGE_MIREG(reg)); >@@ -1040,7 +1046,6 @@ > bge_chipinit(sc) > struct bge_softc *sc; > { >- u_int32_t cachesize; > int i; > > /* Set endianness before we access any non-PCI registers. */ >@@ -1098,53 +1103,11 @@ > BGE_MODECTL_NO_RX_CRC|BGE_MODECTL_TX_NO_PHDR_CSUM| > BGE_MODECTL_RX_NO_PHDR_CSUM); > >- /* Get cache line size. */ >- cachesize = pci_read_config(sc->bge_dev, BGE_PCI_CACHESZ, 1); >- > /* >- * Avoid violating PCI spec on certain chip revs. >+ * Disable memory write invalidate. Apparently it is not supported >+ * properly by these devices. > */ >- if (pci_read_config(sc->bge_dev, BGE_PCI_CMD, 4) & PCIM_CMD_MWIEN) { >- switch(cachesize) { >- case 1: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_16BYTES, 4); >- break; >- case 2: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_32BYTES, 4); >- break; >- case 4: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_64BYTES, 4); >- break; >- case 8: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_128BYTES, 4); >- break; >- case 16: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_256BYTES, 4); >- break; >- case 32: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_512BYTES, 4); >- break; >- case 64: >- PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >- BGE_PCI_WRITE_BNDRY_1024BYTES, 4); >- break; >- default: >- /* Disable PCI memory write and invalidate. */ >- if (bootverbose) >- printf("bge%d: cache line size %d not " >- "supported; disabling PCI MWI\n", >- sc->bge_unit, cachesize); >- PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, >- PCIM_CMD_MWIEN, 4); >- break; >- } >- } >+ PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_MWIEN, 4); > > #ifdef __brokenalpha__ > /* >@@ -1153,7 +1116,8 @@ > * restriction on some ALPHA platforms with early revision > * 21174 PCI chipsets, such as the AlphaPC 164lx > */ >- PCI_SETBIT(sc, BGE_PCI_DMA_RW_CTL, BGE_PCI_READ_BNDRY_1024, 4); >+ PCI_SETBIT(sc->bge_dev, BGE_PCI_DMA_RW_CTL, >+ BGE_PCI_READ_BNDRY_1024BYTES, 4); > #endif > > /* Set the timer prescaler (always 66Mhz) */ >@@ -1556,6 +1520,7 @@ > struct ifnet *ifp; > struct bge_softc *sc; > u_int32_t hwcfg = 0; >+ u_int32_t mac_addr = 0; > int unit, error = 0, rid; > > s = splimp(); >@@ -1581,7 +1546,7 @@ > > rid = BGE_PCI_BAR0; > sc->bge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, >- 0, ~0, 1, RF_ACTIVE); >+ 0, ~0, 1, RF_ACTIVE|PCI_RF_DENSE); > > if (sc->bge_res == NULL) { > printf ("bge%d: couldn't map memory\n", unit); >@@ -1593,22 +1558,6 @@ > sc->bge_bhandle = rman_get_bushandle(sc->bge_res); > sc->bge_vhandle = (vm_offset_t)rman_get_virtual(sc->bge_res); > >- /* >- * XXX FIXME: rman_get_virtual() on the alpha is currently >- * broken and returns a physical address instead of a kernel >- * virtual address. Consequently, we need to do a little >- * extra mangling of the vhandle on the alpha. This should >- * eventually be fixed! The whole idea here is to get rid >- * of platform dependencies. >- */ >-#ifdef __alpha__ >- if (pci_cvt_to_bwx(sc->bge_vhandle)) >- sc->bge_vhandle = pci_cvt_to_bwx(sc->bge_vhandle); >- else >- sc->bge_vhandle = pci_cvt_to_dense(sc->bge_vhandle); >- sc->bge_vhandle = ALPHA_PHYS_TO_K0SEG(sc->bge_vhandle); >-#endif >- > /* Allocate interrupt */ > rid = 0; > >@@ -1645,7 +1594,16 @@ > /* > * Get station address from the EEPROM. > */ >- if (bge_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, >+ mac_addr = bge_readmem_ind(sc, 0x0c14); >+ if ((mac_addr >> 16) == 0x484b) { >+ sc->arpcom.ac_enaddr[0] = (u_char)(mac_addr >> 8); >+ sc->arpcom.ac_enaddr[1] = (u_char)mac_addr; >+ mac_addr = bge_readmem_ind(sc, 0x0c18); >+ sc->arpcom.ac_enaddr[2] = (u_char)(mac_addr >> 24); >+ sc->arpcom.ac_enaddr[3] = (u_char)(mac_addr >> 16); >+ sc->arpcom.ac_enaddr[4] = (u_char)(mac_addr >> 8); >+ sc->arpcom.ac_enaddr[5] = (u_char)mac_addr; >+ } else if (bge_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, > BGE_EE_MAC_OFFSET + 2, ETHER_ADDR_LEN)) { > printf("bge%d: failed to read station address\n", unit); > bge_release_resources(sc);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43953
:
25724
| 25725 |
25726
|
25727
|
25728