Talking to PCI board

bridged with qdn.public.ddk
Post Reply
Andre Goddard Rosa

Talking to PCI board

Post by Andre Goddard Rosa » Tue Sep 23, 2003 7:38 pm

I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

Jens H Jorgensen

Re: Talking to PCI board

Post by Jens H Jorgensen » Wed Sep 24, 2003 2:03 pm

Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:
http://www.qnx.com/developer/docs/momen ... adctl.html

For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:
http://www.qnx.com/developer/docs/momen ... ttach.html

pci_attach_device() - for finding and retrieving PCI device information:
http://www.qnx.com/developer/docs/momen ... evice.html

pci_detach() - disconnects from PCI sub-system:
http://www.qnx.com/developer/docs/momen ... etach.html

Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:
http://www.qnx.com/developer/docs/momen ... emory.html

IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit
http://www.qnx.com/developer/docs/momen ... i/in8.html

Interrupt:
InterruptAttach() - sets up traditional ISR
http://www.qnx.com/developer/docs/momen ... ttach.html

InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.
http://www.qnx.com/developer/docs/momen ... event.html

--
Jens

"Andre Goddard Rosa" <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

Andre Goddard Rosa

Re: Talking to PCI board

Post by Andre Goddard Rosa » Wed Sep 24, 2003 4:58 pm

Thank you very much, I will take a look at these and report later!!!

Best Regards,

Andre

"Jens H Jorgensen" <jhj@remove-nospam-videk.com> escreveu na mensagem
news:bks7uh$1dv$1@inn.qnx.com...
Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:

http://www.qnx.com/developer/docs/momen ... ef/t/threa
dctl.html
For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_a
ttach.html
pci_attach_device() - for finding and retrieving PCI device information:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_a
ttach_device.html
pci_detach() - disconnects from PCI sub-system:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_d
etach.html
Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:

http://www.qnx.com/developer/docs/momen ... ref/m/mmap_
device_memory.html
IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit

http://www.qnx.com/developer/docs/momen ... ef/i/in8.h
tml
Interrupt:
InterruptAttach() - sets up traditional ISR

http://www.qnx.com/developer/docs/momen ... ef/i/inter
ruptattach.html
InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.

http://www.qnx.com/developer/docs/momen ... ef/i/inter
ruptattachevent.html
--
Jens

"Andre Goddard Rosa" <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre



Andre Goddard Rosa

Re: Talking to PCI board

Post by Andre Goddard Rosa » Thu Sep 25, 2003 6:20 pm

What can I do if I am using QNX4?

Thanks,

Andre

"Andre Goddard Rosa" <goddard@audiolab.com.br> escreveu na mensagem
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre

Andre Goddard Rosa

Re: Talking to PCI board

Post by Andre Goddard Rosa » Thu Sep 25, 2003 7:08 pm

What can I do if I am using QNX4?

Thanks,

Andre

"Jens H Jorgensen" <jhj@remove-nospam-videk.com> escreveu na mensagem
news:bks7uh$1dv$1@inn.qnx.com...
Look at the pci_*() functions.

For instance:

First steps:
ThreadCtrl(_NTO_TCTL_IO, 0) - allows the application IO privilige:

http://www.qnx.com/developer/docs/momen ... ef/t/threa
dctl.html
For PCI plug and play functionality:
pci_attach() - for connecting to the PCI sub-system:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_a
ttach.html
pci_attach_device() - for finding and retrieving PCI device information:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_a
ttach_device.html
pci_detach() - disconnects from PCI sub-system:

http://www.qnx.com/developer/docs/momen ... ef/p/pci_d
etach.html
Memory mapping:
mmap_device_memory() - for mapping PCI device memory into virtual memory
space:

http://www.qnx.com/developer/docs/momen ... ref/m/mmap_
device_memory.html
IO:
in8() - reads 8 bit IO
in16() - 16 bit
in32() - 32 bit
out8() - write 8 bit IO
out16() - 16 bit
out32() - 32 bit

http://www.qnx.com/developer/docs/momen ... ef/i/in8.h
tml
Interrupt:
InterruptAttach() - sets up traditional ISR

http://www.qnx.com/developer/docs/momen ... ef/i/inter
ruptattach.html
InterruptAttachEvent() - sets up an event based ISR, which run in user
space. This is slower than the traditional ISR method.

http://www.qnx.com/developer/docs/momen ... ef/i/inter
ruptattachevent.html
--
Jens

"Andre Goddard Rosa" <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will be
connected to a device that provides me with a regular time indicator via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI device.
This certainly exists but I could not find anywhere on the site by
searching
it.

The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre



Mario Charest

Re: Talking to PCI board

Post by Mario Charest » Thu Sep 25, 2003 10:10 pm

Jens

"Andre Goddard Rosa" <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will
be
connected to a device that provides me with a regular time indicator
via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI register
of an arbitrary PCI device. I found references about Audio, Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI
device.
This certainly exists but I could not find anywhere on the site by
searching it.
Maybe you were looking for something a little more too specific. Under QNX4
a driver is just like a normal program. Just need to be linked with -T1.
As for getting info about PCI look for CA_PCI_* fonctions.

All the doc you found on are mostly about QNX6, beware.
The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre





Andre Goddard Rosa

Re: Talking to PCI board

Post by Andre Goddard Rosa » Fri Sep 26, 2003 5:23 pm

Thanks, I just found how to access it using CA_PCI_* and using inp() to read
from an address, it is working
so I am getting the values I need.

Now I must install a handler to listen to interrupts, do you know how to do
that?

Thanks,

Andre

"Mario Charest" <postmaster@127.0.0.1> escreveu na mensagem
news:bkvo9d$iki$1@inn.qnx.com...
Jens

"Andre Goddard Rosa" <goddard@audiolab.com.br> wrote in message
news:bkq8m2$h94$1@inn.qnx.com...
I want to develop a driver to communicate with a PCI board that will
be
connected to a device that provides me with a regular time indicator
via
the PCI registers.

So, I checked out all the doc that I could find on the QNX site but
nothing
about developing a driver to access the PCI bus to read a PCI
register
of an arbitrary PCI device. I found references about Audio,
Graphics,
Input, Network and USB, but none about a generic PCI device.

I need a template to using the PCI registers of an arbitrary PCI
device.
This certainly exists but I could not find anywhere on the site by
searching it.

Maybe you were looking for something a little more too specific. Under
QNX4
a driver is just like a normal program. Just need to be linked with -T1.
As for getting info about PCI look for CA_PCI_* fonctions.

All the doc you found on are mostly about QNX6, beware.


The board that I am using is a PCI9030 assembled by
PLX Technology at www.plxtech.com. They provide me with driver
implementations for Windows and Linux (2.2 and 2.4 kernels).


I appreciate any help you give to me,

Thanks,

Andre







Andre Goddard Rosa

Re: Talking to PCI board

Post by Andre Goddard Rosa » Mon Sep 29, 2003 6:01 pm

Thanks to you all, I got it working ok now,

Andre

Post Reply

Return to “qdn.public.ddk”