UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
623 Views
Registered: ‎05-03-2012

NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

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.

Supported.flash.memory.devices.xilinx.png

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!

0 Kudos
5 Replies
Adventurer
Adventurer
556 Views
Registered: ‎05-03-2012

Re: NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

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

0 Kudos
Adventurer
Adventurer
410 Views
Registered: ‎05-26-2017

Re: NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

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

0 Kudos
Adventurer
Adventurer
389 Views
Registered: ‎05-03-2012

Re: NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

Thanks OttoB to your suggestions!

 

0 Kudos
Moderator
Moderator
360 Views
Registered: ‎12-04-2016

Re: NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

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

0 Kudos
Adventurer
Adventurer
354 Views
Registered: ‎05-03-2012

Re: NAND Flash: U-Boot is using on-die ECC instead of HW-ECC

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

0 Kudos