Project

General

Profile

Load FPGA from Linux to MitySOM-5CSX-H6-4YA

Added by Mathew Jones about 7 years ago

Hi
Having looked at previous posts I was hoping to be able to program our .rbf firmware rbf from Linux but every time I try Linux just hangs.
(previous post was [[https://support.criticallink.com/redmine/boards/47/topics/3961]])

I boot to Linux from SD card, which also loads the FPGA, but then I cannot re-load either the same FPGA rbf file or another without Linux crashing.
My steps are:
"cat /sys/class/fpga/fpga0/status" - shows 'user mode'
Disable all bridges:
"echo 0 > /sys/class/fpga-bridge/fpga2hps/enable"
"echo 0 > /sys/class/fpga-bridge/hps2fpga/enable"
"echo 0 > /sys/class/fpga-bridge/lwhps2fpga/enable"
"cat /sys/class/fpga-bridge/*/enable" - shows 0, 0, 0 indicating that the bridges are disabled.
"cat {fpga_rbf_file} > /dev/fpga0" - causes the FPGA status LED to change from green to yellow, but does not change back to green and also Linux hangs, but does output some errors as shown in the attached file.

It doesn't matter whether the {fpga_rbf_file} is the default rbf from the CriticalLink SD card image, or our FPGA rbf.
The SD Card image we are using is I believe the latest and has minimal changes:
(05-11-2015 [[https://support.criticallink.com/redmine/attachments/download/9459/MitySOM_5CSX_H6_4YA_Dev_Kit_Release_1.zip]])

Is there something else that I'm missing, e.g. another Linux driver also needs disabling before reprogramming the FPGA?
Regards
Mat


Replies (2)

RE: Load FPGA from Linux to MitySOM-5CSX-H6-4YA - Added by Daniel Vincelette about 7 years ago

Hi Matt,

If you're using the default device-tree and kernel then it would have the Altera GPIO and Altera sysid drivers using the FPGA, which would cause the ARM to hang like you're seeing.

If you aren't using PIO/sysid drivers then you can remove those nodes from hps_lw_bus: bus@0ff200000 in device tree. If you do need those drivers and will be reprogramming the FPGA from linux then you would need to change those drivers to modules and rmmod/insmod them when you reprogram the FPGA.

Dan

RE: Load FPGA from Linux to MitySOM-5CSX-H6-4YA - Added by Mathew Jones about 7 years ago

Thanks Dan,
That makes sense - it seems that the kernel does have several Altera drivers built in
(cat /lib/modules/$(uname -r)/modules.builtin | grep -i altera).

We do need the Lightweight bus, but instead of rebuilding the kernel without the Altera driver and loading the modules at Linux boot time, we've decided to load the FPGA image via U-Boot (re-loading from Linux was only intended for frequent development FPGA updates).

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)