FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5930 Discussions

Boot cyclone V soc from NAND-flash

Sergey81
Novice
1,331 Views

Hi, everybody!

I'm working with a SOM board (http://inmys.ru/products/som-cyclone-v-se) which has a QSPI-flash and a NAND-flash. I have no problems with booting from QSPI (I generated preloader_mkpimage.img, socfpga.dtb,u-boot.img,zImage, rootfs.jffs2 using different tools and programmed QSPI according to map shown in https://rocketboards.org/foswiki/Documentation/GSRD131QspiBoot). The problem is that HPS can't be rebooted using reboot command (from Linux command line) or by watchdog because QSPI must be reset when CPU is rebooting (see https://rocketboards.org/foswiki/Documentation/SocBoardQspiBoot), but there is no QSPI reset signal on the board...

Now I'm trying to program NAND-flash and boot Linux from it. After booting from SD-card I can see NAND partitions using command cat /proc/mtd, also nandtest -m /dev/mtdX command works normally. However, it's not clear what memory map to use for NAND. Is memory map for NAND from "Booting from NAND flash" - https://rocketboards.org/foswiki/Documentation/A10GsrdNandBootLTS#6 valid for Cyclone V? If so, how to generate 4x Uboot&U-Boot Device Tree Images? In cv_5400a (https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cyclone-v/cv_5400a.pdf) it is only said that preloader images are located in the first 4 blocks of the device.

By now  I've made several attempts to write files in NAND in different ways, but every time nothing at all happens.

I would be grateful if anyone clarifies NAND programming procedure (files generation, NAND address map, etc).

0 Kudos
2 Replies
EBERLAZARE_I_Intel
1,235 Views

Hi,

Firstly, you may need to check the supported flash devices below:

https://www.intel.com/content/www/us/en/programmable/support/support-resources/supported-flash-devices-for-cyclone-v-and-arria-v-soc.html

Secondly, we do not have a design for Cyclone V SoC, but you may refer to how to do on the Arria 10 SoC:

https://rocketboards.org/foswiki/Documentation/BuildingBootloader#Arria_10_SoC_45_Boot_from_NAND

 

0 Kudos
Sergey81
Novice
1,156 Views

As for problem with Linux reboot or warm reset while boot from QSPI there is a workaround. We can boot preloader from FPGA as shown in Boot From FPGA v16.1 - Arrow SoCKit Edition (https://rocketboards.org/foswiki/Documentation/BootFromFPGA161ArrowSoCKitEdition). 

What we need for this are EPCQ chip on board and enough M10K spare blocks in CycloneV chip (64 blocks are needed to keep preloader.hex file). In Boot From FPGA v16.1 example they boot uboot,kernel and rootfs from SD card, however we only need to set BOOT_FROM_QSPI in bsp-editor, change "#define CONFIG_BOOTCOMMAND"run callscript; rum mmcload; run mmcboot" to "#define CONFIG_BOOTCOMMAND "run qspiload; run qspiboot" in software/spl_bsp/uboot-socfpga/include/configs/socfpga_common.h file and add QSPI description to .dtb-file if needed. Don't foreget to regenerate preloader in bsp-editor and compile it.

0 Kudos
Reply