UBIFS/U-Boot and UBIFS/Linux not compatible

2,636 views
Skip to first unread message

matti.k...@gmail.com

unread,
Oct 24, 2013, 6:23:24 AM10/24/13
to beagl...@googlegroups.com

Hi!

I am working on BeagleBone variant board using Ångström distribution.  Main difference is that NAND flash is installed on board. In fact my set-up sounds pretty much same as in "NAND flash with BeagleBone variant" case.

Short story:

UBIFS partition/volume formatted/created in Linux does not work in U-Boot. UBI part command in U-boot fails. Later on Linux finds this UBIFS corrupted. I don't have any problems if this UBIFS is accessed purely from Linux. I have made NAND flash additions from am335x-evm.dts to BeagleBone device tree. I have tried with ti,nand-ecc-opt = "bch8" (with kernel options CONFIG_MTD_NAND_OMAP_BCH and
OMAP_ECC_BCH8_CODE_HW) and without. In the latter case those kernel options were not active.

Longer story = operations and results:

======================================
BOOT => Linux

root@beaglebone:~# cat /proc/mtd
ddev:    size   erasesize  name
mtd0: 00020000 00020000 "SPL1"
mtd1: 00020000 00020000 "SPL2"
mtd2: 00020000 00020000 "SPL3"
mtd3: 00020000 00020000 "SPL4"
mtd4: 001e0000 00020000 "U-boot"
mtd5: 00020000 00020000 "environment"
mtd6: 00500000 00020000 "Kernel"
mtd7: 0f880000 00020000 "File-System"


root@beaglebone:~# mtdinfo /dev/mtd7
mtd7
Name:                           File-System
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1988 (260571136 bytes, 248.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:14
Bad blocks are allowed:         true
Device is writable:             true


root@beaglebone:~# ubiformat /dev/mtd7
ubiformat: mtd7 (nand), size 260571136 bytes (248.5 MiB), 1988 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 1987 -- 100 % complete
ubiformat: 1980 eraseblocks have valid erase counter, mean value is 2
ubiformat: 8 bad eraseblocks found, numbers: 70, 281, 310, 964, 1590, 1900, 1920, 1977
ubiformat: formatting eraseblock 1987 -- 100 % complete


root@beaglebone:~# ubiattach -m 7
[  615.304815] UBI: default fastmap pool size: 95
[  615.309712] UBI: default fastmap WL pool size: 25
[  615.314727] UBI: attaching mtd7 to ubi0
[  616.065041] UBI: scanning is finished
[  616.092241] UBI: attached mtd7 (name "File-System", size 248 MiB) to ubi0
[  616.099551] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[  616.106760] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[  616.113780] UBI: VID header offset: 512 (aligned 512), data offset: 2048
[  616.120891] UBI: good PEBs: 1980, bad PEBs: 8, corrupted PEBs: 0
[  616.127267] UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
[  616.134839] UBI: max/mean erase counter: 4/3, WL threshold: 4096, image sequence number: 1266322069
[  616.144425] UBI: available PEBs: 1942, total reserved PEBs: 38, PEBs reserved for bad PEB handling: 32
[  616.154993] UBI: background thread "ubi_bgt0d" started, PID 266
UBI device number 0, total 1980 LEBs (255467520 bytes, 243.6 MiB), available 1942 LEBs (250564608 bytes, 239.0 MiB), LEB size 129024 bytes (126.0 KiB)

root@beaglebone:~# ubimkvol /dev/ubi0 -N rootfs -m
Set volume size to 250564608
Volume ID 0, size 1942 LEBs (250564608 bytes, 239.0 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs", alignment 1

root@beaglebone:~# mkdir /mnt/rootfs

root@beaglebone:~# mount -t ubifs ubi0:rootfs /mnt/rootfs
[ 1246.100061] UBIFS: default file-system created
[ 1246.129559] UBIFS: background thread "ubifs_bgt0_0" started, PID 279
[ 1246.181635] UBIFS: mounted UBI device 0, volume 0, name "rootfs"(null)
[ 1246.188687] UBIFS: LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 1246.198379] UBIFS: FS size: 248887296 bytes (237 MiB, 1929 LEBs), journal size 12515328 bytes (11 MiB, 97 LEBs)
[ 1246.209066] UBIFS: reserved for root: 4952683 bytes (4836 KiB)
[ 1246.215270] UBIFS: media format: w4/r0 (latest is w4/r0), UUID BBB7B485-B786-43D4-9EF7-F237AF6C707B, small LPT model

root@beaglebone:~# cd /mnt/rootfs
root@beaglebone:/mnt/rootfs# mkdir testdir
root@beaglebone:/mnt/rootfs# cd testdir
root@beaglebone:/mnt/rootfs/testdir# echo testdata > testfile.txt
root@beaglebone:/mnt/rootfs/testdir# cat testfile.txt
testdata


root@beaglebone:/mnt/rootfs/testdir# sync
root@beaglebone:/mnt/rootfs/testdir# cd
root@beaglebone:~# umount /mnt/rootfs
[ 1774.802970] UBIFS: un-mount UBI device 0, volume 0
[ 1774.812940] UBIFS: background thread "ubifs_bgt0_0" stops
root@beaglebone:~# shutdown -h now  


======================================
BOOT => U-Boot



U-Boot# mtdparts

device nand0 <omap2-nand.0>, # parts = 8
 #: name                size            offset          mask_flags
 0: SPL                 0x00020000      0x00000000      0
 1: SPL.backup1         0x00020000      0x00020000      0
 2: SPL.backup2         0x00020000      0x00040000      0
 3: SPL.backup3         0x00020000      0x00060000      0
 4: u-boot              0x001e0000      0x00080000      0
 5: u-boot-env          0x00020000      0x00260000      0
 6: kernel              0x00500000      0x00280000      0
 7: rootfs              0x0f880000      0x00780000      0

active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

defaults:
mtdids  : nand0=omap2-nand.0
mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)


U-Boot# ubi part rootfs
...... looooong list of following two lines
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 1975:512, read 512 bytes
ECC: uncorrectable.

......then quite menay of following lines
ECC: uncorrectable.
ECC: uncorrectable.
ECC: uncorrectable.
ECC: uncorrectable.

...... then rest of messages
UBI error: ubi_io_read: error -74 while reading 129024 bytes from PEB 518:2048, read 129024 bytes
UBI warning: ubi_eba_copy_leb: error -74 while reading data from PEB 518
UBI error: wear_leveling_worker: error -74 while moving PEB 518 to PEB 1
UBI warning: ubi_ro_mode: switch to read-only mode
UBI error: do_work: work failed with error code -74
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=7"
UBI: MTD device size:            248 MiB
UBI: number of good PEBs:        1980
UBI: number of bad PEBs:         8
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             15
UBI: total number of reserved PEBs: 1965
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 6/3
U-Boot#


======================================
BOOT => Linux

ubiattach -m t

=>
.... exhaustive list of following blocks:
[  184.135917] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 268:0, read only 64 bytes, retry
[  184.148291] uncorrectable error :
[  184.151767] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 268:0, read only 64 bytes, retry
[  184.163943] uncorrectable error :
[  184.167396] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 268:0, read only 64 bytes, retry
[  184.179564] uncorrectable error :
[  184.183016] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 268:0, read 64 bytes
[  184.193837] [<c001051d>] (unwind_backtrace+0x1/0x8c) from [<c022ca67>] (ubi_io_read+0x14f/0x1ec)
[  184.203171] [<c022ca67>] (ubi_io_read+0x14f/0x1ec) from [<c022cc73>] (ubi_io_read_ec_hdr+0x47/0x12c)
[  184.212870] [<c022cc73>] (ubi_io_read_ec_hdr+0x47/0x12c) from [<c022fc3b>] (scan_peb.part.4+0x1b/0x408)
[  184.222843] [<c022fc3b>] (scan_peb.part.4+0x1b/0x408) from [<c0230095>] (scan_all+0x6d/0x73c)
[  184.231895] [<c0230095>] (scan_all+0x6d/0x73c) from [<c0230a45>] (ubi_attach+0x169/0x244)
[  184.240591] [<c0230a45>] (ubi_attach+0x169/0x244) from [<c0229373>] (ubi_attach_mtd_dev+0x4ff/0x980)
[  184.250291] [<c0229373>] (ubi_attach_mtd_dev+0x4ff/0x980) from [<c0229997>] (ctrl_cdev_ioctl+0x7f/0x104)
[  184.260357] [<c0229997>] (ctrl_cdev_ioctl+0x7f/0x104) from [<c009d6b1>] (vfs_ioctl+0x15/0x20)
[  184.269412] [<c009d6b1>] (vfs_ioctl+0x15/0x20) from [<c009de57>] (do_vfs_ioctl+0x3ad/0x3e2)
[  184.278281] [<c009de57>] (do_vfs_ioctl+0x3ad/0x3e2) from [<c009debd>] (sys_ioctl+0x31/0x4c)
[  184.287157] [<c009debd>] (sys_ioctl+0x31/0x4c) from [<c000c641>] (ret_fast_syscall+0x1/0x46)
[  184.296279] uncorrectable error :
[  184.299721] uncorrectable error : [  184.303366] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 268:512, read only 512 bytes, retry
[  184.315740] uncorrectable error :
[  184.319180] uncorrectable error : [  184.322821] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 268:512, read only 512 bytes, retry
[  184.335193] uncorrectable error :
[  184.338631] uncorrectable error : [  184.342272] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 268:512, read only 512 bytes, retry
[  184.354643] uncorrectable error :
[  184.358082] uncorrectable error : [  184.361723] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 268:512, read 512 bytes
[  184.372704] [<c001051d>] (unwind_backtrace+0x1/0x8c) from [<c022ca67>] (ubi_io_read+0x14f/0x1ec)
[  184.382032] [<c022ca67>] (ubi_io_read+0x14f/0x1ec) from [<c022cda7>] (ubi_io_read_vid_hdr+0x4f/0x134)
[  184.391821] [<c022cda7>] (ubi_io_read_vid_hdr+0x4f/0x134) from [<c022fd29>] (scan_peb.part.4+0x109/0x408)
[  184.401973] [<c022fd29>] (scan_peb.part.4+0x109/0x408) from [<c0230095>] (scan_all+0x6d/0x73c)
[  184.411116] [<c0230095>] (scan_all+0x6d/0x73c) from [<c0230a45>] (ubi_attach+0x169/0x244)
[  184.419804] [<c0230a45>] (ubi_attach+0x169/0x244) from [<c0229373>] (ubi_attach_mtd_dev+0x4ff/0x980)
[  184.429503] [<c0229373>] (ubi_attach_mtd_dev+0x4ff/0x980) from [<c0229997>] (ctrl_cdev_ioctl+0x7f/0x104)
[  184.439565] [<c0229997>] (ctrl_cdev_ioctl+0x7f/0x104) from [<c009d6b1>] (vfs_ioctl+0x15/0x20)
[  184.448616] [<c009d6b1>] (vfs_ioctl+0x15/0x20) from [<c009de57>] (do_vfs_ioctl+0x3ad/0x3e2)
[  184.457487] [<c009de57>] (do_vfs_ioctl+0x3ad/0x3e2) from [<c009debd>] (sys_ioctl+0x31/0x4c)
[  184.466358] [<c009debd>] (sys_ioctl+0x31/0x4c) from [<c000c641>] (ret_fast_syscall+0x1/0x46)
[  184.494290] uncorrectable error :

I hope you can find solution for this problem.

Thanks,
Matti

Tom Rini

unread,
Oct 24, 2013, 10:42:03 AM10/24/13
to beagl...@googlegroups.com
On Thursday, October 24, 2013 6:23:24 AM UTC-4, matti.k...@gmail.com wrote:

Hi!

I am working on BeagleBone variant board using Ångström distribution.  Main difference is that NAND flash is installed on board. In fact my set-up sounds pretty much same as in "NAND flash with BeagleBone variant" case.

Short story:

UBIFS partition/volume formatted/created in Linux does not work in U-Boot. UBI part command in U-boot fails. Later on Linux finds this UBIFS corrupted. I don't have any problems if this UBIFS is accessed purely from Linux. I have made NAND flash additions from am335x-evm.dts to BeagleBone device tree. I have tried with ti,nand-ecc-opt = "bch8" (with kernel options CONFIG_MTD_NAND_OMAP_BCH and
OMAP_ECC_BCH8_CODE_HW) and without. In the latter case those kernel options were not active.

I think that at least part of the answer is that you need to enable CONFIG_SYS_NAND_ONFI_DETECTION.  You may also need to apply some of Pekon's patches from http://patchwork.ozlabs.org/project/uboot/list/?submitter=17320&state=* (there are 3 series there as of this writing, 2 v2's and a v8, you should apply all 3 series, and in the right order, saving each series to an mbox, and using git am -3 / git am --abort when they fail should help get the right order sorted out quickly).

--
Tom

matti.k...@gmail.com

unread,
Nov 2, 2013, 4:34:03 AM11/2/13
to beagl...@googlegroups.com
Hi Tom,
Somehow I had missed your answer. I'll try with your advices as soon as I get time for it. Unfortunately something still more urgent came up.
I'll let you know how it works out then.
Thanks,
Matti

matti.k...@gmail.com

unread,
Nov 2, 2013, 12:55:50 PM11/2/13
to beagl...@googlegroups.com
Hi Tom,
I had a look on those patch series. Just to check: I found 3 of v2 (2013-08-14 x 3, 2013-09-10 x 3, 2013-09-30 x 4) and one v8 (2013-10-10 x 5). Do your mean these series I should apply?
-Matti

Maxim Podbereznyy

unread,
Nov 2, 2013, 2:55:57 PM11/2/13
to beagleboard

If you want compatibility then use u-boot from ezsdk because ti guys added "ecc hw" command to set the ecc mode to software correction or hardware mode. U-boot uses the software mode for all writes, but the kernel uses the hardware correction mode. To swith back and forth you will u-boot from ti

02 нояб. 2013 г. 12:34 пользователь <matti.k...@gmail.com> написал:
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

matti.k...@gmail.com

unread,
Nov 4, 2013, 9:20:55 AM11/4/13
to beagl...@googlegroups.com
Tom,
one more question:
What tag I should use as base for those patches?
I checked the first patch of the first v2 patch sets (http://patchwork.ozlabs.org/patch/266966/) against u-boot-denx 2013.04 git tree that Ångström distribution u-boot-denx recipe provides. It seems that last patch operation applied to ../drivers/mtd/nand/omap_gpmc.c must fail as there is no matching pattern in that file. So, should I use more up-to-date tag like 2013.10 as a base for those patches and try to apply beaglebone patches over them?

Best regards,
Matti

Tom Rini

unread,
Nov 4, 2013, 9:46:19 AM11/4/13
to beagl...@googlegroups.com
On Saturday, November 2, 2013 2:55:57 PM UTC-4, lisarden wrote:

If you want compatibility then use u-boot from ezsdk because ti guys added "ecc hw" command to set the ecc mode to software correction or hardware mode. U-boot uses the software mode for all writes, but the kernel uses the hardware correction mode. To swith back and forth you will u-boot from ti

That is not true for am335x parts, ever, nor true now for omap3-based beagles now.  Things are back in sync, HW/SW mode wise now.

--
Tom

Tom Rini

unread,
Nov 4, 2013, 9:47:38 AM11/4/13
to beagl...@googlegroups.com
On Monday, November 4, 2013 9:20:55 AM UTC-5, matti.k...@gmail.com wrote:
Tom,
one more question:
What tag I should use as base for those patches?
I checked the first patch of the first v2 patch sets (http://patchwork.ozlabs.org/patch/266966/) against u-boot-denx 2013.04 git tree that Ångström distribution u-boot-denx recipe provides. It seems that last patch operation applied to ../drivers/mtd/nand/omap_gpmc.c must fail as there is no matching pattern in that file. So, should I use more up-to-date tag like 2013.10 as a base for those patches and try to apply beaglebone patches over them?

You should use current mainline or v2013.10 release for those patches, yes.

--
Tom

matti kaasinen

unread,
Nov 5, 2013, 3:35:25 AM11/5/13
to beagl...@googlegroups.com
Hi Tom,
I'm terribly sorry annoying you for once more time with this issue. I have tried to figure out what patch sets you are suggesting below.

I think that at least part of the answer is that you need to enable CONFIG_SYS_NAND_ONFI_DETECTION.  You may also need to apply some of Pekon's patches from http://patchwork.ozlabs.org/project/uboot/list/?submitter=17320&state=* (there are 3 series there as of this writing, 2 v2's and a v8, you should apply all 3 series, and in the right order, saving each series to an mbox, and using git am -3 / git am --abort when they fail should help get the right order sorted out quickly).

So, to make it clear as crystal even for me, let's list what I found matching with your message:
2013-08-14
[U-Boot,v2,1/4] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
[U-Boot,v2,2/4] mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes
[U-Boot,v2,3/4] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes
[U-Boot,v2,4/4] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes

2013-09-06
[U-Boot,v2,1/3] am33xx: elm: add support for BCH16_ECC - ELM driver updates
[U-Boot,v2,2/3] mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
[U-Boot,v2,3/3] am335x: update README for BCH16

2013-09-30
[U-Boot,v2,1/4] mtd: nand: add NAND_BUSWIDTH_AUTO to autodetect bus width
[U-Boot,v2,2/4] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width
[U-Boot,v2,3/4] am335x: fix GPMC config for NAND and NOR SPL boot
[U-Boot,v2,4/4] am33xx: add support for beaglebone x16 NAND cape

2013-10-10
[U-Boot,v8,1/5] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
[U-Boot,v8,2/5] mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes
[U-Boot,v8,3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes
[U-Boot,v8,4/5] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes
[U-Boot,v8,5/5] board/ti/am335x/README: update for NAND boot

It seems to me that 2013-08-14 and 2013-10-10 are providing (more or less) same patch set
=> My choice is 2013-10-10
2013-09-06 and 2013-09-30 seem different to me
=> these are the 2v2's your mentioned above

My guess for patching order would be:
1) 2013-10-10
2) 2013-09-06
3) 2013-09-30
-Matti


matti kaasinen

unread,
Nov 5, 2013, 4:23:06 AM11/5/13
to beagl...@googlegroups.com
Wrong date: should be 2013-09-10 instead of 2013-09-06.
-Matti
2013/11/5 matti kaasinen <matti.k...@gmail.com>

matti.k...@gmail.com

unread,
Nov 5, 2013, 11:24:52 AM11/5/13
to beagl...@googlegroups.com
Hi Tom!
I don't seem to find proper order using below patch sets.

tiistai, 5. marraskuuta 2013 10.35.25 UTC+2 matti kaasinen kirjoitti:
Hi Tom,
I'm terribly sorry annoying you for once more time with this issue. I have tried to figure out what patch sets you are suggesting below.
2013/11/2 <matti.k...@gmail.com>
I think that at least part of the answer is that you need to enable CONFIG_SYS_NAND_ONFI_DETECTION.  You may also need to apply some of Pekon's patches from http://patchwork.ozlabs.org/project/uboot/list/?submitter=17320&state=* (there are 3 series there as of this writing, 2 v2's and a v8, you should apply all 3 series, and in the right order, saving each series to an mbox, and using git am -3 / git am --abort when they fail should help get the right order sorted out quickly).

So, to make it clear as crystal even for me, let's list what I found matching with your message:
2013-08-14
[U-Boot,v2,1/4] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
[U-Boot,v2,2/4] mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes
[U-Boot,v2,3/4] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes
[U-Boot,v2,4/4] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes

2013-09-06
2013-09-10
[U-Boot,v2,1/3] am33xx: elm: add support for BCH16_ECC - ELM driver updates
[U-Boot,v2,2/3] mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
[U-Boot,v2,3/3] am335x: update README for BCH16

2013-09-30
[U-Boot,v2,1/4] mtd: nand: add NAND_BUSWIDTH_AUTO to autodetect bus width
[U-Boot,v2,2/4] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width
[U-Boot,v2,3/4] am335x: fix GPMC config for NAND and NOR SPL boot
[U-Boot,v2,4/4] am33xx: add support for beaglebone x16 NAND cape

2013-10-10
[U-Boot,v8,1/5] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform
[U-Boot,v8,2/5] mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes
[U-Boot,v8,3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes
[U-Boot,v8,4/5] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes
[U-Boot,v8,5/5] board/ti/am335x/README: update for NAND boot

It seems to me that 2013-08-14 and 2013-10-10 are providing (more or less) same patch set
=> My choice is 2013-10-10
2013-09-06 and 2013-09-30 seem different to me
=> these are the 2v2's your mentioned above

My guess for patching order would be:
1) 2013-10-10
2) 2013-09-06
2) 2013-09-10
3) 2013-09-30

Patch sets  1) 2013-10-10 and 3) 2013-09-30 work fine if 1) is executed first. However, 2) 2013-09-10 fails in every position. In particular:

"[U-Boot,v2,2/3] mtd: nand: omap: add support for BCH16_ECC - NAND driver updates"
fails in several places. Firs one takes place when appending
arch/arm/include/asm/arch-am33xx/omap_gpmc.h.
It tries to make following replacement:
- OMAP_ECC_BCH8_CODE_HW + OMAP_ECC_BCH8_CODE_HW,

even though that comma was already provided by:
"[U-Boot,v8,1/5] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform"
while creating the stuct including that line.
So, somehow it seems that some more patches are required in order to get these patches run.

Best regards,
Matti

matti.k...@gmail.com

unread,
Nov 6, 2013, 4:08:24 AM11/6/13
to beagl...@googlegroups.com
Hi Tom,
I'm sorry I'm teasing you again. Unfortunately now it really looks that this is hitting quite close to your backyard.
I fixed that particular patch problem (below) manually an as you can guess it did not help fixing whole patching process.
"[U-Boot,v2,2/3] mtd: nand: omap: add support for BCH16_ECC - NAND driver updates"
fails in several places. Firs one takes place when appending
arch/arm/include/asm/arch-am33xx/omap_gpmc.h.
It tries to make following replacement:
- OMAP_ECC_BCH8_CODE_HW + OMAP_ECC_BCH8_CODE_HW,

even though that comma was already provided by:
"[U-Boot,v8,1/5] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform"
while creating the stuct including that line.

Next problem hits when:
patch tries to execute following chunk over drivers/mtd/nand/omap_gpmc.c:
---------
@@ -295,7 +296,7 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
         break;
     case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
     case OMAP_ECC_BCH8_CODE_HW:
-        ptr = &gpmc_cfg->bch_result_0_3[0].bch_result_x[3];
+        ptr = &gpmc_cfg->bch_result_0_3[0].bch_result3;
         val = readl(ptr);
         ecc_code[i++] = (val >>  0) & 0xFF;
         ptr--;
---------
Well, there is no matching pattern there. Instead, there would be:
---------
        break;
#ifdef CONFIG_BCH
    case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
#endif
    case OMAP_ECC_BCH8_CODE_HW:
        ptr = &gpmc_cfg->bch_result_0_3[0].bch_result_x[3];
        val = readl(ptr);
        ecc_code[i++] = (val >>  0) & 0xFF;
        ptr--;
        for (j = 0; j < 3; j++) {
            val = readl(ptr);
            ecc_code[i++] = (val >> 24) & 0xFF;
            ecc_code[i++] = (val >> 16) & 0xFF;
            ecc_code[i++] = (val >>  8) & 0xFF;
            ecc_code[i++] = (val >>  0) & 0xFF;
            ptr--;
---------
That is pretty much artwork of "[U-Boot,v8,3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes"
It seems that versions "[U-Boot,v5-v7,3/5] mtd: nand: omap: optimize chip->ecc.calculate() for H/W ECC schemes" would satisfy this hunk, but somehow version v7 has been changed so that
is not proper pair with it any more. Would it not be possible using version v6 instead or v7 or are there major fixes found there?

Best regards,
Matti
tiistai, 5. marraskuuta 2013 18.24.52 UTC+2 matti.k...@gmail.com kirjoitti:

Reply all
Reply to author
Forward
0 new messages