XB+Ubuntu: No Root & Initializing XB without Reboot

Questions and discussions about the Xillybus IP core and drivers

XB+Ubuntu: No Root & Initializing XB without Reboot

Postby Guest »

Hello,

I'm working on a science project with the Xillybus for PCIe.
It's an Altera Stratix IV / Terasic DE4 running under Ubuntu 14.04 LTS.

Principally everything works fine: Reading, writing, the whole communication process. Satisfying as advertised!

I have two questions though:

1. I need root privileges to open or write to the xillybus files.
Is there any way to not need root for that?
Not only development, but also later the user experience would profit highly.

2. When I flash the fpga, I have to reboot the host to use the Xillybus again.
Is there a way to like "reinitialise pcie & xillybus" without rebooting? That would save me an enormous amount of time!

(I tried to unload and reload the kernel modules xillybus_pcie and xillybus_core, but that won't do the trick.)


Thanks and regards
Andreas
Guest
 

Re: XB+Ubuntu: No Root & Initializing XB without Reboot

Postby support »

Hello,
Guest wrote:1. I need root privileges to open or write to the xillybus files.
Is there any way to not need root for that?
Not only development, but also later the user experience would profit highly.


Please take a look at section 2.6 of "Getting started with Xillybus on a Linux host":

http://xillybus.com/downloads/doc/xilly ... _linux.pdf

It describes how to set up a udev file that makes the device files accessible to anyone.

Guest wrote:2. When I flash the fpga, I have to reboot the host to use the Xillybus again.
Is there a way to like "reinitialise pcie & xillybus" without rebooting? That would save me an enormous amount of time!

This is turning into a truly frequently asked question, even though the docs are clear about it (for example, section 3.4 in "Getting started with the FPGA demo bundle for Altera").
The short answer is no. A PC's motherboard is not designed to have PCIe devices disappearing and reapperaing while the system is on, even though the PCIe spec implies it should (hotplugging). It's just something that doesn't happen with "real" PCIe cards.

Hot configuration is sometimes possible, but only on Windows, and by using the "Scan for new hardware" option in the Device Manager. But it's a matter of luck. It may work, and it may cause anything between complete system crashes or what appears to be a bug, but is solved by configuring the FPGA properly.

Anyhow, I don't think this is possible with Linux at all. The thing is that the PCIe device is not accessible at the hardware level if it's reconfigured without rebooting. There is, in theory, a possibility to request a bus rescan (echo 1 > /sys/bus/pci/rescan), but I've never managed to get that working.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus

cron