Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Linux Boot from QSPI fails

Altera_Forum
Honored Contributor II
2,103 Views

Hi everyone,

 

I'm trying to do a system boot from QSPI flash on a custom arria10 board. So far, I have managed to get the fpga image to configure successfully, but am having issues with the Linux side. I am by no means an expert on embedded linux, so if anyone is able to give me any ideas on what is wrong or what I need to fix it would be super helpful. See below for the boot log:

 

[ 0.159880] SMP: Total of 2 processors activated (3188.32 BogoMIPS). 

[ 0.159887] CPU: All CPU(s) started in SVC mode. 

[ 0.160365] devtmpfs: initialized 

[ 0.164547] VFP support v0.3: implementor 41 architecture 3 part 30 variant 4

[ 0.164825] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, mas

[ 0.166184] NET: Registered protocol family 16 

[ 0.166977] DMA: preallocated 256 KiB pool for atomic coherent allocations 

[ 0.170893] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint.

[ 0.170906] hw-breakpoint: maximum watchpoint size is 4 bytes. 

[ 0.211931] vgaarb: loaded 

[ 0.212238] SCSI subsystem initialized 

[ 0.212550] usbcore: registered new interface driver usbfs 

[ 0.212619] usbcore: registered new interface driver hub 

[ 0.212682] usbcore: registered new device driver usb 

[ 0.213056] pps_core: LinuxPPS API ver. 1 registered 

[ 0.213064] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giom>

[ 0.213099] PTP clock support registered 

[ 0.213283] FPGA manager framework 

[ 0.214263] Switched to clocksource timer 

[ 0.245038] NET: Registered protocol family 2 

[ 0.245640] TCP established hash table entries: 4096 (order: 2, 16384 bytes) 

[ 0.245687] TCP bind hash table entries: 4096 (order: 3, 32768 bytes) 

[ 0.245752] TCP: Hash tables configured (established 4096 bind 4096) 

[ 0.245811] UDP hash table entries: 256 (order: 1, 8192 bytes) 

[ 0.245842] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) 

[ 0.246022] NET: Registered protocol family 1 

[ 0.246290] RPC: Registered named UNIX socket transport module. 

[ 0.246300] RPC: Registered udp transport module. 

[ 0.246306] RPC: Registered tcp transport module. 

[ 0.246312] RPC: Registered tcp NFSv4.1 backchannel transport module. 

[ 0.246751] CPU PMU: Failed to parse /sopc@0/pmu0/interrupt-affinity[0] 

[ 0.246790] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 countee

[ 0.247694] futex hash table entries: 512 (order: 3, 32768 bytes) 

[ 0.259317] NFS: Registering the id_resolver key type 

[ 0.259362] Key type id_resolver registered 

[ 0.259369] Key type id_legacy registered 

[ 0.259435] ntfs: driver 2.1.32 [Flags: R/W]. 

[ 0.259752] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc. 

[ 0.260696] io scheduler noop registered (default) 

[ 0.264607] dma-pl330 ffda1000.dma: Loaded driver for PL330 DMAC-341330 

[ 0.264626] dma-pl330 ffda1000.dma: DBUFF-512x8bytes Num_Chans-8 Num_Peri-38

[ 0.269216] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled 

[ 0.270514] console [ttyS0] disabled 

[ 0.270554] ffc02100.serial: ttyS0 at MMIO 0xffc02100 (irq = 28, base_baud =A

[ 0.834733] console [ttyS0] enabled 

[ 0.840026] brd: module loaded 

[ 0.843980] cadence-qspi ff809000.flash: Cadence QSPI NOR flash driver 

[ 0.851488] CAN device driver interface 

[ 0.855949] usbcore: registered new interface driver usb-storage 

[ 0.862316] mousedev: PS/2 mouse device common for all mice 

[ 0.868236] i2c /dev entries driver 

[ 0.872097] watchdog: Invalid min and max timeout values, resetting to 0! 

[ 0.879312] Synopsys Designware Multimedia Card Interface Driver 

[ 0.885533] ledtrig-cpu: registered to indicate activity on CPUs 

[ 0.891713] usbcore: registered new interface driver usbhid 

[ 0.897277] usbhid: USB HID core driver 

[ 0.901458] fpga_manager fpga0: SoCFPGA Arria10 FPGA Manager registered 

[ 0.908682] oprofile: using arm/armv7-ca9 

[ 0.913740] NET: Registered protocol family 10 

[ 0.919030] sit: IPv6 over IPv4 tunneling driver 

[ 0.924290] NET: Registered protocol family 17 

[ 0.928747] NET: Registered protocol family 15 

[ 0.933178] can: controller area network core (rev 20120528 abi 9) 

[ 0.939416] NET: Registered protocol family 29 

[ 0.943851] can: raw protocol (rev 20120528) 

[ 0.948119] can: broadcast manager protocol (rev 20120528 t) 

[ 0.953763] can: netlink gateway (rev 20130117) max_hops=1 

[ 0.959459] 8021q: 802.1Q VLAN Support v1.8 

[ 0.963683] Key type dns_resolver registered 

[ 0.968021] ThumbEE CPU extension supported. 

[ 0.972285] Registering SWP/SWPB emulation handler 

[ 0.978078] of_cfs_init 

[ 0.980583] of_cfs_init: OK 

[ 0.985681] ttyS0 - failed to request DMA 

[ 0.989833] List of all partitions: 

[ 0.993317] 0100 8192 ram0 (driver?) 

[ 0.998085] 0101 8192 ram1 (driver?) 

[ 1.002691] No filesystem could mount root, tried: jffs2 

[ 1.008123] Kernel panic - not syncing: VFS: Unable to mount root fs on unkn)

[ 1.016353] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.22-ltsi-altera #1 

[ 1.023281] Hardware name: Altera SOCFPGA Arria10 

[ 1.027998] [<c0018aa8>] (unwind_backtrace) from [<c0013ad4>] (show_stack+0x)

[ 1.035715] [<c0013ad4>] (show_stack) from [<c059a8a0>] (dump_stack+0x8c/0xa)

[ 1.042911] [<c059a8a0>] (dump_stack) from [<c0598664>] (panic+0xac/0x204) 

[ 1.049768] [<c0598664>] (panic) from [<c07b8404>] (mount_block_root+0x254/0)

[ 1.057225] [<c07b8404>] (mount_block_root) from [<c07b861c>] (mount_root+0x)

[ 1.065112] [<c07b861c>] (mount_root) from [<c07b879c>] (prepare_namespace+0)

[ 1.073085] [<c07b879c>] (prepare_namespace) from [<c07b7f1c>] (kernel_init_)

[ 1.081928] [<c07b7f1c>] (kernel_init_freeable) from [<c0597348>] (kernel_in)

[ 1.090075] [<c0597348>] (kernel_init) from [<c000fae8>] (ret_from_fork+0x14)

[ 1.097613] CPU1: stopping 

[ 1.100315] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.22-ltsi-altera #1 

[ 1.107242] Hardware name: Altera SOCFPGA Arria10 

[ 1.111938] [<c0018aa8>] (unwind_backtrace) from [<c0013ad4>] (show_stack+0x)

[ 1.119653] [<c0013ad4>] (show_stack) from [<c059a8a0>] (dump_stack+0x8c/0xa)

[ 1.126847] [<c059a8a0>] (dump_stack) from [<c001715c>] (handle_IPI+0x294/0x)

[ 1.134215] [<c001715c>] (handle_IPI) from [<c00094b4>] (gic_handle_irq+0x68)

[ 1.141753] [<c00094b4>] (gic_handle_irq) from [<c0014680>] (__irq_svc+0x40/)

[ 1.149200] Exception stack(0xdf507f60 to 0xdf507fa8) 

[ 1.154233] 7f60: 00000000 00000000 000002b4 c00227c0 df506000 c082249c 10c00

[ 1.162376] 7f80: c0822450 c05a19c8 00000000 df507fb4 df507fb8 df507fa8 c001c

[ 1.170514] 7fa0: 60000113 ffffffff 

[ 1.173992] [<c0014680>] (__irq_svc) from [<c00105dc>] (arch_cpu_idle+0x48/0)

[ 1.181366] [<c00105dc>] (arch_cpu_idle) from [<c005ea38>] (cpu_startup_entr)

[ 1.189599] [<c005ea38>] (cpu_startup_entry) from [<c0016c54>] (secondary_st)

[ 1.198606] [<c0016c54>] (secondary_start_kernel) from [<0000954c>] (0x954c) 

[ 1.205629] ---[ end Kernel panic - not syncing: VFS: Unable to mount root f)

 

I'm using the 16.1 QSPI boot gsrd as reference: https://rocketboards.org/foswiki/Doc...srd161QspiBoot. For the linux side, I am using the precompiled versions of the kernel and root filesystem. I have regenerated a linux dtb based on the sopcinfo of my fpga design. However, I used the gsrd xml files. Those are specific to the devkit, but I figured if something wasn't present in the hardware, it would just be skipped given that there's information about the SD card and NAND flash layout in there. The layout and location of the rootfs are in those xml files and the flash layout I created is identical to the gsrd. The difference is the files inside, so if anyone can point me in the right direction it would be greatly appreciated.

 

Thanks,

Bogg

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
1,102 Views

In case it helps, I'll port the initial part of the boot log. I had to split it to fit in a post.  

 

--- Quote Start ---  

Hit any key to stop autoboot: 0  

SF: Read data capture delay calibrated to 3 (0 - 6)  

SF: Detected N25Q1024 with page size 256 Bytes, erase size 4 KiB, total 128 MiB  

Full Configuration Succeeded.  

SF: Detected N25Q1024 with page size 256 Bytes, erase size 4 KiB, total 128 MiB  

SF: 6225920 bytes @ 0x120000 Read: OK  

SF: 32512 bytes @ 0x100000 Read: OK  

FPGA BRIDGES: enable  

Kernel image @ 0x008000 [ 0x000000 - 0x3dd2d0 ]  

# # Flattened Device Tree blob at 00000100  

Booting using the fdt blob at 0x000100  

Loading Device Tree to 01ff8000, end 01fffbd3 ... OK  

 

Starting kernel ...  

 

[ 0.000000] Booting Linux on physical CPU 0x0  

[ 0.000000] Initializing cgroup subsys cpuset  

[ 0.000000] Linux version 4.1.22-ltsi-altera (esv@eswdmz3) (gcc version 5.2.6 

[ 0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d  

[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructie 

[ 0.000000] Machine model: Altera SOCFPGA Arria 10  

[ 0.000000] Memory policy: Data cache writealloc  

[ 0.000000] PERCPU: Embedded 12 pages/cpu @dfbd1000 s19648 r8192 d21312 u4912 

[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pa8 

[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 rw2 

[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)  

[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)  

[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)  

[ 0.000000] Memory: 510732K/524288K available (6217K kernel code, 427K rwdat) 

[ 0.000000] Virtual kernel memory layout:  

[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB )  

[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB )  

[ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB )  

[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB )  

[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB )  

[ 0.000000] .text : 0xc0008000 - 0xc07b6904 (7867 kB )  

[ 0.000000] .init : 0xc07b7000 - 0xc0820000 ( 420 kB )  

[ 0.000000] .data : 0xc0820000 - 0xc088adb8 ( 428 kB )  

[ 0.000000] .bss : 0xc088adb8 - 0xc08ac610 ( 135 kB )  

[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1  

[ 0.000000] Hierarchical RCU implementation.  

[ 0.000000] Additional per-CPU info printed with stalls.  

[ 0.000000] NR_IRQS:16 nr_irqs:16 16  

[ 0.000000] L2C: platform modifies aux control register: 0x72160001 -> 0x7251 

[ 0.000000] L2C: platform provided aux values permit register corruption.  

[ 0.000000] L2C: DT/platform modifies aux control register: 0x72160001 -> 0x1 

[ 0.000000] L2C-310 erratum 769419 enabled  

[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9  

[ 0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9 

[ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines  

[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled  

[ 0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB  

[ 0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x76560001  

[ 0.000000] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, max_s 

[ 0.000006] sched_clock: 32 bits at 100MHz, resolution 9ns, wraps every 2147s 

[ 0.000324] Console: colour dummy device 80x30  

[ 0.000345] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)  

[ 0.089800] pid_max: default: 32768 minimum: 301  

[ 0.089909] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)  

[ 0.089920] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)  

[ 0.090502] CPU: Testing write buffer coherency: ok  

[ 0.090533] ftrace: allocating 20733 entries in 61 pages  

[ 0.122682] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000  

[ 0.122901] Setting up static identity map for 0x8280 - 0x82d8  

[ 0.159789] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001  

[ 0.159865] Brought up 2 CPUs  

--- Quote End ---  

 

 

What really sticks out to me is that the flash is not fully recognised/calibrated, when compared to the devkit which boots successfully. 

 

 

--- Quote Start ---  

 

SF: Detected n25q1024 with page size 256 Bytes, erase size 4 KiB, total 128 MiB  

[ 0.843980] cadence-qspi ff809000.flash: Cadence QSPI NOR flash driver  

[ 0.989833] List of all partitions:  

[ 0.993317] 0100 8192 ram0 (driver?)  

[ 0.998085] 0101 8192 ram1 (driver?)  

[ 1.002691] No filesystem could mount root, tried: jffs2  

[ 1.008123] Kernel panic - not syncing: VFS: Unable to mount root fs on unkn) 

--- Quote End ---  

 

 

 

--- Quote Start ---  

 

SF: Detected n25q1024a with page size 256 Bytes, erase size 4 KiB, total 128 MiB 

[ 0.882094] cadence-qspi ff809000.flash: Read data capture delay for 50000000 baud calibrated to 1 (0 - 2) 

[ 0.891737] cadence-qspi ff809000.flash: n25q00aa (131072 Kbytes) 

[ 0.897936] 2 ofpart partitions found on MTD device ff809000.flash 

[ 0.904098] Creating 2 MTD partitions on "ff809000.flash": 

[ 0.909559] 0x000000000000-0x000003020000 : "Boot and FPGA data" 

[ 0.916108] 0x000003020000-0x000008000000 : "Root Filesystem - JFFS2" 

[ 0.923013] cadence-qspi ff809000.flash: Cadence QSPI NOR flash driver 

--- Quote End ---  

0 Kudos
Reply