[U-Boot] BCH8 support when we do not have ELM h/w engine.

Dear Pekon,
I'm trying to enable the support for BCH8 for platforms that do not have ELM hardware engine. Maybe I'm missing something but my first and quick attempt was applying the following patch:
With this patch I'm able to switch to OMAP_ECC_BCH8_CODE_HW_DETECTION_SW with the nandecc hw bch8 command.
Then I tried to flash a ubi rootfs into the nand, but the kernel can't mount the filesystem, I see messages like that:
[ 3.703582] ecc unrecoverable error [ 3.707244] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry
OTOH, if I flash the rootfs from the kernel (my board sets the ecc to bch8) I don't have any problem, I can mount without problems.
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Thanks in advance, Enric

2013/12/4 Enric Balletbo Serra eballetbo@gmail.com:
Dear Pekon,
I'm trying to enable the support for BCH8 for platforms that do not have ELM hardware engine. Maybe I'm missing something but my first and quick attempt was applying the following patch:
With this patch I'm able to switch to OMAP_ECC_BCH8_CODE_HW_DETECTION_SW with the nandecc hw bch8 command.
Then I tried to flash a ubi rootfs into the nand, but the kernel can't mount the filesystem, I see messages like that:
[ 3.703582] ecc unrecoverable error [ 3.707244] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry
OTOH, if I flash the rootfs from the kernel (my board sets the ecc to bch8) I don't have any problem, I can mount without problems.
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Thanks in advance, Enric
Any clue about this ?

Hi Enric,
Sorry I missed your earlier mail, so din't check this..
From: Enric Balletbo Serra [mailto:eballetbo@gmail.com]
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Yes, there seems to be an mis-match between u-boot and kernel ecc-layout. Give me a day's time, and I'll try to root cause this. However, don't have OMAP3 boards, so I can test this only on other boards.
with regards, pekon

Hi Pekon,
2013/12/10 Gupta, Pekon pekon@ti.com:
Hi Enric,
Sorry I missed your earlier mail, so din't check this..
From: Enric Balletbo Serra [mailto:eballetbo@gmail.com]
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Yes, there seems to be an mis-match between u-boot and kernel ecc-layout. Give me a day's time, and I'll try to root cause this. However, don't have OMAP3 boards, so I can test this only on other boards.
with regards, pekon
If I can help somehow just let me know.
Thanks, Enric

Hi Enric,
From: Enric Balletbo Serra [mailto:eballetbo@gmail.com]
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Yes, there seems to be an mis-match between u-boot and kernel ecc-layout. Give me a day's time, and I'll try to root cause this. However, don't have OMAP3 boards, so I can test this only on other boards.
I have done some fix here. But I hv still not completely tested this for all boot modes. So plz consider this as RFC. And once I'm done, I'll post a formal patch. (attaching the patches here for reference)..
with regards, pekon

Hi Enric,
Hi Pekon,
2013/12/10 Gupta, Pekon pekon@ti.com:
Hi Enric,
Sorry I missed your earlier mail, so din't check this..
From: Enric Balletbo Serra [mailto:eballetbo@gmail.com]
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Yes, there seems to be an mis-match between u-boot and kernel ecc-layout. Give me a day's time, and I'll try to root cause this. However, don't have OMAP3 boards, so I can test this only on other boards.
with regards, pekon
If I can help somehow just let me know.
I have posted the patches to fix this regression between u-boot and kernel. And was expecting if you could test it confirm if this solves regression on your OMAP3 board. http://lists.infradead.org/pipermail/linux-mtd/2014-January/051384.html
You can download the patch from [1] [1] http://lists.infradead.org/pipermail/linux-mtd/2013-December/050944.html
with regards, pekon

Hi Pekon,
2014/1/13 Gupta, Pekon pekon@ti.com:
Hi Enric,
Hi Pekon,
2013/12/10 Gupta, Pekon pekon@ti.com:
Hi Enric,
Sorry I missed your earlier mail, so din't check this..
From: Enric Balletbo Serra [mailto:eballetbo@gmail.com]
I saw that the OOB layout is not the same when I flash the rootfs from the u-boot or from the kernel. For example:
If the rootfs is flashed from the kernel the OOB data is like that:
U-Boot # nand dump.oob 0x680000 Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d ff 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
If the rootfs is flashed for the u-boot the OOB data is like data:
Page 00680000 dump: OOB: ff ff 79 43 68 64 3b 80 b2 46 49 4d 58 2a 6d 52 3f 7d 2a 7f a2 98 70 57 32 30 35 c7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Note that look the same except after byte number 16. In the first case is ff 52 3f 7d 2a 7f a2 98 70 and in the second case is 52 3f 7d 2a 7f a2 98 70
It's possible that something is wrong writting the OOB data ? Any clue ? I'm in the right direction or completely wrong ?
Yes, there seems to be an mis-match between u-boot and kernel ecc-layout. Give me a day's time, and I'll try to root cause this. However, don't have OMAP3 boards, so I can test this only on other boards.
with regards, pekon
If I can help somehow just let me know.
I have posted the patches to fix this regression between u-boot and kernel. And was expecting if you could test it confirm if this solves regression on your OMAP3 board. http://lists.infradead.org/pipermail/linux-mtd/2014-January/051384.html
You can download the patch from [1] [1] http://lists.infradead.org/pipermail/linux-mtd/2013-December/050944.html
with regards, pekon
Thanks for the patches, I tested and worked for me on our OMAP3 based boards, I'll answer the mail that you sent to the linux-omap ML.
Sorry for the delay, cheers,
Enric
participants (2)
-
Enric Balletbo Serra
-
Gupta, Pekon