Unable to program Arria 10 FPGA from HPS Linux

I’m trying to program the FPGA on an Arria 10 SoC Development Kit (DK-SOC-10AS066S-A). However I’m not able to access the /dev/fpga0 device.

I am able to boot into linux on the board and ssh in as root.

I’ve flashed the SD card with sdimage.img from linux-socfpga-sgmiird-16.0-a10-bin.tar.gz.

I’ve transferred the hello world program to the board as “hello.rbf”.

dd if=hello.rbf of=/dev/fpga0 fails with dd: can't open '/dev/fpga0': Operation not permitted.

cat /sys/class/fpga/fpga0/status outputs user mode.

There are no bridges enabled, ls /sys/class/fpga-bridge shows nothing.

The switch and jumper configuration on the board:

SW1: OFF OFF ON ON
SW2: All OFF
SW3: OFF OFF ON ON ON OFF OFF OFF
SW4: All OFF

Jumpers J16 and J17 are shorted.
Jumper J30 is shorted.
Jumper J32 is shorted across 9 and 10.
Jumper J42 is shorted across 9 and 10.

Please let me know if there is any more useful information I can provide.

The instructions here https://rocketboards.org/foswiki/view/Documentation/GSRDProgrammingFPGAArrowSoCKitEdition#FPGA_Configuration_from_Linux suggest stopping the boot at UBoot to prevent UBoot from flashing the fpga.

I’ve attempted to stop the boot there, but the “press any key” prompt happens after it flashes socfpga.rbf to the FPGA. Removing socfpga.rbf from the disk causes UBoot to loop with this output:

U-Boot 2014.10 (May 03 2016 - 09:43:56)

CPU   : Altera SOCFPGA Arria 10 Platform
BOARD : Altera SOCFPGA Arria 10 Dev Kit
DRAM:  WARNING: Caches not enabled
SOCFPGA DWMMC: 0
Error - socfpga.rbf not found within SDMMC
cff_from_mmc_fat: error reading rbf header
INFO  : Skip relocation as SDRAM is non secure memory
Reserving 2048 Bytes for IRQ stack at: ffe2db10
data abort
pc : [<ffe00b1a>]          lr : [<ffe01d4d>]
sp : ffe3bf00  ip : 0000001c     fp : 00000001
r10: ffd02078  r9 : ffe3bf60     r8 : ffe00054
r7 : ffe20b60  r6 : ffe3c000     r5 : 00000000  r4 : ffffd000
r3 : ffcfb000  r2 : 00000002     r1 : 00000001  r0 : 00000001
Flags: nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

Replacing socfpga.rbf with my hello world file does what I expect it to (displays a binary counter on the LEDS), however u-boot does not proceed beyond flashing the FPGA.

Hi jophish,
What is your problem now? It seems that you already replace the original .rbf file with your helloworld rbf file successfully, right?
If you want to continue to boot linux kernel and rootfs. You can type “run mmcload” and “run mmcboot” in u-boot prompt if you are using a SD image.

Hi sanpi,

I’d like to be able to reconfigure the FPGA from Linux.

I think that /dev/fpga is deprecated now, and programming has to be done using device tree overlays. I’ve not found a comprehensive example of doing that.

Joe.

I’ve ran into the same problem and found a solution. Maybe this will help you:

Can you point me to the comprehensive example? I am seeing the same problem.