linux-mips
[Top] [All Lists]

Re: CVS Update@-mips.org: linux

To: Jun Sun <jsun@mvista.com>
Subject: Re: CVS Update@-mips.org: linux
From: "Gleb O. Raiko" <raiko@niisi.msk.ru>
Date: Wed, 21 Apr 2004 12:55:06 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Organization: NIISI RAN
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20040420163230Z8225288-1530+99@linux-mips.org> <20040420105116.C22846@mvista.com> <20040420201128.GC24025@linux-mips.org> <20040420153108.F22846@mvista.com>
Sender: linux-mips-bounce@linux-mips.org
Jun Sun wrote:
> 
> Has anybody succssfully used pci_assign_unassigned_resources() in latest 2.4?
> It was badly broken in early 2.4 kernels while pci_auto was the only
> option.

In fact, I have used pci_assign_unassigned_resources() from early 2.4
days. The only code I had to supply was
fixup of PCI-PCI bridge spaces which was done in pcibios_fixup_bus,
something like
        if(!bus->self) /* Primary busses */
                bus->resource[0] = &ioport_resource;
                bus->resource[1] = &iomem_resource;
        else /* busses behind PCI-PCI bridges */
            for IO, MEM, and PREFETCH spaces:
                bus->resource[i] =
&bus->self->resource[PCI_BRIDGE_RESOURCES+i];
                bus->resource[i]->start =
bus->parent->resource[i]->start;
                bus->resource[i]->end   = bus->parent->resource[i]->end;
                bus->resource[i]->flags =
bus->parent->resource[i]->flags;
                bus->resource[i]->name  = bus->name;


Ah, I had to disable ISA mapping in 2.4.25.

After that, pci_assign_unassigned_resources() assigns all resources
properly. If for some reason, you have to preserve PBAR's values
assigned by a BIOS, setup pci_dev.resource[].parent before invoking
pci_assign_unassigned_resources.
> 
> So at most you can only say "pci_assign_unassigned_resources() can
> finally does what pci_auto does". :)

Exactly.

Regards,
Gleb.

<Prev in Thread] Current Thread [Next in Thread>