09-17-2019 01:53 AM
Hello,
we've a custom board using NAND Flash 'Micron MT29F8G08ADADAH4', which is not in the approved list shown in UG908
but the nearly similar MT29F8G08AB is in the list.
I have problems in U-Boot to read correct data from our NAND Flash when it's been written in Linux and vice versa.
We're using PetaLinux and Vivado 2019.1 and ZynqMP.
It seems that U-Boot is using per default on-die ECC and the Kernel HW-ECC.
How can I bring U-Boot to use HW-ECC? In the arasan_nfc.c driver I cannot see any devicetree readings.
I've tried to hard code HW-ECC (by disabling the call to function 'arasan_check_ondie(mtd)' in 'arasan_nand_init()'), but the read errors occours even more...
Here's the relevant part of my devicetree files:
zynqmp.dtsi:
... nand0: nand@ff100000 { compatible = "arasan,nfc-v3p10"; status = "disabled"; reg = <0x0 0xff100000 0x0 0x1000>; clock-names = "clk_sys", "clk_flash"; interrupt-parent = <&gic>; interrupts = <0 14 4>; #address-cells = <1>; #size-cells = <0>; #stream-id-cells = <1>; iommus = <&smmu 0x872>; power-domains = <&zynqmp_firmware 44>; }; ...
pcw.dtsi:
.. &nand0 { status = "okay"; }; ..
system-conf.dtsi:
.. &nand0 { #address-cells = <1>; #size-cells = <1>; }; ..
zynqmp-clk-ccf.dtsi:
.. &nand0 { clocks = <&zynqmp_clk 60>, <&zynqmp_clk 31>; }; ..
system-user.dtsi:
.. &nand0 { nand@0 { reg = <0>; nand-ecc-mode = "hw"; nand-bus-width = <0x8>; nand-on-flash-bbt = "true"; nand-ecc-algo = "bch"; nand-ecc-strength = <4>; nand-ecc-step-size = <528>; nand-ecc-maximize = "true"; nand-is-boot-medium = "true"; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "BOOT1"; reg = <0x0 0x00500000>; }; partition@1 { label = "TEST1"; reg = <0x00A00000 ... ... }; }; };
Thanks for any help!
09-24-2019 01:26 AM
Hi,
does nobody write/read to/from NAND from running U-Boot/Linux?
Also everybody using UBIFS with NAND should have a problem with 2019.1 (especially writing a ubi image in U-Boot and 'ubiattach' from linux)
Regards,
Helmut
11-13-2019 04:18 PM
Arasan NAND driver is not maintained very well. It worked OK wit Micron (On-Die) chips in 2017.3, but then in 2018.2 it was broken. Not sure if they fixed it for 2019.1. I've spent/wasted lots of time on this, see my other posts in here. Basically we opted to use On-Die ECC in both U-boot and the Kernel. Using MIcron MT29F4G08
11-13-2019 10:28 PM
Thanks OttoB to your suggestions!
11-15-2019 02:45 AM
Hi @ottob @hbachmann
We need to use the same ECC for both the u-boot and kernel. It could be either on-die or HW ECC.
From your device tree, it look you have enabled “hw” ECC in case of Linux. You can try changing it to have nand-ecc-mode = "on-die";
In u-boot, the driver reads parameters from NAND device. If the device supports on-die ECC, it is then enabled in the driver too.
I would recommend enabling on-die ecc in linux and see if that helps.
Best Regards
Shabbir
11-15-2019 03:13 AM
Thanks Shabbir for your answer,
to change the devicetree to
nand-ecc-mode = "on-die";
has no influence on arasan linux driver in 2019.1.
I agree that u-boot and linux should use the same ECC mechanism.
Regards,
Helmut
09-24-2020 12:15 PM
We have an identical device on a custom Zynq 7000 board. Were you ever able to solve this issue?
Thanks,
Frank
09-24-2020 12:25 PM
09-24-2020 12:34 PM
09-24-2020 12:52 PM
Just to clarify - The solution was to run on-Die ECC on both u-boot and in Linux