From owner-p4-projects@FreeBSD.ORG Fri May 13 15:02:24 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AC7C01065673; Fri, 13 May 2011 15:02:24 +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 6F289106566B for ; Fri, 13 May 2011 15:02:24 +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 5D6768FC19 for ; Fri, 13 May 2011 15:02:24 +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 p4DF2OrV076469 for ; Fri, 13 May 2011 15:02:24 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p4DF2OpI076466 for perforce@freebsd.org; Fri, 13 May 2011 15:02:24 GMT (envelope-from jhb@freebsd.org) Date: Fri, 13 May 2011 15:02:24 GMT Message-Id: <201105131502.p4DF2OpI076466@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 193063 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: Fri, 13 May 2011 15:02:24 -0000 http://p4web.freebsd.org/@@193063?ac=10 Change 193063 by jhb@jhb_fiver on 2011/05/13 15:01:44 Add a tunable so I can enable the pcib clearing at boot time for testing. Affected files ... .. //depot/projects/pci/sys/dev/pci/pci_pci.c#21 edit Differences ... ==== //depot/projects/pci/sys/dev/pci/pci_pci.c#21 (text+ko) ==== @@ -108,6 +108,9 @@ DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0); #ifdef NEW_PCIB +static int pcib_clear; +TUNABLE_INT("hw.pci.pcib_clear", &pcib_clear); + /* * NEW_PCIB todo: * - properly handle the ISA enable bit. If it is set, we should change @@ -254,19 +257,19 @@ dev = sc->dev; -#if 0 /* XXX: Gross hack, disable all windows for testing. */ - pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); - pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); - pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); - pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); - pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); - pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); - pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); - pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); - pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); - pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); -#endif + if (pcib_clear) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1);