can't write/read to isa-card using ioperm, iow, ior
From: Marcus (mschneller_at_swissonline.ch)
Date: 08/27/03
- Next message: monk: "PLEASE help with automake, etc."
- Previous message: Ren Hantao: "gui for embedded linux"
- Next in thread: Ulrich Eckhardt: "Re: can't write/read to isa-card using ioperm, iow, ior"
- Reply: Ulrich Eckhardt: "Re: can't write/read to isa-card using ioperm, iow, ior"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Aug 2003 00:30:34 -0700
Dear Hardware-Experts
I have an PnP-ISA-Card installed in my PC, but do have problems
reading/writing from/to the card.
/proc/isapnp says:
Card 1 'BUR0020:BUR PCIO' PnP version 1.0
Logical device 0 'BUR0000:Unknown'
Supported registers 0x2
Device is active
Active port 0x220
Active IRQ 5
Active DMA ,0
Resources 0
Priority acceptable
Port 0x200-0xffe0, align 0x1f, size 0x20, 16-bit address decoding IRQ
3,4,5,6,7,2/9,10,11,12,14,15 High-Edge
My interpretation is that the Base Address is 0x220.
proc/ioports says:
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
01f0-01f7 : ide0
0213-0213 : isapnp read
02f8-02ff : serial(auto)
0378-037a : parport0
037b-037f : parport0
03c0-03df : vesafb
03f6-03f6 : ide0
03f8-03ff : serial(auto)
0a79-0a79 : isapnp write
0cf8-0cff : PCI conf1
4000-403f : Intel Corp. 82371AB/EB/MB PIIX4 ACPI
5000-501f : Intel Corp. 82371AB/EB/MB PIIX4 ACPI
e000-e01f : Intel Corp. 82371AB/EB/MB PIIX4 USB
e000-e01f : usb-uhci
e400-e43f : Intel Corp. 82559ER
e400-e43f : eepro100
f000-f00f : Intel Corp. 82371AB/EB/MB PIIX4 IDE
f000-f007 : ide0
What do the addresses isapnp write/read mean? Why do theydon't match
0x220?
I'm using ioperm to get permission to read/write to the card as
follows (I'm root):
int initPort()
{
if(iIOAddr == 0) //iIOAddr is 0x220
return 1;
return ioperm(iIOAddr, 0x20, 1);
}
Reading(writing is done as follows:
void readIOw(uint16 iOffset, uint16 *iVal) {
if (iVal == NULL) {
printf("readIOw: can't write to null pointer\n");
return;
}
*iVal = inw(iIOAddr + iOffset);
//usleep(1);
}
void writeIOw(uint16 iOffset, uint16 iVal) {
outw(iVal, iIOAddr + iOffset);
//usleep(1);
}
Well, to be short, it doesn't work. readIOw always returns 0xffff,
which shouldn't be.
The same Card works fine under Tornado/vxWorks using the same
mechanisms. Therefore the I think the addresses are correct and it
might be a Linux realated problem.
Any help is really welcome
Marcus
Content Security by MailMarshal
- Next message: monk: "PLEASE help with automake, etc."
- Previous message: Ren Hantao: "gui for embedded linux"
- Next in thread: Ulrich Eckhardt: "Re: can't write/read to isa-card using ioperm, iow, ior"
- Reply: Ulrich Eckhardt: "Re: can't write/read to isa-card using ioperm, iow, ior"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|