U-boot: ECC error while loading periph.rbf from NAND on Arria10SoC

Hello everybody!

I’m using the Arria10 SoC dev kit and after getting a custom U-Boot and Linux booting successfully from the SD card I’m trying to move to NAND boot.

I’ve followed the instructions from this page: rocketboards.org/foswiki/view/Documentation/A10Gsrd161NandBoot

I’ve also tried to flash the precompiled binaries provided on this site (linux-socfpga-nand-16.1-a10.tar.gz)

Every time u-boot fails early, before I even get the UART output.

Using the JTAG debugger on a custom-built u-boot I found that an ECC error happens while loading the periph.rbf file from NAND:

U-boot then bails out from the FPGA configuration with the following error:

NAND read from offset 774000 failed -5
FPGA: Failed to read data from NAND -5.

Note that the RBF starts at offset 0x720000 so this is not the first page in the file. In particular u-boot manages to parse the mkimage header just fine.

I’ve reflashed and reverified the rbf on the NAND multiple times (using both quartus_hps and flash_programmer.py) without success. I’ve also tried moving the rbf at an other position on NAND with the same result (at the same offset of 0x54000 from the beginning of the file, interestingly).

Finally I’ve attempted to modify the code of u-boot to ignore the ECC error and when I do this the u-boot sequence seems to continue correctly:

U-Boot 2014.10 (Feb 07 2017 - 15:17:18)

CPU   : Altera SOCFPGA Arria 10 Platform
BOARD : Altera SOCFPGA Arria 10 Dev Kit
DRAM:  WARNING: Caches not enabled
128 MiB
FPGA: Early Release Succeeded.
DDRCAL: Success
INFO  : Skip relocation as SDRAM is non secure memory
Reserving 2048 Bytes for IRQ stack at: ffe306e8
DRAM  : 1 GiB
WARNING: Caches not enabled
NAND:  256 MiB
Using default environment

In:    serial
Out:   serial
Err:   serial
Model: SOCFPGA Arria10 Dev Kit
Net:   dwmac.ff800000
Error: dwmac.ff800000 address not set.

Hit any key to stop autoboot:  0
SOCFPGA_ARRIA10 # 

I haven’t attempted to boot Linux yet but at least u-boot seems happy.

Any insight about what’s going on here would be greatly appreciated.

I managed to get Linux booting and it doesn’t report any issues with the NAND, it’s only u-boot complaining.

I’ve added a log message in u-boot every time an ECC error is encountered and it doesn’t look very nice:

ignoring NAND ECC error on page 3818
ignoring NAND ECC error on page 3819
ignoring NAND ECC error on page 3820
ignoring NAND ECC error on page 3821
ignoring NAND ECC error on page 3822
ignoring NAND ECC error on page 3823
FPGA: Early Release Succeeded.
DDRCAL: Success
INFO  : Skip relocation as SDRAM is non secure memory
Reserving 2048 Bytes for IRQ stack at: ffe306e8
DRAM  : 1 GiB
WARNING: Caches not enabled
NAND:  256 MiB
Using default environment

In:    serial
Out:   serial
Err:   serial
Model: SOCFPGA Arria10 Dev Kit
Net:   dwmac.ff800000
Error: dwmac.ff800000 address not set.

Hit any key to stop autoboot:  0
Full Configuration Succeeded.

NAND read: device 0 offset 0x120000, size 0x5f0000
ignoring NAND ECC error on page 2555
ignoring NAND ECC error on page 2556
ignoring NAND ECC error on page 2557
ignoring NAND ECC error on page 2558
ignoring NAND ECC error on page 2559
ignoring NAND ECC error on page 2560
ignoring NAND ECC error on page 2561
ignoring NAND ECC error on page 2562
ignoring NAND ECC error on page 2563
ignoring NAND ECC error on page 2564
ignoring NAND ECC error on page 2565
ignoring NAND ECC error on page 2566
ignoring NAND ECC error on page 2567
ignoring NAND ECC error on page 2568
ignoring NAND ECC error on page 2569
ignoring NAND ECC error on page 2570
ignoring NAND ECC error on page 2571
ignoring NAND ECC error on page 2572
ignoring NAND ECC error on page 2573
[...and so forth, all sectors report an ECC error...]
ignoring NAND ECC error on page 3611
ignoring NAND ECC error on page 3612
ignoring NAND ECC error on page 3613
ignoring NAND ECC error on page 3614
ignoring NAND ECC error on page 3615
 6225920 bytes read: OK

NAND read: device 0 offset 0x100000, size 0x7f00
ignoring NAND ECC error on page 524
ignoring NAND ECC error on page 525
ignoring NAND ECC error on page 526
ignoring NAND ECC error on page 527
 32512 bytes 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 01ff7000, end 01ffffe0 ... 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.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP Fri Oct 28 13:13:53 MYT 2016

Yet everything else seems to work fine, which leads me to believe that they’re spurious errors.