From owner-svn-src-stable@FreeBSD.ORG Mon Nov 22 17:03:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3711C1065673; Mon, 22 Nov 2010 17:03:10 +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 1BE4B8FC08; Mon, 22 Nov 2010 17:03:10 +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 oAMH3Abv098737; Mon, 22 Nov 2010 17:03:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAMH39tx098735; Mon, 22 Nov 2010 17:03:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011221703.oAMH39tx098735@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 22 Nov 2010 17:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215690 - stable/8/sys/powerpc/powermac X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2010 17:03:10 -0000 Author: nwhitehorn Date: Mon Nov 22 17:03:09 2010 New Revision: 215690 URL: http://svn.freebsd.org/changeset/base/215690 Log: MFC r214575: Allow access to the HT I/O port space on the IBM CPC9X5 northbridge chips. Modified: stable/8/sys/powerpc/powermac/cpcht.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) Modified: stable/8/sys/powerpc/powermac/cpcht.c ============================================================================== --- stable/8/sys/powerpc/powermac/cpcht.c Mon Nov 22 17:01:40 2010 (r215689) +++ stable/8/sys/powerpc/powermac/cpcht.c Mon Nov 22 17:03:09 2010 (r215690) @@ -142,6 +142,7 @@ struct cpcht_softc { vm_offset_t sc_data; uint64_t sc_populated_slots; struct rman sc_mem_rman; + struct rman sc_io_rman; struct cpcht_irq htirq_map[128]; }; @@ -156,6 +157,9 @@ static devclass_t cpcht_devclass; DRIVER_MODULE(cpcht, nexus, cpcht_driver, cpcht_devclass, 0, 0); +#define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ +#define CPCHT_IOPORT_SIZE 0x00400000UL + #define HTAPIC_REQUEST_EOI 0x20 #define HTAPIC_TRIGGER_LEVEL 0x02 #define HTAPIC_MASK 0x01 @@ -215,7 +219,14 @@ cpcht_attach(device_t dev) sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "CPCHT Device Memory"; error = rman_init(&sc->sc_mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "CPCHT I/O Memory"; + error = rman_init(&sc->sc_io_rman); if (error) { device_printf(dev, "rman_init() failed. error = %d\n", error); return (error); @@ -227,6 +238,9 @@ cpcht_attach(device_t dev) * where we get the HT interrupts properties. */ + /* I/O port mappings are usually not in the device tree */ + rman_manage_region(&sc->sc_io_rman, 0, CPCHT_IOPORT_SIZE - 1); + bzero(sc->htirq_map, sizeof(sc->htirq_map)); for (child = OF_child(node); child != 0; child = OF_peer(child)) cpcht_configure_htbridge(dev, child); @@ -275,6 +289,9 @@ cpcht_configure_htbridge(device_t dev, p case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; case OFW_PCI_PHYS_HI_SPACE_IO: + rman_manage_region(&sc->sc_io_rman, rp->pci_lo, + rp->pci_lo + rp->size_lo - 1); + break; case OFW_PCI_PHYS_HI_SPACE_MEM32: rman_manage_region(&sc->sc_mem_rman, rp->pci_lo, rp->pci_lo + rp->size_lo - 1); @@ -482,8 +499,9 @@ cpcht_alloc_resource(device_t bus, devic switch (type) { case SYS_RES_IOPORT: end = min(end, start + count); + rm = &sc->sc_io_rman; + break; - /* FALLTHROUGH */ case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; break; @@ -537,6 +555,9 @@ cpcht_activate_resource(device_t bus, de start = (vm_offset_t)rman_get_start(res); + if (type == SYS_RES_IOPORT) + start += CPCHT_IOPORT_BASE; + if (bootverbose) printf("cpcht mapdev: start %zx, len %ld\n", start, rman_get_size(res));