[meta-xilinx] problem with using ubifs in u-boot on zynq7000

avallash avallash at o2.pl
Mon Nov 16 11:04:35 PST 2015


Hi,

Recently I am trying to read some data from from ubifs partition in u-boot.
The goal of this is to be able to load kernel, device tree and rootfs from
ubifs during boot or fit image stored on ubifs.

For now I’m using u-boot from petalinux 2015.2, but soon I will be moving
to yocto 1.8.x with meta-xilinx. Since a lot of early development on Xilinx
chips is done on petalinux maybe someone will know.

Attaching to UBI or UBIFS in u-boot fails and I think that correct
detection of device on which we describe partition layout is provided has
some bug. Does this happen on u-boot from meta-xilinx ?



Details:

I added these configs

#define CONFIG_CMD_UBI

#define CONFIG_CMD_UBIFS

#define CONFIG_RBTREE

#define CONFIG_MTD_DEVICE

#define CONFIG_MTD_PARTITIONS

#define CONFIG_CMD_MTDPARTS

#define CONFIG_LZO

#ifndef CONFIG_SPI_FLASH_MTD

    #define CONFIG_SPI_FLASH_MTD

#endif // CONFIG_SPI_FLASH_MTD



to <petalinux
project_root>/build/linux/u-boot/src/u-boot-plnx/include/configs/platform-auto.h



I power on, and get

“*** Warning - bad CRC, using default environment”

but denx.de provides this answer

“Most probably everything is OK. The message is printed because the flash
sector or ERPROM containing the environment variables has never been
initialized yet. The message will go away as soon as you save the
envrionment variables using the *saveenv* command.”

So I assume it’s OK since we use default env from platform_auto.h. (
http://www.denx.de/wiki/view/DULG/WarningBadCRCUsingDefaultEnvironment)



I’m executing following cmds in u-boot:

U-Boot-PetaLinux> sf probe 0 0 0

SF: Detected S25FL512S_256K with page size 512 Bytes, erase size 256 KiB,
total 64 MiB

here is one thing I noticed – from http://www.wiki.xilinx.com/U-boot I get
that the correct response should include creating a device (most probably
nor0) which we do not get

uboot> sf probe 0 0 0

SF: Detected N25Q128 with page size 256, total 16 MiB

16384 KiB N25Q128 at 0:0 is now current device

setenv mtdids nor0

setenv mtdparts nor0:11M(boot),256k(bootenv),14M(kernel),-(spare)



the ubi or ubifs commands fail on mtdparts, and when I call mtdparts I get:

U-Boot-PetaLinux> mtdparts

mtdids: incorrect <dev-num>



Am I using incorrect device alias so that there is a problem with mtdids?

Is there some different naming convention in Xilinx u-boot?

Am I probing incorrectly and therefore do not get device listed?

Do you know any other procedure to read from ubifs partition, or at least
attach ubi? I got some info that on yocto built u-boot (not Xilinx
platform) this approach works.



Note: There is no problem in accessing the raw flash itself (I can copy the
data from sapre partition to ram) and I boot to kernel without any
problems. Also, I can r/w access ubifs volume in linux.

Note: The partition layout is as described in mtdparts command, where *boot*
is fsbl + fpga bitstream + u-boot, *bootenv* is some custom
parameterization  data that may be used during boot, *kernel* is fit image
of kernel + dtb + ram root fs, *spare* is formatted to ubi and on top of
that ubifs.


hope someone can push me in the right direction,

Best regards,

A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20151116/23a5593a/attachment.html>


More information about the meta-xilinx mailing list