Forum Discussion
Altera_Forum
Honored Contributor
8 years agoBooting Linux from QSPI on SoCKit board
Hi, everyone! I'm trying to boot Linux from QSPI on Terasic SoCKit. I've reproduced steps from 'BootTheArrowSoCKitFromQSPI' document exept building Yocto root filesystem (I got errors while b...
Altera_Forum
Honored Contributor
8 years agoFinally I solve the problem. Many thanks to Terasic support team and Amy Zhou in particular. It turned out that socfpga_cyclone5_sockit.dts file in linux-socfpga folder didn't contain correct definition of QSPI-flash (my SocKit board is equipped with N25Q512A). So I got from Terasic support a correct version of .dts (here I adduce not a whole file, but only QSPI definition):
&qspi { status = "okay"; flash0: n25q512a@0 { # address-cells = <1>; # size-cells = <1>; compatible = "n25q512a"; reg = <0>; /* chip select */ spi-max-frequency = <100000000>; m25p,fast-read; page-size = <256>; block-size = <16>; /* 2^16, 64KB */ read-delay = <4>; /* delay value in read data capture register */ tshsl-ns = <50>; tsd2d-ns = <50>; tchsh-ns = <4>; tslch-ns = <4>; cdns,page-size = <256>; cdns,block-size = <16>; cdns,tshsl-ns = <50>; cdns,tsd2d-ns = <50>; cdns,tchsh-ns = <4>; cdns,tslch-ns = <4>; partition@qspi-boot { /* 8MB for raw data. */ label = "Flash 0 Raw Data"; reg = <0x0 0x800000>; }; partition@qspi-rootfs { /* 56MB for jffs2 data. */ label = "Flash 0 jffs2 Filesystem"; reg = <0x00800000 0x03800000>; }; }; }; I couldn't generate .dts file using sopc2dts command from SoC EDS shell as shown in 'GSRD v13.1 - Booting from QSPI' document on rocketboards.org because of error ("Dont parse..."). To build a preloader-with-qspi-header.img and u-boot.img I used SoC EDS 16.1 under Win 8. As a reference Quartus project a GHRD-project from SoCKit_v.3.0.0_SystemCD Demonstrations\Linux_BSP\Console\GHRD has been used. Under Ubuntu16 I cloned linux-socfpga : git clone https://github.com/altera-opensource/linux-socfpga.git I used linux 4.1 : git checkout socfpga-4.1. Also I installed SoC EDS 16.1 to use it cross-compiler to build a Kernel and a .dtb-file. To build a root filesystem a buildroot was used : git clone git://git.buildroot.net/buildroot. I set Filesystem images-> jffs2 root filesystem - Flash Type - Parallel flash with 64 kb erase size. Finally I flashed preloader-with-qspi-header.img, u-boot.img, socfpga.dtb, zImage and rootfs.jffs2 into QSPI-flash according to 'BootTheArrowSoCKitFromQSPI' document using linux mtd_debug utility. After these steps I can boot Linux from QSPI-flash.