Hi,
I am using a LS1046 Freeway board. I want to create a Ubifs file system on the NAND flash and write to it from Linux and read from it in Uboot.
I create a Ubifs file system and a dummy file on it as follows:
root@localhost:~# ubiformat /dev/mtd0
ubiformat: mtd0 (nand), size 536870912 bytes (512.0 MiB), 4096 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 4095 -- 100 % complete
ubiformat: 4092 eraseblocks have valid erase counter, mean value is 1
ubiformat: 4 bad eraseblocks found, numbers: 4092, 4093, 4094, 4095
ubiformat: formatting eraseblock 4095 -- 100 % complete
root@localhost:~# ubiattach -p /dev/mtd0
UBI device number 0, total 4092 LEBs (519585792 bytes, 495.5 MiB), available 4012 LEBs (509427712 bytes, 485.8 MiB), LEB size 126976 bytes (124.0 KiB)
root@localhost:~# ubimkvol /dev/ubi0 -N failsafe -s 32MiB
Volume ID 0, size 265 LEBs (33648640 bytes, 32.1 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "failsafe", alignment 1
root@localhost:~# ubiupdatevol -t /dev/ubi0_0
root@localhost:~# mount -t ubifs ubi0:failsafe ff
root@localhost:~# echo "Hello World" > ff/hello
Next, I try to use the created file system from Uboot as follows.
=> setenv mtdids nand0=7e800000.flash
=> setenv mtdparts mtdparts=7e800000.flash:32m(failsafe)
device nand0 <7e800000.flash>, # parts = 1
#: name size offset mask_flags
0: failsafe 0x02000000 0x00000000 0
active partition: nand0,0 - (failsafe) 0x02000000 @ 0x00000000
mtdparts: mtdparts=1550000.spi:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)
ubi0: scanning is finished
ubi0 error: ubi_read_volume_table: the layout volume was not found
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -22
UBI error: cannot attach mtd1
UBI error: cannot initialize UBI, error -22
Please check, if the correct MTD partition is used (size big enough?)
If I use 'ubi part nand0' instead of 'ubi part failsafe' then the error message is the same except that error code 12 is reported instead of 22.
Can anybody help me with the uboot commands to read from the Ubifs file system?
Regards,
Jan.