From owner-p4-projects@FreeBSD.ORG Tue May 3 19:51:55 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 18F211065693; Tue, 3 May 2011 19:51:55 +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 CF8641065690 for ; Tue, 3 May 2011 19:51:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id A3B878FC23 for ; Tue, 3 May 2011 19:51:54 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p43JpsxD006275 for ; Tue, 3 May 2011 19:51:54 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p43Jpsfv006272 for perforce@freebsd.org; Tue, 3 May 2011 19:51:54 GMT (envelope-from jhb@freebsd.org) Date: Tue, 3 May 2011 19:51:54 GMT Message-Id: <201105031951.p43Jpsfv006272@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 192548 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 19:51:55 -0000 http://p4web.freebsd.org/@@192548?ac=10 Change 192548 by jhb@jhb_jhbbsd on 2011/05/03 19:50:58 At least one BIOS enumerates all I/O ports as being decoded by the Host-PCI bridge (which is actually correct), but we can't handle that since we have ACPI devices that aren't treated as children of pcib0. Add a hack for this case to punt on using the I/O ports at all in that case. Affected files ... .. //depot/projects/pci/sys/dev/acpica/acpi_pcib_acpi.c#13 edit Differences ... ==== //depot/projects/pci/sys/dev/acpica/acpi_pcib_acpi.c#13 (text+ko) ==== @@ -64,6 +64,7 @@ ACPI_BUFFER ap_prt; /* interrupt routing table */ #ifdef NEW_PCIB struct pcib_host_resources ap_host_res; + int ap_ignore_ioports; #endif }; @@ -230,6 +231,16 @@ return (AE_OK); } + if (type == SYS_RES_IOPORT) { + if (min == 0) { + device_printf(sc->ap_dev, + "Ignoring I/O port ranges\n"); + sc->ap_ignore_ioports = 1; + } + if (sc->ap_ignore_ioports) + break; + } + /* XXX: Not sure this is correct? */ if (res->Data.Address.Decode != ACPI_POS_DECODE) { device_printf(sc->ap_dev, @@ -538,32 +549,27 @@ struct acpi_hpcib_softc *sc; struct resource *r; int error; +#endif + + /* + * If this is not a request for a specific resource range, + * exclude low resource ranges that are not generally suitable + * for PCI BARs, etc. + */ + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < acpi_host_mem_start) + start = acpi_host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } +#ifdef NEW_PCIB sc = device_get_softc(dev); error = pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end, count, flags, &r); if (error == 0) return (r); #endif - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is likely OK. - * - * PCI-PCI bridges may allocate smaller ranges for their windows, - * but the heuristics here should apply to those, so we allow - * several different end addresses. - */ - if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || - end == 0xffffffff)) - start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || - end == 0xffff || end == 0xffffffff)) - start = 0x1000; return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); }