Does the TX2 support I/O registers?

I’m trying to talk to a PCI Express device that’s got oldschool I/O registers defined, not MEM registers. (BAR[0] is 0x1001 and I want to read/write bytes to 0x1000).

<asm/io.h> or <sys/io.h> or <system/io.h> hold the inb/outp functions, do they work on the TX2 and how can I prove it to myself?

In DOS I’d use “debug”. Or PLXMON or something.

The ARM architecture doesn’t directly have “port” addressing modes, but some bus controllers may be able to translate certain memory ranges to port ranges.

If everything is set up correctly, then the kernel should handle translation, and inb()/outb() should work (from a kernel mode module, at least.)
Alternatively, have you tried using ioport_map()?

Or are you trying to do this from user space?

You probably already know this, but it’s a reasonable resource:

Understood, and thank you.

My question is, “is everything set up correctly?”, followed by, “how can I prove it”.

I only ask because my ttySn ports based on I/O registers don’t work, but a MEM-based ttySn does.

You can attach a serial debugger to the kernel and trace through the code side to see what it does.
(Also see if other drivers hit the same code path, which should indicate that it works.)
You can also add a logic analyzer or bus scope on the PCI-Ex bus to see what’s going on. This is unfortunately somewhat expensive for a hobbyist :-(
I’d probably go looking for the other drivers that work on the Jetson in the kernel source, and see if any of them use inb()/outb().

Okay, if I open “/dev/ports” O_RDWR | O_SYNC, lseek to my assigned PCI I/O memory address, then read 1 byte I get a segmentation fault, at least as “sudo”: I haven’t tried from “root” – I’m scared.

If I try to use ioperm, iopl, io_remap, or pci_iomap et al it can’t find the include file.

I would serial-debug the kernel but it would be my first Linux kernel debug, let alone via serial. (kgdb, right? I have the serial cable connected and can see dmesg on it, now I just need to learn non-IDE kernel debugging. whee!) (Do I sound excited? sorry. I’m not.)

I come from almost 30 years driver programming on PCs, but all in DOS/Windows, using Borland IDEs, not Microsoft nor Linux, so I’m handicapped.

Thank you for your support!