at91sam9260 atmel_nand u-boot multiple ecc-errors

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

mmanzel
Posts: 17
Joined: Mon May 25, 2020 10:42 am

at91sam9260 atmel_nand u-boot multiple ecc-errors

Mon May 25, 2020 12:09 pm

We use a hardware based on the at91sam9260ek. Now we have to update the NAND because it is discontiuned.
So I took the last buildroot and started to update the complete chain: bootstrap (3.8.10), u-boot (2016.09.01), linux (4.8.6).

I can write to the nand with sam-ba. Read back and comparison is without error.

I had to change the bootstrap to On-Die-Ecc and to give the new NAND (Micron MT29F2G08ABAGAWP). It works now and boots u-boot.

If I write the linux image with sam-ba the chain works. But if I want to update the image from user-space in linux using nandwrite
then u-boot does not boot the image anymore, because of crc-errors. (The mtd-partitions are ok.)

I changed u-boot to hardware-ecc. The same I did in the dts-file for linux. Now a image written from linux boots, but I get hundrets of:
"atmel_nand : multiple errors detected. Unable to correct."

Despite these messages the kernel boots correctly.

I tryed all combinations of hw/soft ecc. Only hw-ecc seems to work but with these messages I can not go to production.
Does someone know the solution for my problem?
blue_z
Location: USA
Posts: 2154
Joined: Thu Apr 19, 2007 10:15 pm

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Wed May 27, 2020 12:49 am

What is the minimum ECC correction capability required by your new NAND chip?
How did you satisfy that requirement when you "tryed [sic] all combinations of hw/soft ecc"?

To be clear: you are reporting that these "hundrets [sic] of" messages are output by U-Boot before the kernel ever starts executing?

BTW your title is misleading.
Multiple bit errors (detected by ECC) are not "ecc-errors".


Regards
mmanzel
Posts: 17
Joined: Mon May 25, 2020 10:42 am

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Wed May 27, 2020 11:14 am

Dear blue_z,

1. minimum ECC correction capability : I could not attach the data sheet. They state:
Minimum ECC with internal ECC enabled: 8-bit ECC per 528 bytes (user data) + 16 bytes (parity data)

2. I did not find so much to confgiure.
In u-boot I could define (or not define) CONFIG_ATMEL_NAND_HWECC
In the linux dev.tree in the nand-section I could switch between soft/hw

3. Yes, it comes from u-boot, when it takes the image out of the NAND to copy it into RAM.
After that the kernel starts. So its crc and the crc of the rootfs are ok.

4. I looks like there are no real bit errors. I seems to be a problem in the ecc calculation.

Thank you
Marco
blue_z
Location: USA
Posts: 2154
Joined: Thu Apr 19, 2007 10:15 pm

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Thu May 28, 2020 2:51 am

mmanzel wrote: Minimum ECC with internal ECC enabled: 8-bit ECC per 528 bytes (user data) + 16 bytes (parity data)
The wording is awkward, so you're looking at the incorrect specification. You reported the the capability of the chip's built-in logic (aka on-die ECC which can be enabled).
The salient number (that you need to be cognizant of) is the minimum required number of bits that ECC must be capable of correcting, which happens to be specified as "8 bits per 544 bytes of data".

The AT91SAM9260 has ECC hardware that has single-bit correction capability.
This single-bit correction capability does not satisfy an 8-bit correction requirement.
Therefore "hardware ECC" (i.e. using the SoC's ECC controller) is not a viable solution for any stage of booting, should have been ruled out and never tested.

So you are left with the choice of either using the NAND chip's internal ECC processing or performing software ECC processing by the ARM core.

Regards
mmanzel
Posts: 17
Joined: Mon May 25, 2020 10:42 am

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Thu May 28, 2020 8:28 am

Dear blue_z,

1. I tryed the software ECC: when I update the image from linux, using nandwrite, then u-boot reports an crc error in the image and doesn't
boot it. I can write the same image with sam-ba and it boots without any problem.

2. So I'm left with the choice of using the NAND chip's internal ECC processing. The bootstrap loader offers this option (On-Die-Ecc),
but I couldn't find that option neither in u-boot nor for the linux driver. In the bootstrap loader I use this option and it works fine.
How can I use it with u-boot and linux?

Thank you
Marco
blue_z
Location: USA
Posts: 2154
Joined: Thu Apr 19, 2007 10:15 pm

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Fri May 29, 2020 1:12 am

mmanzel wrote: 1. I tryed the software ECC: when I update the image from linux, using nandwrite, then u-boot reports an crc error in the image and doesn't boot it.
ECC and CRC are two different things.
Your summation lacks details, so I really don't know what kind problem is actually occurring.
mmanzel wrote: I can write the same image with sam-ba and it boots without any problem.
That indicates you are overlooking the ECC methods of the installer (writer) and the consumer (reader).
If someone wrote a message in Cyrillic, you cannot expect to read it as a Korean (or any other language/alphabet) message.
Likewise writing and then reading NAND pages with ECC has to use (a) the same code algorithm (e.g. Hamming or BCH), (b) the same code length (which reflects the correction capability), (c) the same storage offset in the out-of-band area of the NAND page, and I don't know what else.

If you are going to boot the Linux kernel image with software ECC, then you have to (1) install a U-Boot (i.e. the reader during boot) that uses software ECC, and (2) install (i.e. the write) that kernel image in NAND using software ECC.
And that software ECC has to be configured identically on both sides for the same algorithm, correction capability, OOB offset, etc.

mmanzel wrote: 2. So I'm left with the choice of using the NAND chip's internal ECC processing. The bootstrap loader offers this option (On-Die-Ecc),
but I couldn't find that option neither in u-boot nor for the linux driver. In the bootstrap loader I use this option and it works fine.
How can I use it with u-boot and linux?
Support for on-die ECC seems to be up in the air.
There was a kernel patch proposed in 2015, but you will have to search for its current status.
The patch starts here.

Regards
mmanzel
Posts: 17
Joined: Mon May 25, 2020 10:42 am

Re: at91sam9260 atmel_nand u-boot multiple ecc-errors

Fri May 29, 2020 12:59 pm

1. After reading the linux image out of the NAND U-boot checks the crc of the image.
If I configure both, u-boot and linux to soft-ecc and write the image from linux with nandwrite then u-boot detect such an crc error.
Which detail do you miss?

Cyrillic: I told you, that I tryed to configure BOTH as soft-ecc or hw-ecc. Even I did understand that both should do the same.
If you looked into the configuration of linux and u-boot you would see, that there are not so much option to set-up.
That's why I asked you where and how I should set it up to get both really doing the same thing.

2.on-die-ecc: sorry, but your answer does not really help.

Thank you
Marco

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 4 guests