On 14/01/13 10:01, ternaryd wrote: > Hi, > > I'm trying to use the VME-bridge TSI-148 driver with the 3.7.1 stock > kernel on a powerpc-spe (e500v2), but I don't seem to be able to find > the guidelines to use it (user space). I'm afraid there's not much documentation about the user space access at the moment. There is a module called "vme_user" that needs to be built and loaded. It requires the VME bus to which it is to be bound to be specified. For most people (who only have 1 VME bridge on their board) this will be (assuming for now that you have VME built as modules): modprobe vme modprobe vme_tsi148 modprobe vme_user bus=0 If you have these built into you kernel, appending "vme_user.bus=0" to your boot args should be sufficient. > I did find the file vme_api.txt, > but while I don't understand too much of it, it seems to refer to > kernel development (because of the registration of a driver). Would you > care to give me a pointer to get started? > The VME core provides an in-kernel API for the development of VME device drivers. There is a module called "vme_user" which exposes a very limited capability through to user space (no interrupt reception for example). This was written as a debug tool, though some find it useful for writing simple VME drivers/access routines in user space. > vme_tsi148 0000:02:0e.0: Can't get assigned pci irq vector 00 > vme_tsi148 0000:02:0e.0: Chip Initialization failed. > vme_tsi148: probe of 0000:02:0e.0 failed with error -22 > It appears that your PCI interrupts aren't getting set up correctly. You should see something more like this: vme_tsi148 0000:0d:00.0: Board is the VME system controller vme_tsi148 0000:0d:00.0: VME geographical address is 1 vme_tsi148 0000:0d:00.0: VME Write and flush and error check is disabled vme_tsi148 0000:0d:00.0: CR/CSR Offset: 1 vme_tsi148 0000:0d:00.0: Enabling CR/CSR space > The invalid argument seems to be irq vector 00, but I don't know where > to put which value. I suspect your device tree may be wrong and PCI isn't being setup/scanned correctly. > And after that, it would be nice the have a few > code snippets to see how to read/write vme. The vme_user module will provide some dev files to access up to 4 slave and 4 master windows. There is currently an IOCTL interface to configure each window from it's device file (you'll have to see "drivers/staging/vme/devices/vme_user.c" in the kernel source code for more information, it's not well documented at the moment). If you wish/need to use the in-kernel API, that's documented in the file you found and additionally there is the "vme_user" and "vme_pio2" drivers in "drivers/staging/vme/devices/" as examples. > > Thanks in advance, > No problem, hope that helps, Martyn -- Martyn Welch (Lead Software Engineer) | Registered in England and Wales GE Intelligent Platforms | (3828642) at 100 Barbirolli Square T +44(0)1327322748 | Manchester, M2 3AB E martyn.welch@xxxxxx | VAT:GB 927559189 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel