Jeffry Molanus
12/04/2007 5:51 PM
post3334
|
Earlier I've posted a question about the pci_find_device() function.(http://community.qnx.com/sf/go/post2810) The reply
I got worked fine however, the data sheet of the hardware says that the second BAR is IO not memory. QNX how ever says
it *is* memory. (using the PCI_IS_IO/PCI_IS_MEM functions. I do not know if this really is a big deal ( I don't really
care) however.
When I use the out* functions, the hardware acts like expected. But when I program the FPGA, I do multiple writes to the
same IO address (166890 times).
After a while, the WHOLE system locks up so some thing is really wrong.
/* mapping io pointer, QNX says it *is* mem */
d->io.fpga16_base = map_device_io(d->pdev.BaseAddressSize[ANYIO_PCI_FPGA16_IO],
d->pdev.CpuBaseAddress[ANYIO_PCI_FPGA16_IO]);
/* more code */
for(numbytes=0; numbytes< bytesleft; numbytes++)
{
dev->data_out_func(dev,dev->prog_file[offset+numbytes]);
}
when numbytes is about 166961, the system locks up... only power off remains.
The data_out_func:
out8(dev->io.fpga16_base,swaptab[thebyte]);
(swaptab is a array to map the byte to the right 'code')
There are two things I can think of why this goes wrong:
QNX says it is mem, it surely is not this results in this wierd behavior. Or the I write to many bites to the driver
when programming is enabled and the hardware trips that badly it locks the whole system... (it is ported code from a
Linux driver I wrote which works..... )
Could it be that the system locks up due to the fact it 'thinks' its MEM instead of IO?
|
|
|