Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751055AbWCCXu7 (ORCPT ); Fri, 3 Mar 2006 18:50:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751174AbWCCXu7 (ORCPT ); Fri, 3 Mar 2006 18:50:59 -0500 Received: from tomts25-srv.bellnexxia.net ([209.226.175.188]:10416 "EHLO tomts25-srv.bellnexxia.net") by vger.kernel.org with ESMTP id S1751055AbWCCXu6 (ORCPT ); Fri, 3 Mar 2006 18:50:58 -0500 Date: Fri, 3 Mar 2006 18:50:56 -0500 (EST) From: Scott Murray X-X-Sender: scottm@godzilla.spiteful.org To: Kumar Gala cc: Greg KH , Linux Kernel , linux-pci@atrey.karlin.mff.cuni.cz Subject: Re: proper way to assign fixed PCI resources to a "hotplug" device In-Reply-To: Message-ID: References: <20060303220741.GA22298@kroah.com> <20060303231807.GA28055@kroah.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2788 Lines: 66 On Fri, 3 Mar 2006, Kumar Gala wrote: > > On Mar 3, 2006, at 5:18 PM, Greg KH wrote: > > > On Fri, Mar 03, 2006 at 04:39:52PM -0600, Kumar Gala wrote: > >> On Fri, 3 Mar 2006, Greg KH wrote: > >> > >>> On Fri, Mar 03, 2006 at 11:42:03AM -0600, Kumar Gala wrote: > >>>> I was wondering what the proper way to assign and setup a single > >>>> PCI > >>>> device that comes into existence after the system has booted. I > >>>> have > >>>> an FPGA that we load from user space at which time it shows up > >>>> on the > >>>> PCI bus. > >>> > >>> Idealy your BIOS would set up this information :) > >> > >> How would my BIOS know about a device that didn't exist when it > >> booted. > > > > According to the PCI Hotplug spec, your BIOS needs to take that into > > consideration at boot time. Yeah, it's a wierd thing, I agree, but is > > how this works for x86 systems. The space and resources are reserved > > at boot time by the pci hotplug controller in anticipation of a device > > being added sometime in the future. > > > > Other arches do this differently (ppc64 has the stuff reserverd by the > > hypervisor), and then compat pci does it by just plain guessing. It > > sounds like your situation is just like this one. > > Well I reserve space for the device in my "BIOS". However this is an > embedded system so there isn't any calling out to the "BIOS" after > linux has booted. Is there some additional "work" that the x86 > systems do beyond ensure proper holes in the memory map exist for > future devices to be placed into? For CompactPCI, most boards I've encountered actually do not reserve any extra resources on the bridge to the hotplug bus. I have had a patch for a while that allows reallocating the resources for a specified bridge and all its children at boot time, and recently ported it to 2.6. It doesn't sound like you need it since you've got your own bootloader, but let me know if you want to take a look at it. > Ahh, looked at cpqphp_* and only found cpqhp_configure_device() of > any use. I'll take a look at cpcihp*.c Just a warning, cpci_configure_slot in cpci_hotplug_pci.c is somewhat broken atm, I've got a small patch I was going to clean up and send to Greg for 2.6.17. I can provide it if you want to compare a working cpci_configure_slot against cpqhp_configure_device. Scott -- ============================================================================== Scott Murray, scott@spiteful.org "Good, bad ... I'm the guy with the gun." - Ash, "Army of Darkness" - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/