tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Regarding PCIe peek/poke in NetBSD



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?

Thanks for your response.

Regards,
Gnana




On Mon, Jan 3, 2011 at 11:01 PM, Manuel Bouyer 
<bouyer%antioche.eu.org@localhost> wrote:
> On Wed, Dec 22, 2010 at 01:37:46PM +0530, Gnanasekar Loganathan wrote:
>> Hi Greg,
>>
>> Thanks for the link, there i can found some useful information.
>>
>> As we know that the 'pcictl' command will list all the pci devices
>> present in the system with corresponding device/vendor id.
>> The same way, is that possible to get/map the IO/Mem/prefetchable
>> region of any PCI device by using bus_space_map for Peek/Poke?
>
> I'm not sure what you want to do. Do you want to access the device
> from kernel or userland ?
> From kernel, you need to map the regions via bus_space(9), and then
> you can bus_space_read/bus_space_write the regions. There are multiple
> examples of this is sys/dev/pci/
>
> from userland, there's no general way of doing it; it's hard to give
> advices without more details about what you want to do.
>
> --
> Manuel Bouyer <bouyer%antioche.eu.org@localhost>
> Â Â NetBSD: 26 ans d'experience feront toujours la difference
> --
>


Home | Main Index | Thread Index | Old Index