6
votes

I'm trying to find the base (memory) address of a parallel port I have connected to my laptop via a PCI express card. Running lspci -v shows that my computer recognizes the parallel port and gives the I/O ports (1000 and 1008) but not the memory address (other entries have both ports and memory locations…this card is the only entry without a memory address). Also, when I look in /proc/ioports I get the same ports given in lspci. However, when I try to use either of those addresses in the program I'm running (EMC2 to control stepper motors), it does not find a parallel port at that address.

What would be really great is if there were an analogue to the Windows Device Manager -> Ports -> Resources. Is there any way to do this in Ubuntu? Is there a standard memory location for PCIe devices?

Edit: The output from lspci -v

04:00.0 Parallel controller: Oxford Semiconductor Ltd Device c110 (prog-if 02)
Subsystem: Oxford Semiconductor Ltd Device c110
Flags: bus master, fast devsel, latency 0, IRQ 18
I/O ports at 1000 [size=8]
I/O ports at 1008 [size=4]
Capabilities: [40] Power Management version 3
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Legacy Endpoint, MSI 00
Capabilities: [100] Device Serial Number 10-01-00-11-11-e0-30-00
Capabilities: [110] Power Budgeting <?>
Kernel driver in use: parport_pc
Kernel modules: parport_pc

And for reference, another entry that shows the memory location:

0c:03.0 FireWire (IEEE 1394): Agere Systems FW322/323 (rev 61) (prog-if 10)
Subsystem: Agere Systems FW322/323
Flags: bus master, fast Back2Back, medium devsel, latency 248, IRQ 19
Memory at 8c000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2
Kernel driver in use: ohci1394
Kernel modules: firewire-ohci, ohci1394
2
Could you attach the output of lspci -w on your parallel port card? I can tell you that there is no standard memory location for PCIe devices, and that parallel ports don't often have memory address regions.Adrian Cox
@adrian lspci is complaining that -w is not a valid flag. I have read that 0x378, 0x278, and 0x3BC are the three standard locations for a parallel port, but mine does not appear to be at any of those spots. Is there a way to determine memory address from an I/O port number?Sam
Accourding to EMC2 documentation wiki.linuxcnc.org/emcinfo.pl?TroubleShooting you have to unload linux kernel module parport_pc because probably it takes control over parallel port addresses and your software cant access them. Use lsmod and rmmod to remove all modules connected with parport (like parport_pc, parport, ppdev) and try again.Zuljin
@Sam Sorry - typo pasted from EMC2 docs. Should be lspci -v. Parallel port cards generally only have I/O ports, so your lspci output is normal.Adrian Cox
So we don't know how it got fixed but it started working today...before the I/O ports were disabled on startup but today they were enabled. Not sure how or why that happened but it seems to get the job done. Thanks for all your help everyone!Sam

2 Answers

4
votes

Try cat /proc/ioports | grep parport to filter the output of ioports.

2
votes

Quick answer: there is no memory location for the parallel port. Parallel ports only ever have IO ports allocated to them. This is the way parallel port interfaces have worked for decades, and nobody has felt the need to make an incompatible memory mapped interface that would need special drivers.

Now I must ask, why are you intent on finding the port's memory location? What do you want to do with it?