[meta-xilinx] u-boot/UBIFS

Edward Wingate edwingate8 at gmail.com
Tue Sep 22 17:19:09 PDT 2015


On Tue, Sep 22, 2015 at 1:12 PM, Joe Hershberger
<joe.hershberger at gmail.com> wrote:
> Bummer. Looks like you'll need to patch it a bit to use SF. Prolly
> there is something complete in Linux that you can port. Or try out
> that experimental series and give feedback on your experience.
>

I'm switched to use the bleeding edge of u-boot-xlnx-dev since the
experimental driver was merged there.  I enabled it in u-boot and am
having mixed success.

I have 3 flash partitions:
mtd0: fsbl-uboot (8M) - raw flash with FSBL, bitstream and uboot.elf
mtd1: uboot-env-itb (20M) - contains 3 UBIFS volumes (uboot-env1,
uboot-env2, itb)
mtd2: rootfs (100M) - contains 1 UBIFS volume

Should u-boot be able to mount UBIFS volumes that were created using
Linux ubi tools?  I created and populated all my volumes in Linux
using ubiformat, ubiattach, ubimkvol, ubiupdatevol.  I copy my kernel
and DTB over to the appropriate volume.  Everything looks good in
Linux.

In u-boot, mtdparts gives (I wasn't able to get this far before):
device nor0 <spi32764.0>, # parts = 3
 #: name                size            offset          mask_flags
 0: fsbl-uboot          0x00800000      0x00000000      1
 1: uboot-env-itb       0x01400000      0x00800000      0
 2: rootfs              0x06400000      0x01c00000      0

active partition: nor0,0 - (fsbl-uboot) 0x00800000 @ 0x00000000

defaults:
mtdids  : nor0=spi32764.0
mtdparts: mtdparts=spi32764.0:8M(fsbl-uboot)ro,20M(uboot-env-itb),100M(rootfs)

MTDPARTS looks correct here.  But when I go to select a partition in
u-boot using "ubi part", I get data abort error and the CPU resets:

zynq-uboot> ubi part uboot-env-itb
UBI: attaching mtd1 to ubi0
data abort
pc : [<1ff45e08>]          lr : [<1ff470d0>]
reloc pc : [<04028e08>]    lr : [<0402a0d0>]
sp : 1f2f9570  ip : ea005edb     fp : 00000004
r10: 00000000  r9 : 1f2fcef8     r8 : 00000000
r7 : 00000000  r6 : 00800000     r5 : 00000000  r4 : 00000040
r3 : 1f35f960  r2 : 00000040     r1 : 00800000  r0 : 1ff3a188
Flags: nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

Do I need to specify an offset in the ubi part command?

I created the volumes like so in Linux:
ubiformat -y /dev/mtd1
ubiformat -y /dev/mtd2

ubiattach -p /dev/mtd1
ubimkvol /dev/ubi0 -N uboot-env1 -s 4MiB
ubimkvol /dev/ubi0 -N uboot-env2 -s 4MiB
ubimkvol /dev/ubi0 -N itb -m

ubiattach -p /dev/mtd2
ubimkvol /dev/ubi1 -N rootfs -m
ubiupdatevol /dev/ubi1_0 rootfs.ubifs.img

mount -t ubifs ubi0:itb /mnt/itb
Copy kernel/DTB to /mnt/itb

mount -t ubifs ubi1:rootfs /mnt/rootfs
The rootfs looks good in /mnt/rootfs

I would expect u-boot to be able to access the kernel/DTB that I
copied using Linux, but u-boot crashes when just trying to select a
partition. Is there some kind of alignment issue I'm not taking care
of here?

I suppose I can try erasing flash and creating everything using
u-boot, but I don't have good way to copy over the kernel/DTB to the
UBI volume when doing things from u-boot serial terminal.



More information about the meta-xilinx mailing list