Calling PCI Autoconfig again

Wyse, Chris chris.wyse at windriver.com
Wed Mar 8 00:49:02 EST 2006


Hi Dave,

Thanks for the input.

I was thinking about making the FPGA a hotplug device.  I was really
hoping that I could just enable CONFIG_HOTPLUG in the kernel build, but
after some research, I don't believe that will work.  The hotplug
approach was more work than I wanted, but after your response, I decided
to look into it some more, specifically looking for an FPGA
implementation similar to ours.  I searched the linux-hotplug-devel list
for FPGA, and found this:

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=101318310111131&w=
2

It implements a rescan of the PCI bus for a newly loaded FPGA device
(although despite the group name, it doesn't use HotPlug).

I'm going to try to use the code from the above link rather than
implement a hotplug driver.  

Thanks again for the help.


Chris Wyse
Member of Technical Staff
Embedded Technologies
860-749-1556 office
860-978-0849 cell
413-778-9101 fax
http://www.windriver.com
  


-----Original Message-----
From: David Hawkins [mailto:dwh at ovro.caltech.edu] 
Sent: Monday, March 06, 2006 11:33 PM
To: Wyse, Chris
Cc: linuxppc-embedded at ozlabs.org
Subject: Re: Calling PCI Autoconfig again

Wyse, Chris wrote:
> Hi,
>  
> I'm working on a board (PPC440GX CPU) that has an FPGA on it.  The 
> FPGA software has a PCI interface.  If I load the FPGA, then boot the 
> Linux kernel, the FPGA is recognized as a device on the PCI bus.  
> However, I'd like to load the FPGA after the kernel has booted, then 
> run autoconfig again to detect the device.  What's the best way to do
this?
>  
> Please send responses directly to me (in addition to the list), since 
> I am not subscribed to the list.

Hi Chris,

I haven't had to do this, but I've thought about how I might do it.

In compact PCI, you can hot-swap a PCI device, and the Linux host is
supposed to go and re-enumerate the PCI bus. There is a pci (host-side)
hotplug skeleton in the source;

linux-2.6/drivers/pci/hotplug/pcihp_skeleton.c

I believe you can do the following;

   - consider the 440GX is a hotplug controller
     (and write a hotplug driver appropriately)
   - when Linux loads the FPGA, the FPGA generates a hotplug
     event, i.e., it just got plugged in
     (I'm not sure what signal is generated, perhaps a
      power-management interrupt PME#?)
   - the 440GX hotplug controller re-enumerates the PCI bus
     and finds the device

I'm sure you can get an idea from the hotplug skeleton what
re-enumeration entails.

Cheers
Dave






More information about the Linuxppc-embedded mailing list