Hello experts!
I am working on a project based on a TI DM8168 that will be running a linux system from NAND. In order to avoid reliability issues caused by NAND blocks' corruptable nature, I decided to implement a solution based on UBI: The nand will be divided in two partitions - the first one for U-boot, and the second one for a two volume UBI partition. The first volume would be containing the linux kernel, and the second one the rootfs on UBIFS.
With this set up I need UBI support on U-Boot, but unfortunately, when enabling it on the u-boot-2010.06-psp04.00.01.13.patch1 version found on SDK version 5.03.01.15 I am unable to make UBI work. Here's the output of u-boot:
U-Boot 2010.06 (Mar 12 2012 - 17:25:29)
TI8168-GP rev 1.1
ARM clk: 987MHz
DDR clk: 796MHz
DRAM: 2 GiB
NAND: HW ECC Hamming Code selected
512 MiB
Net: Detected MACID:90:d7:eb:1c:ae:42
No ETH PHY detected!!!
DaVinci EMAC
Hit any key to stop autoboot: 0
UBoot#print mtdids
mtdids=nand0=omap2-nand
UBoot#print mtdparts
mtdparts=mtdparts=omap2-nand:896k(uboot),128k(env),-(partubi)
UBoot#nand erase partubi
NAND erase: device 0 offset 0x100000, size 0x1ff00000
Erasing at 0x1ffe0000 -- 100% complete.
OK
UBoot#ubi part partubi
Creating 1 MTD partitions on "nand0":
0x000000100000-0x000020000000 : "mtd=2"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI error: erase_worker: failed to erase PEB 762, error -12
UBI error: sync_erase: erase counter overflow at PEB 0, EC 18446744071569407449
UBI error: erase_worker: failed to erase PEB 0, error -22
UBI warning: ubi_ro_mode: switch to read-only mode
UBI error: do_work: work failed with error code -22
UBI error: do_work: work failed with error code -12
UBI error: ubi_init: cannot attach mtd1
UBI error: ubi_init: UBI error: cannot initialize UBI, error -12
UBI init error -12
exit not allowed from main input shell.
Any help in debugging / solving this would be much appreciated. I will be investigating the matter myself but as of now, I am now sure what I can do about this... I will share any new information regarding this if I find a solution to this problem.
To TI employees: Is there any future plan to give official support to UBI in u-boot on the SDK?