Re: Regarding PCIe peek/poke in NetBSD
"Jonathan A. Kollasch" <[email protected]> Tue, 4 Jan 2011 15:19:26 +0000
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jan 04, 2011 at 01:45:24PM +0100, Manuel Bouyer wrote: > On Tue, Jan 04, 2011 at 10:47:30AM +0530, Gnanasekar Loganathan wrote: > > Hi Manuel, > > > > The requirement was, one of my customer want to do read/write on any > > address/offset from any PCIe devices present in the system. He don't > > want to use the corresponding device drivers, need separate > > application that can map the PCIe device region of any devices by bus > > no, device no and function. The application meant for testing purpose > > only. > > > > Using the 'pcictl' utility i can able to do read/write operations on > > PCIe configuration space, but not able to do in io/mem/prefetchable > > space. Able to map the region by 'bus_space_map', if the region was > > not already mapped by the driver. bus_space_map fails if it was > > already mapped. > > > > Is there any way to map the region which was already mapped by the driver? > > Well, this is not so easy. > For I/O space, I guess they can be acceeded using the i386_iopl(2) call > (assuming you're on x86 hardware). For memory-mapped space, maybe > they can be acceeded using /dev/mem, but I never tried this. Also, you can mmap(4) /dev/pci now ... Jonathan Kollasch