[Linux-parport] EPP mode for PCI interface card

Michael Kastner michael.kastner at gmx.at
Wed Feb 4 18:05:27 GMT 2004


Hi everyone,

I am trying to access a PCI parallel port card (Netmos 9805CV chip) directly
from RTLinux in hardware EPP mode. The device that I want to control is a
CCD line camera. However, it seems like the EPP handshake doesn't really work
well. Each byte I read from the camera is repaeted a couple of times before
the value changes. Also there is no difference in the time needed for the
transfer wether I have the camera connected or not (the timeout bit isn't set in
this case either).
Doing the same thing with the builtin parallel port works as expected.
Another problem is that when I turn the cameras power off and on again in
EPP mode (only when connected to the PCI card), the whole system freezes.
Here is my initialization code:

...
/* switch to epp mode */
outb_p(0x00, port_hi + 2); /* switch back to mode 0 */ outb_p(0x84, port_hi
+ 2); /* epp mode, no interrupts */ ...

...
/* write to camera */
outb_p(0, port + 2); /* direction write */ outb(c->controlByte, port + 4);
outb(c->timerByte, port + 4); ...
/* read from camera */
outb_p(0x20, (*c).port + 2); /* direction read */
c->ioIn = inb(port + 4);
for (i = 0; i < DESIGNATION_LENGTH; i++)
  c->designation[i] = inb(port + 4);
...

For the PCI card:
port == 0xd000, port_hi == 0xb800

For LPT1:
port == 0x378, port_hi == 0x778

Any idea, what I am doing wrong? Or could it be a defective card? I could
not test it in EPP mode with another device/driver, but a basic line printer
works with the card (parport/lp drivers). If the card is the problem, could you
suggest a good PCI card/chipset for my application?

The system I use is a Redhat 9 installation with a 2.4.20 vanilla kernel
patched with RTLinux 3.2-pre3.

Using the parport_pc driver also leads to some strange results.
The interrupt is not used, although the card should support IRQ sharing.
And when specifying io_hi, EPP mode is no longer detected.
And ECP mode never shows up at all.

insmod parport_pc io=0x378,0xd000 io_hi=0x778,0xb800 irq=7,9

parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE,EPP]
parport1: PC-style at 0xd000 (0xb800), irq 9 [PCSPP,TRISTATE]
parport1: irq 9 in use, resorting to polled operation

insmod parport_pc io=0x378,0xd000 io_hi=0x778,0xb800 irq=7,9

parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE,EPP]
parport1: PC-style at 0xd000, irq 9 [PCSPP,TRISTATE,EPP]
parport1: irq 9 in use, resorting to polled operation


My PCI configuration:
------------------------------
PCI devices found:
  Bus  0, device   0, function  0:
    Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev
3).
      Master Capable.  Latency=64.  
      Prefetchable 32 bit memory at 0xe4000000 [0xe7ffffff].
  Bus  0, device   1, function  0:
    PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 3).
      Master Capable.  Latency=64.  Min Gnt=136.
  Bus  0, device   4, function  0:
    ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 2).
  Bus  0, device   4, function  1:
    IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 1).
      Master Capable.  Latency=32.  
      I/O at 0xd800 [0xd80f].
  Bus  0, device   4, function  2:
    USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 1).
      IRQ 9.
      Master Capable.  Latency=32.  
      I/O at 0xd400 [0xd41f].
  Bus  0, device   4, function  3:
    Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 2).
      IRQ 9.
  Bus  0, device   9, function  0:
    Communication controller: PCI device 9710:9805 (NetMos Technology) (rev
1).
      IRQ 9.
      Master Capable.  Latency=32.  
      I/O at 0xd000 [0xd007].
      I/O at 0xb800 [0xb807].
      I/O at 0xb400 [0xb407].
      I/O at 0xb000 [0xb007].
      I/O at 0xa800 [0xa807].
      I/O at 0xa400 [0xa40f].
  Bus  0, device  10, function  0:
    FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller
(rev 70).
      IRQ 5.
      Master Capable.  Latency=32.  Max Lat=32.
      Non-prefetchable 32 bit memory at 0xd5800000 [0xd58007ff].
      I/O at 0xa000 [0xa07f].
  Bus  0, device  11, function  0:
    Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 8).
      IRQ 10.
      Master Capable.  Latency=32.  Min Gnt=12.Max Lat=128.
      I/O at 0x9800 [0x983f].
  Bus  0, device  13, function  0:
    Ethernet controller: Lite-On Communications Inc LNE100TX (rev 32).
      IRQ 9.
      Master Capable.  Latency=32.  
      I/O at 0x9400 [0x94ff].
      Non-prefetchable 32 bit memory at 0xd5000000 [0xd50000ff].
  Bus  1, device   0, function  0:
    VGA compatible controller: nVidia Corporation NV11 [GeForce2 MX] (rev
178).
      IRQ 11.
      Master Capable.  Latency=64.  Min Gnt=5.Max Lat=1.
      Non-prefetchable 32 bit memory at 0xd6000000 [0xd6ffffff].
      Prefetchable 32 bit memory at 0xd8000000 [0xdfffffff].
------------------------------

Regards,
  Michael

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++




More information about the Linux-parport mailing list