
Hi, I'm using the latest U-Boot GIT snapshot (4/28), and trying to get UBI/UBIFS working. I'm wondering what the current status of UBI support in U-Boot is, and whether what I'm doing will work.
The goal is to get a single R/W filesystem on a large NAND partition. If I understand correctly, I should be able to:
1. [In U-Boot]: Use "mtdparts" to partition my NAND device 2. [In U-Boot]: Use "ubi part" to setup UBI on a partition 3. [In U-Boot]: Use "ubi create" to create a volume which fills the whole partition 4. [On my PC]: Use "mkfs.ubifs" & "ubinize" to create a UBIFS image 5. [In U-Boot]: Use "ubi write" to write the UBIFS image to the volume 6. [In Linux]: Boot using the UBIFS image as my rootfs
Is this more or less correct?
The problem I'm currently running into is step 2, which throws an error in ubi_io_write() (see below). Googling around turned up a few hits that suggested turning off sub-page writes, so I tried adding NAND_NO_SUBPAGE_WRITE to NAND_SAMSUNG_LP_OPTIONS, but that causes a crash. Actually, it gets to volume table copy #2 in that case, so the crash may be unrelated to subpage writes.
Anyway, I'm mainly wondering whether this is a good approach before I go chasing down this crash, and also whether others are using UBIFS on large-page flash devices successfully in U-Boot. Any feedback is appreciated, thanks!
====
=> mtdparts
device nand0 <flash>, # parts = 2 #: name size offset mask_flags 0: uboot 0x00500000 0x00000000 0 1: root 0x3fb00000 0x00500000 0
active partition: nand0,0 - (uboot) 0x00500000 @ 0x00000000
defaults: mtdids : nand0=flash mtdparts: mtdparts=flash:5M(uboot),-(root) => ubi part root Creating 1 MTD partitions on "nand0": 0x00500000-0x40000000 : "mtd=1" Bad block table found at page 524224, version 0x01 Bad block table found at page 524160, version 0x01 nand_read_bbt: Bad block at 0x01fc0000 nand_read_bbt: Bad block at 0x03440000 nand_read_bbt: Bad block at 0x03460000 nand_read_bbt: Bad block at 0x21fc0000 nand_read_bbt: Bad block at 0x21fe0000 nand_read_bbt: Bad block at 0x3a000000 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 error: ubi_io_write: error -5 while writing 512 bytes to PEB 0:512, written 0 bytes UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1:512, written 0 bytes UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2:512, written 0 bytes UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 3:512, written 0 bytes UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 4:512, written 0 bytes UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 5:512, written 0 bytes UBI error: ubi_init: cannot attach mtd1 UBI error: ubi_init: UBI error: cannot initialize UBI, error -5 UBI init error -5 exit not allowed from main input shell. =>