Using 'in*()' and 'out*()' to PCI devices?

Assume I have a PCI card on an x86 machine with a register in I/O space at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The equivalent
‘in8(dc40)’ in RTP doesn’t work. I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either. What am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov

Art Hays <avhays@nih.gov> wrote in article <a6n5us$su0$1@inn.qnx.com>…

Assume I have a PCI card on an x86 machine with a register in I/O space at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The equivalent
‘in8(dc40)’ in RTP doesn’t work.

Did you
ThreadCtl(_NTO_TCTL_IO,0); //enable i/o operation
before reading?
Eduard.

I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either. What am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov

“ed1k” <ed1k@yahoo.com> wrote in message
news:01c1ca82$07df04a0$106fa8c0@ED1K…

Art Hays <> avhays@nih.gov> > wrote in article <a6n5us$su0$> 1@inn.qnx.com> >…
Assume I have a PCI card on an x86 machine with a register in I/O space
at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The
equivalent
‘in8(dc40)’ in RTP doesn’t work.

Did you
ThreadCtl(_NTO_TCTL_IO,0); //enable i/o operation
before reading?
Eduard.

Yes, I did this. Under RTP I can access registers on a card on the ISA bus
just fine. I just can’t access registers on a card on the PCI bus. However
if I boot 4.25 on the same machine, I can access the PCI card registers
without any problem.

I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either. What
am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov

Previously, Art Hays wrote in qdn.public.qnxrtp.applications:

“ed1k” <> ed1k@yahoo.com> > wrote in message
news:01c1ca82$07df04a0$106fa8c0@ED1K…
Art Hays <> avhays@nih.gov> > wrote in article <a6n5us$su0$> 1@inn.qnx.com> >…
Assume I have a PCI card on an x86 machine with a register in I/O space
at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The
equivalent
‘in8(dc40)’ in RTP doesn’t work.

How about in8 (0xdc40); ?

Did you
ThreadCtl(_NTO_TCTL_IO,0); //enable i/o operation
before reading?
Eduard.

Yes, I did this. Under RTP I can access registers on a card on the ISA bus
just fine. I just can’t access registers on a card on the PCI bus. However
if I boot 4.25 on the same machine, I can access the PCI card registers
without any problem.


I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either. What
am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov


\

“Hugh Brown” <hsbrown@qnx.com> wrote in message
news:Voyager.020313130619.1956F@node90.ott.qnx.com

Previously, Art Hays wrote in qdn.public.qnxrtp.applications:

“ed1k” <> ed1k@yahoo.com> > wrote in message
news:01c1ca82$07df04a0$106fa8c0@ED1K…
Art Hays <> avhays@nih.gov> > wrote in article
a6n5us$su0$> 1@inn.qnx.com> >…
Assume I have a PCI card on an x86 machine with a register in I/O
space
at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The
equivalent
‘in8(dc40)’ in RTP doesn’t work.

How about in8 (0xdc40); ?

No, this doesnt help. By the way, I’ve read up on all the ‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers? My
other thought is this- could there be a problem with the way RTP initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI bridge.
However, I can read the register just fine on the same hardware if I boot
4.25 instead of RTP.

Did you
ThreadCtl(_NTO_TCTL_IO,0); file://enable i/o operation
before reading?
Eduard.

Yes, I did this. Under RTP I can access registers on a card on the ISA
bus
just fine. I just can’t access registers on a card on the PCI bus.
However
if I boot 4.25 on the same machine, I can access the PCI card registers
without any problem.


I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either.
What
am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov



\

Previously, Art Hays wrote in qdn.public.qnxrtp.applications:

“Hugh Brown” <> hsbrown@qnx.com> > wrote in message
news:> Voyager.020313130619.1956F@node90.ott.qnx.com> …
Previously, Art Hays wrote in qdn.public.qnxrtp.applications:

“ed1k” <> ed1k@yahoo.com> > wrote in message
news:01c1ca82$07df04a0$106fa8c0@ED1K…
Art Hays <> avhays@nih.gov> > wrote in article
a6n5us$su0$> 1@inn.qnx.com> >…
Assume I have a PCI card on an x86 machine with a register in I/O
space
at
address dc40h. I can see this from the output of ‘pci’:

PCI IO Address = dc40h length 32 enabled

Under 4.25 a simple ‘inp(dc40)’ would read this register. The
equivalent
‘in8(dc40)’ in RTP doesn’t work.

How about in8 (0xdc40); ?

No, this doesnt help. By the way, I’ve read up on all the ‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers? My
other thought is this- could there be a problem with the way RTP initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI bridge.
However, I can read the register just fine on the same hardware if I boot
4.25 instead of RTP.

You have to at least do a pci_attach() before you do any pci_reads or writes
under RTP. There is no difference in the register setup between QNX4 and
RTP, as we rely in the bios to do this.

Did you
ThreadCtl(_NTO_TCTL_IO,0); file://enable i/o operation
before reading?
Eduard.

Yes, I did this. Under RTP I can access registers on a card on the ISA
bus
just fine. I just can’t access registers on a card on the PCI bus.
However
if I boot 4.25 on the same machine, I can access the PCI card registers
without any problem.


I also tried using ‘mmap_device_io()’
(which I understand is a nop for x86) and this didnt work either.
What
am I
doing wrong?


Art Hays
National Institutes of Health
avhays@nih.gov






\

“Hugh Brown” <hsbrown@qnx.com> wrote in message
news:Voyager.020313143146.1956K@node90.ott.qnx.com

No, this doesnt help. By the way, I’ve read up on all the
‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers? My
other thought is this- could there be a problem with the way RTP
initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI
bridge.
However, I can read the register just fine on the same hardware if I
boot
4.25 instead of RTP.


You have to at least do a pci_attach() before you do any pci_reads or
writes
under RTP. There is no difference in the register setup between QNX4 and
RTP, as we rely in the bios to do this.

This is what is confusing to me. Assume a PCI card has a register in I/O
space at 0xdc40. Would I have to do a ‘pci_attach()’ to execute this:

val= in8(0xdc40);

The doc for ‘pci_attach()’ says that it must be called before one can use
any of the other ‘pci_*()’ calls, which I wouldnt think I need to use
(in8() is not one of these calls).

I appreciate your help with this. I have a deadline porting an app from
4.25 to RTP and am stuck at square one since I cant access the registers.

I have some new, interesting info. I moved the card to the first PCI slot.
This slot is on bus 0 and not behind a PCI to PCI bridge. I can
successfully read the register with an ‘in8()’ call.

So, this must have something to do with slots that are not on bus 0.
Remember, this works under 4.25. Can I send the output of ‘show_pci’ on
4.25 and ‘pci -vvv’ on RTP to someone to look at?


“Art Hays” <avhays@nih.gov> wrote in message
news:a6ob1r$otn$1@inn.qnx.com

“Hugh Brown” <> hsbrown@qnx.com> > wrote in message
news:> Voyager.020313143146.1956K@node90.ott.qnx.com> …

No, this doesnt help. By the way, I’ve read up on all the
‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers?
My
other thought is this- could there be a problem with the way RTP
initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI
bridge.
However, I can read the register just fine on the same hardware if I
boot
4.25 instead of RTP.


You have to at least do a pci_attach() before you do any pci_reads or
writes
under RTP. There is no difference in the register setup between QNX4 and
RTP, as we rely in the bios to do this.


This is what is confusing to me. Assume a PCI card has a register in I/O
space at 0xdc40. Would I have to do a ‘pci_attach()’ to execute this:

val= in8(0xdc40);

The doc for ‘pci_attach()’ says that it must be called before one can use
any of the other ‘pci_*()’ calls, which I wouldnt think I need to use
(in8() is not one of these calls).

I appreciate your help with this. I have a deadline porting an app from
4.25 to RTP and am stuck at square one since I cant access the registers.

Previously, Art Hays wrote in qdn.public.qnxrtp.applications:

I have some new, interesting info. I moved the card to the first PCI slot.
This slot is on bus 0 and not behind a PCI to PCI bridge. I can
successfully read the register with an ‘in8()’ call.

So, this must have something to do with slots that are not on bus 0.
Remember, this works under 4.25. Can I send the output of ‘show_pci’ on
4.25 and ‘pci -vvv’ on RTP to someone to look at?

Yes, please.

“Art Hays” <> avhays@nih.gov> > wrote in message
news:a6ob1r$otn$> 1@inn.qnx.com> …

“Hugh Brown” <> hsbrown@qnx.com> > wrote in message
news:> Voyager.020313143146.1956K@node90.ott.qnx.com> …

No, this doesnt help. By the way, I’ve read up on all the
‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers?
My
other thought is this- could there be a problem with the way RTP
initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI
bridge.
However, I can read the register just fine on the same hardware if I
boot
4.25 instead of RTP.


You have to at least do a pci_attach() before you do any pci_reads or
writes
under RTP. There is no difference in the register setup between QNX4 and
RTP, as we rely in the bios to do this.


This is what is confusing to me. Assume a PCI card has a register in I/O
space at 0xdc40. Would I have to do a ‘pci_attach()’ to execute this:

val= in8(0xdc40);

The doc for ‘pci_attach()’ says that it must be called before one can use
any of the other ‘pci_*()’ calls, which I wouldnt think I need to use
(in8() is not one of these calls).

I appreciate your help with this. I have a deadline porting an app from
4.25 to RTP and am stuck at square one since I cant access the registers.

\

Thought I’d post the resolution of this issue for anyone who searches
the group in the future and has a similar problem- I tried the 6.2 beta and
it’s fixed.

Art

“Hugh Brown” <hsbrown@qnx.com> wrote in message
news:Voyager.020313162812.1956N@node90.ott.qnx.com

Previously, Art Hays wrote in qdn.public.qnxrtp.applications:
I have some new, interesting info. I moved the card to the first PCI slot.
This slot is on bus 0 and not behind a PCI to PCI bridge. I can
successfully read the register with an ‘in8()’ call.

So, this must have something to do with slots that are not on bus 0.
Remember, this works under 4.25. Can I send the output of ‘show_pci’ on
4.25 and ‘pci -vvv’ on RTP to someone to look at?


Yes, please.


“Art Hays” <> avhays@nih.gov> > wrote in message
news:a6ob1r$otn$> 1@inn.qnx.com> …

“Hugh Brown” <> hsbrown@qnx.com> > wrote in message
news:> Voyager.020313143146.1956K@node90.ott.qnx.com> …

No, this doesnt help. By the way, I’ve read up on all the
‘pci_attach()’
calls. Do I have to do this under RTP just to read the registers?
My
other thought is this- could there be a problem with the way RTP
initializes
PCI bridges? I think the slot this card is in is after a PCI to PCI
bridge.
However, I can read the register just fine on the same hardware if I
boot
4.25 instead of RTP.


You have to at least do a pci_attach() before you do any pci_reads or
writes
under RTP. There is no difference in the register setup between QNX4 and
RTP, as we rely in the bios to do this.


This is what is confusing to me. Assume a PCI card has a register in I/O
space at 0xdc40. Would I have to do a ‘pci_attach()’ to execute this:

val= in8(0xdc40);

The doc for ‘pci_attach()’ says that it must be called before one can use
any of the other ‘pci_*()’ calls, which I wouldnt think I need to use
(in8() is not one of these calls).

I appreciate your help with this. I have a deadline porting an app from
4.25 to RTP and am stuck at square one since I cant access the registers.


\