AR# 68831

Zynq UltraScale+ MPSoC: 2016.4 u-boot fails to write ondie-ECC NAND


Zynq UltraScale+ is capable of booting from ondie-ECC NAND all the way to u-boot.

Writing the same ondie-ECC NAND in u-boot, generates an error:

ZynqMP> nand erase ${bootstart} ${bootsize} && nand write ${clobstart} ${bootstart} ${bootsize}
NAND erase: device 0 offset 0x0, size 0x200000
Erasing at 0x1e0000 -- 100% complete.
NAND write: device 0 offset 0x0, size 0x200000
NAND write to offset 0 failed -5
0 bytes written: ERROR


The issue is that the u-boot driver does not handle the ondie-ECC NAND, just the HWECC (managed by the NAND controller in Zynq UltraScale+).

To work around this issue, you will need to modify the FSBL to disable ondie-ECC before handing-off to u-boot.

Below is a simple register write sequence that can be used in XFsbl_HookBeforeHandoff():

Xil_Out32(0xFF100014, 0x0);
Xil_Out32(0xFF100014, 0x1);
Xil_Out32(0xFF10000C, 0x110000EF);
Xil_Out32(0xFF100004, 0x90);
Xil_Out32(0xFF100008, 0x06000000);
Xil_Out32(0xFF100000, 0x1004);
Xil_Out32(0xFF100010, 0x400);
Xil_Out32(0xFF100030, 0x0);

Note: u-boot 2017.2 and later version supports ondie-ECC NAND.

AR# 68831
Date 05/02/2018
Status Active
Type General Article