<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 28 October 2013 14:50, Daniel Hellstrom <span dir="ltr"><<a href="mailto:daniel@gaisler.com" target="_blank">daniel@gaisler.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yes there are a lot PCI changes. We have implemented a PCI library located in cpukit/libpci. Now the cfg space identifier {int bus, int slot, int func} is substituted with pci_dev_t to reduce the footprint of all PCI functions and callers. Now there are also I/O access routines.<br>

<br>
grpci_* is the GRPCI specific implementation, it is better to use the new PCI library definitions defined in pci/access.h:<br>
<br>
/* Configuration Space Access Read Routines */<br>
extern int pci_cfg_r8(pci_dev_t dev, int ofs, uint8_t *data);<br>
extern int pci_cfg_r16(pci_dev_t dev, int ofs, uint16_t *data);<br>
extern int pci_cfg_r32(pci_dev_t dev, int ofs, uint32_t *data);<br>
<br>
/* Configuration Space Access Write Routines */<br>
extern int pci_cfg_w8(pci_dev_t dev, int ofs, uint8_t data);<br>
extern int pci_cfg_w16(pci_dev_t dev, int ofs, uint16_t data);<br>
extern int pci_cfg_w32(pci_dev_t dev, int ofs, uint32_t data);<br>
<br>
/* Read a register over PCI I/O Space */<br>
extern uint8_t pci_io_r8(uint32_t adr);<br>
extern uint16_t pci_io_r16(uint32_t adr);<br>
extern uint32_t pci_io_r32(uint32_t adr);<br>
<br>
/* Write a register over PCI I/O Space */<br>
extern void pci_io_w8(uint32_t adr, uint8_t data);<br>
extern void pci_io_w16(uint32_t adr, uint16_t data);<br>
extern void pci_io_w32(uint32_t adr, uint32_t data);<br>
<br></blockquote><br></div>Thanks Daniel, it's starting to look a bit closer to working now :-)<br><br></div><div class="gmail_extra">I've made all the changes, and I can get my test driver and test program to build, but it's not initialising the driver.  Trying the sample "rtems-pci" program with the custom driver enabled shows the same problem, which might give you an idea of what's going wrong.<br>
<br></div><div class="gmail_extra">If I enable the "#define CONFIGURE_DRIVER_CUSTOM1" flag, then both my program and the sample fail with, e.g. :-<br><br>grlib> load /opt/rtems-4.10-mingw/src/samples/rtems-pci<br>
section: .text at 0x40000000, size 180176 bytes<br>section: .data at 0x4002bfd0, size 5520 bytes<br>section: .jcr at 0x4002d560, size 4 bytes<br>total size: 185700 bytes (19.8 Mbit/s)<br>read 1100 symbols<br>entry point: 0x40000000<br>
grlib> run<br>IU in error mode (tt = 0x2b)<br> 40016818  80a0a000   cmp  %g2<br><br></div><div class="gmail_extra">Looking at a dump of the executable, this is near the start of "_CORE_mutex_Seize", if that helps in any way...<br>
<br></div><div class="gmail_extra">Regards,<br><br>David<br></div></div>