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 (gthomas@cygnus.co.uk 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 <abdullahkhateeb@gmail.com>
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
Base_Address[1]=0xfcfdf000
Base_Size[0]=0x0
Base_Size[1]=0x0
Base_Map[0]=0xfcfde000
Base_Map[1]=0xfcfdf000
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
Base_Address[1]=0xfcfdf000
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++)
{
HAL_WRITE_UINT8(dev_info.base_map[1]+i,0x20);
HAL_READ_UINT8(dev_info.base_map[1]+i,tempVal);
diag_printf(" count[%d]=%04x \n", i, tempVal);
}
}