Calling PCI Autoconfig again

Kumar Gala galak at
Wed Mar 8 03:26:30 EST 2006

On Mar 7, 2006, at 8:17 AM, Wyse, Chris wrote:

> Hi,
> This code will do the rescan of the PCI that we need for the FPGA.
> However, it currently only supports a single execution after the FPGA
> gets loaded.  Additional calls will continue to add FPGA devices to  
> the
> PCI device list data structure.  I'm going to make some changes to  
> it to
> handle multiple calls and to support multiple device ids.  I'm  
> expecting
> it to take a day or two, but I'll make an initial cut at it today that
> will let us load the Spartan FPGA (only once).  This driver will be
> loaded when the kernel boots, so I believe that we'll just need to  
> make
> a call into it (we won't have to dynamically load it like the phob
> driver).

I'm dealing with this exact same situation and having a discussion on  
lkml regarding the proper way to do this.  In your case, do you care  
what addresses the FPGA is assigned at?

> Michael,
> For the FPGA loader, you should load the FPGA, then make a call to
> pci_rescan_bus0() (I'm renaming check_hw() to pci_rescan_bus0()).   
> Next,
> you need to do a pci_find_device() to detect the newly loaded  
> FPGA.  If
> the pci_find_device() fails, assume that the FPGA load has not
> completed, so delay for some time frame (100 ms??), then rescan again.
> If still not found, rescan up to MAX_PCI_RESCANS (probably set it  
> to 3)
> times, then return an error that the FPGA load failed.

Do you not know when the FPGA load is done?  I assume its under  
software control so the "fpga loader" should just call the PCI setup  
code once it has completed successfully.

- kumar

More information about the Linuxppc-embedded mailing list