From owner-svn-src-head@FreeBSD.ORG Sat Mar 20 03:58:00 2010 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 8664A1065673; Sat, 20 Mar 2010 03:58:00 +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 73ED18FC14; Sat, 20 Mar 2010 03:58:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2K3w05n058436; Sat, 20 Mar 2010 03:58:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2K3w0mB058434; Sat, 20 Mar 2010 03:58:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201003200358.o2K3w0mB058434@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Mar 2010 03:58:00 +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: r205356 - head/sys/powerpc/powermac 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: Sat, 20 Mar 2010 03:58:00 -0000 Author: nwhitehorn Date: Sat Mar 20 03:58:00 2010 New Revision: 205356 URL: http://svn.freebsd.org/changeset/base/205356 Log: Let unin(4) attach to U3 controllers found on G5 machines. Submitted by: Andreas Tobler Modified: head/sys/powerpc/powermac/uninorth.c Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Sat Mar 20 03:54:02 2010 (r205355) +++ head/sys/powerpc/powermac/uninorth.c Sat Mar 20 03:58:00 2010 (r205356) @@ -611,7 +611,7 @@ unin_chip_probe(device_t dev) if (name == NULL) return (ENXIO); - if (strcmp(name, "uni-n") != 0) + if (strcmp(name, "uni-n") != 0 && strcmp(name, "u3") != 0) return (ENXIO); device_set_desc(dev, "Apple UniNorth System Controller"); @@ -622,7 +622,8 @@ static int unin_chip_attach(device_t dev) { phandle_t node; - u_int reg[2]; + u_int reg[3]; + int i = 0; uncsc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -630,14 +631,18 @@ unin_chip_attach(device_t dev) if (OF_getprop(node, "reg", reg, sizeof(reg)) < 8) return (ENXIO); - uncsc->sc_physaddr = reg[0]; - uncsc->sc_size = reg[1]; + if (strcmp(ofw_bus_get_name(dev), "u3") == 0) + i = 1; /* #address-cells lies */ + + uncsc->sc_physaddr = reg[i]; + uncsc->sc_size = reg[i+1]; /* * Only map the first page, since that is where the registers * of interest lie. */ - uncsc->sc_addr = (vm_offset_t) pmap_mapdev(reg[0], PAGE_SIZE); + uncsc->sc_addr = (vm_offset_t) pmap_mapdev(uncsc->sc_physaddr, + PAGE_SIZE); uncsc->sc_version = *(u_int *)uncsc->sc_addr; device_printf(dev, "Version %d\n", uncsc->sc_version);