Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Allocating empty PCI address space: (4 Items)
   
Allocating empty PCI address space  
I have a PCI device that is not fully configured at power on.  This means that the PCI bus scan does not allocate space 
for some of the memory regions because at init their size is still 0.  Later I want to allocate some empty PCI address 
space so that I can configure some of the PCI address spaces on the device and map them into the PCI bus.  I have not 
been able to find a system call that allows me to ask for a PCI address region.  I could examine the address space used 
by all of the configured PCI devices and then find a hole of the required size but that seems like a lot of trouble when
 somewhere in the system there must be knowledge of available PCI space.
RE: Allocating empty PCI address space  
Once your device is initialized properly, you can do a pci_rescan_bus()
to to force rescan all devices, the should re-enumerate your device.




-----Original Message-----
From: David Rooney [mailto:community-noreply@qnx.com] 
Sent: Monday, August 16, 2010 3:54 PM
To: ostech-core_os
Subject: Allocating empty PCI address space

I have a PCI device that is not fully configured at power on.  This
means that the PCI bus scan does not allocate space for some of the
memory regions because at init their size is still 0.  Later I want to
allocate some empty PCI address space so that I can configure some of
the PCI address spaces on the device and map them into the PCI bus.  I
have not been able to find a system call that allows me to ask for a PCI
address region.  I could examine the address space used by all of the
configured PCI devices and then find a hole of the required size but
that seems like a lot of trouble when somewhere in the system there must
be knowledge of available PCI space.



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post63156
Re: RE: Allocating empty PCI address space  
"once you have your device initialized properly" is the problem.  If I enable the PCI address regions they are going to 
decode addresses.  What address do I have them decode?  I need a call that will give me unused PCI address space so that
 I can set the base address and enable the region.  If I enable the region at some arbitrary address there is no way to 
know that I'm not interfering with some other device.  If the regions are not enabled the bus scan won't see them. 
RE: RE: Allocating empty PCI address space  
Initialize properly does not mean you have to enable address decoding.
You should only enable address decoding once the pci_rescan_bus succeed,
meaning your BAR window has assigned addresses (this should be done once
reading the size reg returns null 0 during the bus rescan). The window
(addr and size) is configured using standard PCI configuration
mechanism, not through memory/IO access.



-----Original Message-----
From: David Rooney [mailto:community-noreply@qnx.com] 
Sent: Monday, August 16, 2010 4:37 PM
To: ostech-core_os
Subject: Re: RE: Allocating empty PCI address space


"once you have your device initialized properly" is the problem.  If I
enable the PCI address regions they are going to decode addresses.  What
address do I have them decode?  I need a call that will give me unused
PCI address space so that I can set the base address and enable the
region.  If I enable the region at some arbitrary address there is no
way to know that I'm not interfering with some other device.  If the
regions are not enabled the bus scan won't see them. 




_______________________________________________

OSTech
http://community.qnx.com/sf/go/post63164