Calling PCI Autoconfig again

Kumar Gala galak at kernel.crashing.org
Wed Mar 8 06:57:44 EST 2006


On Mar 7, 2006, at 1:25 PM, Wyse, Chris wrote:

> Hi Kumar,
>
> Thanks for the response.  Also, I apologize to the group - I didn't  
> mean
> to CC: the list with the last note.  However, I am glad that it got a
> response from you.
>
> Regarding the FPGA address assignment - it doesn't matter at all to  
> me,
> I just need to be able to access it on the PCI once the load is
> complete.
>
> As for the FPGA loader, the intent is that it will make the call to
> rescan the PCI after the load is complete.  In fact, I intend to  
> use it
> as a way of determining if the load completed successfully, since we
> don't have access to the DONE signal from the FPGA (we ran out of GPIO
> pins).
>
> If you missed this link from a previous post, please check it out.  It
> implements a rescan of the PCI.
>
> http://marc.theaimsgroup.com/?l=linux-hotplug- 
> devel&m=101318310111131&w=
> 2

I saw this link and felt that the code was doing alot of work that  
was already handled by the PCI subsystem for you.  For example, there  
isn't a need for you to kmalloc your own dev and go through all the  
effort.

For your case it should be as simple as the following:

bus = pci_find_bus(0, bus_of_dev);
dev = pci_scan_single_device(bus, devfn);
pci_bus_alloc_resource(...);
pci_bus_add_devices(bus);

You could also look at using the pci_scan_slot() / pci_find_slot()  
instead of pci_scan_single_device().

- kumar




More information about the Linuxppc-embedded mailing list