From owner-svn-src-head@FreeBSD.ORG Mon Oct 13 17:33:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C4AA10656CD; Mon, 13 Oct 2008 17:33:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0758FC15; Mon, 13 Oct 2008 17:33:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DHXttH081805; Mon, 13 Oct 2008 17:33:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DHXtUc081804; Mon, 13 Oct 2008 17:33:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200810131733.m9DHXtUc081804@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 13 Oct 2008 17:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183827 - head/sys/dev/bm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 17:33:56 -0000 Author: nwhitehorn Date: Mon Oct 13 17:33:55 2008 New Revision: 183827 URL: http://svn.freebsd.org/changeset/base/183827 Log: Change the way we enable the BMAC cell in macio. Instead of calling the macio's enable-enet word, which apparently does nothing on some machines, open an OF instance of the ethernet controller. This fixes cold booting from disk on my Blue & White G3. MFC after: 3 days Modified: head/sys/dev/bm/if_bm.c Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Mon Oct 13 17:33:44 2008 (r183826) +++ head/sys/dev/bm/if_bm.c Mon Oct 13 17:33:55 2008 (r183827) @@ -1119,21 +1119,25 @@ bm_chip_setup(struct bm_softc *sc) { uint16_t reg; uint16_t *eaddr_sect; - char hrow_path[128]; - ihandle_t hrow_ih; + char path[128]; + ihandle_t bmac_ih; eaddr_sect = (uint16_t *)(sc->sc_enaddr); - /* Enable BMAC cell */ - OF_package_to_path(OF_parent(ofw_bus_get_node(sc->sc_dev)), - hrow_path, sizeof(hrow_path)); - hrow_ih = OF_open(hrow_path); - if (hrow_ih == -1) { + /* + * Enable BMAC cell by opening and closing its OF node. This enables + * the cell in macio as a side effect. We should probably directly + * twiddle the FCR bits, but we lack a good interface for this at the + * present time. + */ + + OF_package_to_path(ofw_bus_get_node(sc->sc_dev), path, sizeof(path)); + bmac_ih = OF_open(path); + if (bmac_ih == -1) { device_printf(sc->sc_dev, "Enabling BMAC cell failed! Hoping it's already active.\n"); } else { - OF_call_method("enable-enet", hrow_ih, 0, 0); - OF_close(hrow_ih); + OF_close(bmac_ih); } /* Reset chip */