svn commit: r208424 - stable/8/sys/powerpc/powermac

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun May 23 02:12:44 UTC 2010


Author: nwhitehorn
Date: Sun May 23 02:12:44 2010
New Revision: 208424
URL: http://svn.freebsd.org/changeset/base/208424

Log:
  MFC r205356:
  
  Let unin(4) attach to U3 controllers found on G5 machines.
  
  Submitted by:	Andreas Tobler

Modified:
  stable/8/sys/powerpc/powermac/uninorth.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/powerpc/powermac/uninorth.c
==============================================================================
--- stable/8/sys/powerpc/powermac/uninorth.c	Sat May 22 21:51:17 2010	(r208423)
+++ stable/8/sys/powerpc/powermac/uninorth.c	Sun May 23 02:12:44 2010	(r208424)
@@ -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);


More information about the svn-src-all mailing list