From owner-freebsd-current@FreeBSD.ORG Sat May 21 13:59:57 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7A0F1065672 for ; Sat, 21 May 2011 13:59:57 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 633BE8FC12 for ; Sat, 21 May 2011 13:59:57 +0000 (UTC) Received: by yie12 with SMTP id 12so2071923yie.13 for ; Sat, 21 May 2011 06:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=V1eLzZpaCQhc4MljoKRUrlGYSagfiZte57sy/ovEOoU=; b=KNr0CZBR1KK33HFvy1Gkjq0O4ulifpHsdYSFIPhftKVL3mLLnJMt1MZ0e3IvFkL6aO LRn5RL0HpcgIGysXZ4EWrE8Yp6rw5/SH6qRsUIkJu4yTEkgGBvBuOhqiJiYdoCOvRgMV SeHpoRI4panBRXFudNaD4GhXn2n9FBk2hiBTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fI3Zpu0wZBcPchVPDYaA2WivBFfsQod93VliIbVyXVJ3RMdSAX+GmOdhVYNDcMMbxy aTiJIBlODF+Zgpg0KgXqr/8l2hP8GlHkJIRuJD+W3hhKk2z5PtAmHWVKfWaRe3u9BCbx DzpOxGOXPNbr8imNg8fx1hGcUAKEs+hLnUJLE= MIME-Version: 1.0 Received: by 10.236.153.130 with SMTP id f2mr696667yhk.281.1305986396592; Sat, 21 May 2011 06:59:56 -0700 (PDT) Received: by 10.236.107.197 with HTTP; Sat, 21 May 2011 06:59:56 -0700 (PDT) In-Reply-To: <201105191735.53889.jhb@freebsd.org> References: <201105190813.37908.jhb@freebsd.org> <201105191735.53889.jhb@freebsd.org> Date: Sat, 21 May 2011 15:59:56 +0200 Message-ID: From: "deeptech71@gmail.com" To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: pcib allocation failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 13:59:57 -0000 On Thu, May 19, 2011 at 11:35 PM, John Baldwin wrote: > On Thursday, May 19, 2011 12:28:46 pm deeptech71@gmail.com wrote: >> On Thu, May 19, 2011 at 2:13 PM, John Baldwin wrote: >> > Yeah, your BIOS continues to behave very poorly. =A0Please try this ha= ck to > see >> > if it allows your video to still work with any AGP aperture size: >> > >> > Index: pci_pci.c >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- pci_pci.c =A0 (revision 222093) >> > +++ pci_pci.c =A0 (working copy) >> > @@ -231,7 +231,9 @@ pcib_alloc_window(struct pcib_softc *sc, struct pc >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->name, (uintmax_t)w->base, (u= intmax_t)w->limit); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->base =3D max_address; >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->limit =3D 0; >> > +#if 0 >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pcib_write_windows(sc, w->mask); >> > +#endif >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; >> > =A0 =A0 =A0 =A0} >> > =A0 =A0 =A0 =A0pcib_activate_window(sc, type); >> >> does not. > > Hummm, that should leave the PCI-PCI bridge unchanged until we write the = new > values in place so it's never "turned off" (only updated to use a smaller > range at some point). =A0You could try patching write_windows to disable = IO and > memory decoding in the PCI command register while the windows are frobbed= . > > Index: pci_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- pci_pci.c =A0 (revision 222093) > +++ pci_pci.c =A0 (working copy) > @@ -162,8 +162,13 @@ pcib_write_windows(struct pcib_softc *sc, int mask > =A0{ > =A0 =A0 =A0 =A0device_t dev; > =A0 =A0 =A0 =A0uint32_t val; > + =A0 =A0 =A0 uint16_t cmd; > > =A0 =A0 =A0 =A0dev =3D sc->dev; > + =A0 =A0 =A0 cmd =3D pci_read_config(dev, PCIR_COMMAND, 2); > + =A0 =A0 =A0 if (cmd & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pci_write_config(dev, PCIR_COMMAND, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cmd & ~(PCIM_CMD_PORTEN | PCIM_CMD_= MEMEN), 2); > =A0 =A0 =A0 =A0if (sc->io.valid && mask & WIN_IO) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0val =3D pci_read_config(dev, PCIR_IOBASEL_= 1, 1); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((val & PCIM_BRIO_MASK) =3D=3D PCIM_BRI= O_32) { > @@ -192,6 +197,8 @@ pcib_write_windows(struct pcib_softc *sc, int mask > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_write_config(dev, PCIR_PMBASEL_1, sc->= pmem.base >> 16, 2); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pci_write_config(dev, PCIR_PMLIMITL_1, sc-= >pmem.limit >> 16, 2); > =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 if (cmd & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pci_write_config(dev, PCIR_COMMAND, cmd, 2)= ; > =A0} > > =A0static void > @@ -231,7 +238,9 @@ pcib_alloc_window(struct pcib_softc *sc, struct pc > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->name, (uintmax_t)w->base, (uint= max_t)w->limit); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->base =3D max_address; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0w->limit =3D 0; > +#if 0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pcib_write_windows(sc, w->mask); > +#endif > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0pcib_activate_window(sc, type); that seems to work.