Skip navigation.
Home
The QNX Community Portal

View topic - How PCI bus works in QNX

How PCI bus works in QNX

For discussion of realtime and/or embedded programming.

How PCI bus works in QNX

Postby garyritu » Tue Jun 16, 2009 1:31 pm

I have two question on PCI under QNX OS.

1. How PCI bus access on the QNX?
2. How PCI interfacing shall be done in Device driver to access PCI bus??
garyritu
Active Member
 
Posts: 58
Joined: Fri May 22, 2009 7:09 am

RE: How PCI bus works in QNX

Postby maschoen » Tue Jun 16, 2009 4:10 pm

1. There are two ways to access the PCI bus. You either use the in and out instructions, or you setup a DMA channel. Both of these require you running as super user and requesting I/O access from the OS before attempting it. There are utility routines for reading and setting the PCI configuration itself.

2. Same as answer 1.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: RE: How PCI bus works in QNX

Postby garyritu » Mon Jun 22, 2009 1:53 pm

maschoen wrote:1. There are two ways to access the PCI bus. You either use the in and out instructions, or you setup a DMA channel. Both of these require you running as super user and requesting I/O access from the OS before attempting it. There are utility routines for reading and setting the PCI configuration itself.

2. Same as answer 1.


I have seen some pci examples for configuration and reading / writing. That example uses
1. pci_attach
2. pci_attach_device
3. pci_read_config32
4. PCI_MEM_ADDR
I could not understand, how to set up a DMA channel for PCI bus ??? Can you please elaborate on DMA for PCI ??
garyritu
Active Member
 
Posts: 58
Joined: Fri May 22, 2009 7:09 am

RE: Re: RE: How PCI bus works in QNX

Postby mario » Mon Jun 22, 2009 2:19 pm

Typically you'd create a shared memory region ( mmap () ) to DMA into. Then you pci_attach to the device, get the base address of the card and write in the register's card to configure DMA. How that is done is device specific, you need to get the specification and start from there.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests