Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - pci mem/io and lockup: (2 Items)
   
pci mem/io and lockup  
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? 




Re: pci mem/io and lockup  
I'm trying to write a configuration file to an FPGA through a PLX9054 BRIDGE. I read your story and filled in the "
struct pci_dev_info" with the right information.

BAR: 0
BaseAddressOffset             : 10
IRQOffset                     : 3C
Base addr value               : 0xF7800000
Base addr size                : 256
                              : MEMORY
Cpu base addr value           : 0xF7800000

BAR: 1
BaseAddressOffset             : 10
IRQOffset                     : 3C
Base addr value               : 0x0000B801
Base addr size                : 256
                              : I/O
Cpu base addr value           : 0x0000B800

BAR: 2
BaseAddressOffset             : 10
IRQOffset                     : 3C
Base addr value               : 0x0000B401
Base addr size                : 256
                              : I/O
Cpu base addr value           : 0x0000B400

BAR: 3
BaseAddressOffset             : 10
IRQOffset                     : 3C
Base addr value               : 0xF7000000
Base addr size                : 65536
                              : MEMORY
Cpu base addr value           : 0xF7000000
IRQ: 0x0000000B

Maybe someone has a function availeble to configure the FPGA?
Associations:
post93330:
              PCI Express -  - sri lakshmi