This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: PCI driver development for NI-DAQ PCI-DIO-96 card

Gary Thomas wrote:
Note: you should really send this to proper email addresses and not
individuals. The address you have for the eCos discussion list was
incorrect and at least one of the other email addresses is extremely
out of date ( hasn't been used since spring of 2000!)

Please keep your replies on this list as [further] private emails
will be ignored.
On Fri, 2005-12-02 at 10:22 +0500, Khateeb wrote:
Abdullah <>
College Senior

We are trying to write a PCI device driver for NI-DAQ PCI-DIO-96 card
using eCos.
The target platform is intel P4 processor/mother-board.
The host system is an intel pentium P3 PC running windows XP.

I have successfully detected the device using the device-id.
The device info structure read from the PCI configuration space header
region is

vendor ID=0x1093
device ID=0x0160 command register=0x117 status register = 0x280
class + revision = 0xff000000
cache line size =0x10
latency timer =0x10
Built-in Self-Test =0x0
Num of BAR=0x2 Base_Address[0]=0xfcfde000

I am assuming that the Base_Address[0] corresponds to BAR(0) and
Base_Address[1] corresponds to BAR(1). I have tried to write on these
registers through 'HAL_WRITE_UINT32' command but i haven't been
successful in that since reading those registers again gives the same
previous values of Base_Address[0]=0xfcfde000
using the read command which is 'HAL_READ_UINT32'.

Does your device actually respond to 32 bit accesses when using BAR(1)? Your code (below) doesn't look obviously wrong to me, but you need to know the characteristics of the device "behind" the PCI interface.

The basic probelm lies in configuring the base address and finding an
appropriate offset; which so far i have not been able to do so. I have
taken help from the PCI sample programs 'pci1.c' and 'pci2.c'.

// Writing data to the memory allocated to BAR[1]
// Basically trying to access the devices registers so // that we can program the 8255 Chip.
for(i = 0; i <= 16; i++) {
diag_printf(" count[%d]=%04x \n", i, tempVal);
} }

I think your problem is i386 platform specific. the HAL_(READ|WRITE)_UINT(8|16|32) calls actually use ISA port space not PCI memory space. I think you need to use the HAL_(READ|WRITE)MEM_UINT(8|16|32). I thought there was a flag in the BAR register to indicate if the memory is port mapped or memory mapped. But it has been a long time since I looked at that.

Good luck

David Brennan

Before posting, please read the FAQ:
and search the list archive:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]