Re: DIO_Exercise part 2




Hi Ray

Just to add to Eric's notes, the kernel calls to locate the IO address of a 
card are fairly simple. As long as you know the vendor ID and device ID, the 
sub** ID can be ignored - These last two are generally used when there are 
multiple interfaces on one card (i.e. IDE, parallel port, and serial port 
combined).

The problem with the PCI-DIO24 card is any lack of documentation for the 
vendor and device ID - The RegMapPCI-DIO24X.pdf refers to the use of a 
PLX9052, so I would make a tentative assumption of 10B5 and 9052 (from 
/usr/include/linux/pci_ids.h). Programming in C, locating the IO address 
would be no more than six lines or so of code.

Moving on.. Once a card is plugged in to a PCI slot, the IO address will not 
change until it is physically moved to another slot. Using "lspci -vv" should 
provide a little more info than /proc/pci. For example, I get the following 
for a parallel IO card :-

00:08.0 Communication controller: Unknown device 9710:9815 (rev 01)
        Subsystem: Symbios Logic Inc. (formerly NCR): Unknown device 0020
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at b000 [size=8]
        Region 1: I/O ports at b400 [size=8]
        Region 2: I/O ports at b800 [size=8]
        Region 3: I/O ports at bc00 [size=8]
        Region 4: I/O ports at c000 [size=8]
        Region 5: I/O ports at c400 [size=16]

>From this, I see several IO base addresses that I can try - Assume for a 
moment this is a DIO24.. The pdf doc claims the 8255 is addressed at BADR2, 
which would be Region 2 or B800....

Two things to be wary of - Use 8bit read/writes, and don't try read/writes 
outside of the 8255 register map. I found my system would lock up when I 
tried to do this with a PLX9050 chip.


Regards, Paul.



On Tuesday 18 Feb 2003 1:45 pm, ERIC KELLER wrote:
> Each PCI board is uniquely identified.  In the source code for the PCI-DIO
> board, you will see these definitions:
>
> vendor:                  PCI_VENDOR_ID_CBOARDS,
>   device:                  PCI_DEVICE_ID_CBOARDS_DIO24,
>   subvendor:               PCI_ANY_ID,
>   subdevice:               PCI_ANY_ID,
>
> Then there are kernel functions to track down the base address of the
> board.  I don't know how long the first two numbers will suffice to define
> a board, all 4 are required in pci ver 2.3 as I recall.

-- 

"To err is human...to really f*** things up requires the root password."
>From a collection of quotes at http://www.indigo.org/quotes.html




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact