Date: Sat, 13 Dec 2008 17:04:15 GMT From: Bruce M Simpson <bms@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 154600 for review Message-ID: <200812131704.mBDH4F5Z078794@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=154600 Change 154600 by bms@bms_anglepoise on 2008/12/13 17:04:10 Merge changes from my private branch which enable bfe(4) on the BCM5365P SoC to get as far as attaching the PHY; it doesn't get any interrupts, though, most likely due to bfe_pci_setup() needing to be rewritten for SiBa. Affected files ... .. //depot/projects/mips2/src/sys/dev/bfe/if_bfe.c#11 edit Differences ... ==== //depot/projects/mips2/src/sys/dev/bfe/if_bfe.c#11 (text+ko) ==== @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.45 2008/04/30 02:49:24 yongari Exp $"); #include <sys/param.h> +#include <sys/kdb.h> #include <sys/systm.h> #include <sys/sockio.h> #include <sys/mbuf.h> @@ -79,7 +80,6 @@ static void bfe_init_locked (void *); static void bfe_stop (struct bfe_softc *); static void bfe_watchdog (struct bfe_softc *); -static int bfe_shutdown (device_t); static void bfe_tick (void *); static void bfe_txeof (struct bfe_softc *); static void bfe_rxeof (struct bfe_softc *); @@ -622,8 +622,33 @@ return (0); } +/* + * XXX: The SiBa version of bfe does not have an eeprom. + * We may also need to know the external clock speed of + * the SoC to set up the MDIO registers correctly. + */ +static void +bfe_siba_get_config(struct bfe_softc *sc) +{ + + /* XXX this is bogus */ + sc->bfe_enaddr[0] = 0x00; + sc->bfe_enaddr[1] = 0x0f; + sc->bfe_enaddr[2] = 0xb5; + sc->bfe_enaddr[3] = 0x3d; + sc->bfe_enaddr[4] = 0x52; + sc->bfe_enaddr[5] = 0x90; + + sc->bfe_phyaddr = 0x01; /* XXX */ + + /* unused fields */ + sc->bfe_mdc_port = 0; + sc->bfe_core_unit = 0; + sc->bfe_dma_offset = 0; +} + static void -bfe_get_config(struct bfe_softc *sc) +bfe_pci_get_config(struct bfe_softc *sc) { u_int8_t eeprom[128]; @@ -647,6 +672,17 @@ } static void +bfe_get_config(struct bfe_softc *sc) +{ + + if (sc->bfe_bus_type == BFE_BUS_PCI) { + bfe_pci_get_config(sc); + } else if (sc->bfe_bus_type == BFE_BUS_SIBA) { + bfe_siba_get_config(sc); + } +} + +static void bfe_pci_setup(struct bfe_softc *sc, u_int32_t cores) { u_int32_t bar_orig, pci_rev, val;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812131704.mBDH4F5Z078794>