Swapping PL while Xillinux is running

Questions and discussions about the Xillybus IP core and drivers

Swapping PL while Xillinux is running

Postby Luis »

Hi all,

I'm a beginner in the use of these systems. I have a zedboard and I'm currently using xillinux.

I have succesfully followed the instructions of the tutorial (SD with boot.bin, s.o. image, devicetree.dtb and xillydemo.bit). I have created a webserver on Linux and I'm using the fifo to test the system with a little eco example and it actually works.

I want to change the PL while the system is running so I'm trying to swap the /dev/xdevcfg with another .bit with the new logic. Here is my problem now: I don't know if it is possible

I have tried many options and none of them have worked. (I'm using vivado and sdk to generate the new .bit and to change this format to .bit.bin with bootgen). I have read in the xillinx website that I need a .bif image. This one contains this: "bootloader]<fsbl_name>.elf / <pl_bitstream_name>.bit / <u-boot_name>.elf" and generates the .bin.bit. file. Anyway when I do cat xxxx.bit.bin > /dev/xdevcfg the PS stops working.

My new logic is simple and doesn't require extra modules. Do I need to change anything else apart from .bit?

I apologize in advance if there is already a similar topic but I haven't found a solution yet. I will really apreciate any kind of help.



Regards,
Luis
Luis
 
Posts: 2
Joined:

Re: Swapping PL while Xillinux is running

Postby support »

Hello,

Reconfiguration of the PL part is in theory supported by Xilinx, but I haven't yet heard about anyone who has been able to do this in a stable and repeatable manner. I suggest asking about this in Xilinx' forum.

The inherent problem is that the PL part interacts with the processor via the AXI bus. If the PL is reconfigured while a bus transaction is requested from the PL part, or it was in the middle of any such transaction, basically anything can happen. Most likely, the CPU will hang.

So in order to make such reconfiguration safely, the OS must guarantee that no attempts to access the addresses mapped to the PL's AXI interface will take place, and that the logic in the PL will not initiate such transaction. On a Xillinux distribution, this involves, among others, turning off the VGA screen.

I would therefore anticipate that it's not a simple task to ensure such a quiescent state of the hardware. Rebooting Linux with a new bitstream is by far simpler, and can be done quite quickly, even relative to a "hot" reconfiguration.

Maybe someone has set up a reliable Linux / PL reconfiguration kit. Xillinux isn't necessarily a good starting point for this, I suppose.

Regards,
Eli
support
 
Posts: 802
Joined:

Re: Swapping PL while Xillinux is running

Postby Luis »

Hello Eli,

First of all, thank you very much for your help. I still have a question and hope you can help me.

My goal now is make the zedboard to be totally independent. How could I change the PL rebooting Linux without losing Linux configuration or the files I already have in it?

I'm currently using the zedboard with the SD. How could I reboot it and change the PL without connecting it to the PC? I'm not sure if it is actually possible.

Could you please recommend me a good starting point or am I already on my way to achieve my goal?

I really appreciate your help. Thank you very much.

Regards,
Luis.
Luis
 
Posts: 2
Joined:

Re: Swapping PL while Xillinux is running

Postby support »

Hello,

The Zedboard can change the bitfile it will load on the next boot quite easily. This is described in section 3.7 of the "Getting started with Xillinux for Zynq-7000 EPP" guide ("Copying the files into the boot partition"):

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

The idea is quite simple: The bitfile is xillydemo.bit, so the Linux system can mount the first partition on SD board (/dev/mmcblk0p1) and write another file instead. And then reboot with e.g. "shutdown -r now". It's as simple as that.

If it's necessary to protect against a sudden power outage while the file is replaced, it's possible to write the new file with a different name, and then replace it with a "mv" command. If that isn't safe enough, use U-boot scripting to attempt booting from one file, and if that fails, load a fallback file. There are a lot of possibilities. Actually, even to load the bitfile from Linux' root partition. That's all down to scripting of the U-boot commands, if the board's boot must be failsafe.

But if you just want to work with the Zedboard without a PC around, mounting the first partition is really good enough.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus

cron