From owner-p4-projects@FreeBSD.ORG Sat Dec 13 17:04:16 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9FD1C1065675; Sat, 13 Dec 2008 17:04:16 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BBA106564A for ; Sat, 13 Dec 2008 17:04:16 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 523138FC13 for ; Sat, 13 Dec 2008 17:04:16 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDH4GDG078796 for ; Sat, 13 Dec 2008 17:04:16 GMT (envelope-from bms@incunabulum.net) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBDH4F5Z078794 for perforce@freebsd.org; Sat, 13 Dec 2008 17:04:15 GMT (envelope-from bms@incunabulum.net) Date: Sat, 13 Dec 2008 17:04:15 GMT Message-Id: <200812131704.mBDH4F5Z078794@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bms@incunabulum.net using -f From: Bruce M Simpson To: Perforce Change Reviews Cc: Subject: PERFORCE change 154600 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2008 17:04:16 -0000 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 +#include #include #include #include @@ -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;