Hi,
I am trying to boot an AM3517 with an UBIFS file system.
Right now I am using the file system that comes with the 37's examples (AM37X EVM UBIFS NAND Flash Images), only to see if it works
The steps that I'm following are
1) Format the device ./ubiformat /dev/mtd/mtd4 -f ubi.img
Here's the output of the ubiattach
# ./ubiattach /dev/ubi_ctrl -m 4
UBI: attaching mtd4 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: attached mtd4 to ubi0
UBI: MTD device name: "jffs2-nand"
UBI: MTD device size: 248 MiB
UBI: number of good PEBs: 1988
UBI: number of bad PEBs: 0
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: 0
UBI: total number of reserved PEBs: 1988
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 1/0
UBI: image sequence number: 155038538
UBI: background thread "ubi_bgt0d" started, PID 1766
UBI device number 0, total 1988 LEBs (256499712 bytes, 244.6 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
The output of the kernel loading is encouraging because it shows how it attaches the ubi to the mtd, more o less the same as when I do it myself from the command line.
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit)
Creating 5 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000080000 : "xloader-nand"
0x000000080000-0x000000240000 : "uboot-nand"
0x000000240000-0x000000280000 : "params-nand"
0x000000280000-0x000000780000 : "linux-nand"
0x000000780000-0x000010000000 : "jffs2-nand"
UBI: attaching mtd4 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: attached mtd4 to ubi0
UBI: MTD device name: "jffs2-nand"
UBI: MTD device size: 248 MiB
UBI: number of good PEBs: 1988
UBI: number of bad PEBs: 0
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: 0
UBI: total number of reserved PEBs: 1988
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 1/0
UBI: image sequence number: 155038538
UBI: background thread "ubi_bgt0d" started, PID 441
but I'm having a problem at mounting time
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 512 mtdblock0 (driver?)
1f01 1792 mtdblock1 (driver?)
1f02 256 mtdblock2 (driver?)
1f03 5120 mtdblock3 (driver?)
1f04 254464 mtdblock4 (driver?)
1f05 247590 mtdblock5 (driver?)
b300 3872256 mmcblk0 driver: mmcblk
b301 72261 mmcblk0p1
b302 1935832 mmcblk0p2
b303 1863540 mmcblk0p3
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
I reckon that is has to be something related to u-boot, to the parameters that we are passing to the kernel or the UBI support of the u-boot. Any clue?
I've tried with different u-boot parameters like
root=/dev/mtdblock4 ubi.mtd=4
root=/dev/mtd/mtd4 ubi.mtd=4
root=ubi0 ubi.mtd=4
root=ubi0:rootfs ubi.mtd=4
but none of then works.
My u-boot parameters
baudrate=115200
bootfile=uImage
dieid#=7ddc000100000000015da3960400400b
ethact=DaVinci EMAC
filesize=6F2F0
ethaddr=f8:dc:7a:00:18:e3
netmask=255.255.255.0
gatewayip=192.168.3.254
serverip=192.168.3.12
ipaddr=192.168.3.17
get_kernel=run nand_kernel
mmc_kernel=mmc init; fatload mmc 1 0x80000000 uImage
nand_kernel=nand read.i 0x80000000 280000 300000
tftp_kernel=tftpboot 0x80000000 uImage
bootargs_fs_dvi=mem=256M console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 omapfb.mode=dvi:1280x720-24@60 omapdss.def_disp=dvi
bootargs_nfs=mem=256M console=ttyS2,115200n8 noinitrd rw root=/dev/nfs nfsroot=/mnt/nfs,nolock ip=dhcp
boot_fs_dvi=run get_kernel; setenv bootargs $bootargs_fs_dvi; run addip; bootm 0x80000000
boot_nfs=run get_kernel; setenv bootargs $bootargs_nfs; run addip; bootm 0x80000000
bootcmd=run boot_ubi_nand
bootdelay=2
boot_fs_nand=run get_kernel; setenv bootargs $bootargs_fs_nand; run addip; bootm 0x80000000
bootargs_fs_mmc=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mmcblk0p2 rw init=/init rootfstype=ext3 rootdelay=1
boot_fs_mmc=run get_kernel; setenv bootargs $bootargs_fs_mmc; run addip; bootm 0x80000000
bootargs_fs_nand=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mtdblock4 rw init=/init rootfstype=jffs2 rootdelay=1
bootargs=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mtdblock4 rw init=/init rootfstype=jubifs ubi.mtd=4 rootdelay=1
boot_ubi_nand=run get_kernel; setenv bootargs $bootargs_ubi_nand; run addip; bootm 0x80000000
bootargs_ubi_nand=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=ubi0:rootfs rw init=/init rootfstype=ubifs ubi.mtd=4 rootwait bootdelay=2 ethaddr=$(ethaddr) ip=192.168.3.17
stdin=serial
stdout=serial
stderr=serial
Thanks in advance.