Deleted Added
full compact
brgphy.c (176881) brgphy.c (178667)
1/*-
2 * Copyright (c) 2000
3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

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

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/mii/brgphy.c 176881 2008-03-06 21:42:48Z jhb $");
34__FBSDID("$FreeBSD: head/sys/dev/mii/brgphy.c 178667 2008-04-29 19:47:13Z jhb $");
35
36/*
37 * Driver for the Broadcom BCM54xx/57xx 1000baseTX PHY.
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

129 MII_PHY_DESC(xxBROADCOM, BCM5780),
130 MII_PHY_DESC(xxBROADCOM, BCM5708C),
131 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755),
132 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
133 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S),
134 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX),
135 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722),
136 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C),
35
36/*
37 * Driver for the Broadcom BCM54xx/57xx 1000baseTX PHY.
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

129 MII_PHY_DESC(xxBROADCOM, BCM5780),
130 MII_PHY_DESC(xxBROADCOM, BCM5708C),
131 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755),
132 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
133 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S),
134 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX),
135 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722),
136 MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C),
137 MII_PHY_DESC(BROADCOM2, BCM5906),
137 MII_PHY_END
138};
139
140
141/* Search for our PHY in the list of known PHYs */
142static int
143brgphy_probe(device_t dev)
144{

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

184
185 if (bootverbose)
186 device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
187 bsc->mii_oui, bsc->mii_model, bsc->mii_rev);
188
189 /* Handle any special cases based on the PHY ID */
190 switch (bsc->mii_oui) {
191 case MII_OUI_BROADCOM:
138 MII_PHY_END
139};
140
141
142/* Search for our PHY in the list of known PHYs */
143static int
144brgphy_probe(device_t dev)
145{

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

185
186 if (bootverbose)
187 device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
188 bsc->mii_oui, bsc->mii_model, bsc->mii_rev);
189
190 /* Handle any special cases based on the PHY ID */
191 switch (bsc->mii_oui) {
192 case MII_OUI_BROADCOM:
193 case MII_OUI_BROADCOM2:
192 break;
193 case MII_OUI_xxBROADCOM:
194 switch (bsc->mii_model) {
195 case MII_MODEL_xxBROADCOM_BCM5706:
196 /*
197 * The 5464 PHY used in the 5706 supports both copper
198 * and fiber interfaces over GMII. Need to check the
199 * shadow registers to see which mode is actually

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

224
225 /* Find the MAC driver associated with this PHY. */
226 if (strcmp(ifp->if_dname, "bge") == 0) {
227 bge_sc = ifp->if_softc;
228 } else if (strcmp(ifp->if_dname, "bce") == 0) {
229 bce_sc = ifp->if_softc;
230 }
231
194 break;
195 case MII_OUI_xxBROADCOM:
196 switch (bsc->mii_model) {
197 case MII_MODEL_xxBROADCOM_BCM5706:
198 /*
199 * The 5464 PHY used in the 5706 supports both copper
200 * and fiber interfaces over GMII. Need to check the
201 * shadow registers to see which mode is actually

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

226
227 /* Find the MAC driver associated with this PHY. */
228 if (strcmp(ifp->if_dname, "bge") == 0) {
229 bge_sc = ifp->if_softc;
230 } else if (strcmp(ifp->if_dname, "bce") == 0) {
231 bce_sc = ifp->if_softc;
232 }
233
232 /* Todo: Need to add additional controllers such as 5906 & 5787F */
234 /* Todo: Need to add additional controllers such as 5787F */
233 /* The 590x chips are 10/100 only. */
234 if (bge_sc &&
235 pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID &&
236 (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 ||
235 /* The 590x chips are 10/100 only. */
236 if (bge_sc &&
237 pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID &&
238 (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 ||
237 pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2)) {
239 pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2 ||
240 pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906 ||
241 pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906M)) {
238 fast_ether = 1;
239 sc->mii_anegticks = MII_ANEGTICKS;
240 }
241
242 brgphy_reset(sc);
243
244 sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
245 if (sc->mii_capabilities & BMSR_EXTSTAT)

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

922 brgphy_ethernet_wirespeed(sc);
923
924 /* Enable Link LED on Dell boxes */
925 if (bge_sc->bge_flags & BGE_FLAG_NO_3LED) {
926 PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
927 PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL) &
928 ~BRGPHY_PHY_EXTCTL_3_LED);
929 }
242 fast_ether = 1;
243 sc->mii_anegticks = MII_ANEGTICKS;
244 }
245
246 brgphy_reset(sc);
247
248 sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
249 if (sc->mii_capabilities & BMSR_EXTSTAT)

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

926 brgphy_ethernet_wirespeed(sc);
927
928 /* Enable Link LED on Dell boxes */
929 if (bge_sc->bge_flags & BGE_FLAG_NO_3LED) {
930 PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
931 PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL) &
932 ~BRGPHY_PHY_EXTCTL_3_LED);
933 }
934
935 /* Adjust output voltage (From Linux driver) */
936 if (bge_sc->bge_asicrev == BGE_ASICREV_BCM5906)
937 PHY_WRITE(sc, BRGPHY_MII_EPHY_PTEST, 0x12);
938
930 /* Handle any bce (NetXtreme II) workarounds. */
931 } else if (bce_sc) {
932
933 if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5708 &&
934 (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) {
935
936 /* Store autoneg capabilities/results in digital block (Page 0) */
937 PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG3_PG2);

--- 53 unchanged lines hidden ---
939 /* Handle any bce (NetXtreme II) workarounds. */
940 } else if (bce_sc) {
941
942 if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5708 &&
943 (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) {
944
945 /* Store autoneg capabilities/results in digital block (Page 0) */
946 PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG3_PG2);

--- 53 unchanged lines hidden ---