in8() problem

Hi to all,
I’m trying to write on a PCI DAQ card.
Using pci -v utility I’ve found that the base address is
0xe8102000 (higher than 1MB). I’ve made mmap_device_io()
that returns the same number (0xe8102000).
When I write (in8) and after read (out8) for testing I find
that the read value is always an all-ones configuration.
Using a lower address corresponding to another PCI device such as 0xE400, it works fine.

Thanks in advance,
Gianluca :frowning:

I could be that it’s a memory address and not an IO address?

Yes, you’re right: it’s an IO address (I tested it through PCI_IS_MEM() macro).
Should I use mmap_device_memory() now?

Thanks Mario,
Gianluca :slight_smile:

You prolly can choose from these two access methods:

Use the “PCI Mem Address”, map it with mmap_device_memory() and read/write with the memory pointer (use it like normal memory allocated by the process)

Or use the “PCI IO Address”, map it with mmap_device_io() and read/write with the in*()/out*() functions

Most cards I have seen, have different usage for the MEM and IO accesess. Only for legacy purpuses do both MEM and IO perform the same task.

I/O space is legacy or atleast legacy thinking. The MMU made the idea of hard partitioning obsolete decades ago. And even then the idea was questionable.