Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 May 2011 15:59:56 +0200
From:      "deeptech71@gmail.com" <deeptech71@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   Re: pcib allocation failure
Message-ID:  <BANLkTin4=FTeJeBhv9Tp5DkWo8TbTf-cvA@mail.gmail.com>
In-Reply-To: <201105191735.53889.jhb@freebsd.org>
References:  <BANLkTikTHFTHff5iuPDMxR6zhezEcTaZSA@mail.gmail.com> <201105190813.37908.jhb@freebsd.org> <BANLkTi=DDvse1=igYPNo4xJQ0cHNTapQwA@mail.gmail.com> <201105191735.53889.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 19, 2011 at 11:35 PM, John Baldwin <jhb@freebsd.org> 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 <jhb@freebsd.org> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTin4=FTeJeBhv9Tp5DkWo8TbTf-cvA>