All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Williams <Aaron.Williams@cavium.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot: using nand write to flash an ubi image, ubi part fails
Date: Thu, 29 Sep 2011 23:46:36 -0700	[thread overview]
Message-ID: <4E8565CC.5060201@cavium.com> (raw)
In-Reply-To: <1317353613.60659.YahooMailClassic@web160608.mail.bf1.yahoo.com>

Thanks.

I finally found the problem on our end and now I have ubifs working
beautifully.

-Aaron

On 09/29/2011 08:33 PM, Lars Michael wrote:
> --- On Thu, 29/9/11, Aaron Williams <Aaron.Williams@cavium.com> wrote:
>> From: Aaron Williams <Aaron.Williams@cavium.com>
>> Subject: Re: [U-Boot] U-Boot: using nand write to flash an ubi image, ubi part fails
>> To: u-boot at lists.denx.de
>> Cc: "Lars Michael" <lh_post@yahoo.com>
>> Date: Thursday, 29 September, 2011, 4:11
>> Hi Lars,
>>
>> Were you ever successful in getting UBI to work in U-Boot?
>> I am in a similar 
>> boat. I have UBI working beautifully in Linux (2.6.32.27)
>> but so far I've had 
>> no luck in U-Boot.
>>
>> -Aaron
> Hi Aaron,
>
> Good question, I am not able to write a ubi image (created by ubinize) 
> and then attatch to it from U-Boot. I found that I need the free space
> fixup patch. My U-Boot is rather old (2009.08) and I can not easily
> apply that patch due to too many other changes. So for now, I must
> write the image from Linux, do the fixup and then U-Boot is able to
> attach. 
>
> Regards,
> - Lars 
>
>> On Monday, July 18, 2011 02:29:08 AM Lars Michael wrote:
>>> Hello Ben,
>>>
>>> --- On Wed, 1/6/11, Ben Gardiner <bengardiner@nanometrics.ca>
>> wrote:
>>>>> Using mkfs.ubifs and ubinize I have created
>> an image
>>>> with 5 volumes. In Linux I could flash it using
>> "ubiformat
>>>> /dev/mtd1 -f /root/ubi.img" and attach it using
>> "ubiattach
>>>> /dev/ubi_ctrl -m 1". It worked.
>>>>
>>>>> In production I would prefer to write the
>> image from
>>>> U-Boot. So in U-Boot I used "nand erase" then
>> "nand write"
>>>> to flash the image. Then I want to attach by "ubi
>> part"
>>>> command - but this fails: "UBI error: ubi_init:
>> UBI error:
>>>> cannot initialize UBI, error -17"
>>>>
>>>>> [...]
>>>>> I realize that the U-Boot 'nand erase' does
>> not
>>>> preserve the erase counters. So what would be the
>> correct
>>>> way to erase and write in U-Boot? And why is the
>> ubiformat
>>>> not able to correct the problems?
>>>>
>>>> It's true that the ECs are not preserved. But
>> it's also
>>>> true that
>>>> trailing pages of 0xff are not trimmed either.
>> You
>>>> definitely need to
>>>> drop trailing 0xff pages when writing ubinized
>> images
>>>> containing UBIFS
>>>> volumes. To do this you can use either the new
>> 'nand write'
>>>> variant,
>>>> .trimffs [1] which is currently patches that have
>> been
>>>> Acked. Or you
>>>> can use the free-space-fixup feature which is
>> available in
>>>> the
>>>> ubifs-2.6 tree and requires that you use a
>> mkfs.ubifs built
>>>> from the
>>>> the mtd-utils tree.
>>> Ok, I have updated my mtd-utils and recompiled the
>> mkfs.ubifs to get
>>> support for the free-space-fixup feature. Next I have
>> pulled
>>> all ubi updates from the 2.6.29 backport tree which
>> gave med 154 patches
>>> including the fixup.
>>>
>>> Now I can build the image, ubiformat, ubiattach and
>> mount with success.
>>> After a reboot I can ubiattach and mount with
>> success.
>>> Next step is to get it to work in U-Boot too.
>>>
>>> Thanks and regards,
>>> - Lars
>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>> -- 
>> Aaron Williams <Aaron.Williams@cavium.com>
>>  (408) 943-7198
>>

  reply	other threads:[~2011-09-30  6:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  7:57 U-Boot: using nand write to flash an ubi image, ubi part fails Lars Michael
2011-06-01 11:56 ` Artem Bityutskiy
2011-06-01 11:56   ` [U-Boot] " Artem Bityutskiy
2011-06-01 13:41   ` Ben Gardiner
2011-06-01 13:41     ` [U-Boot] " Ben Gardiner
2011-07-18  9:29     ` Lars Michael
2011-07-18  9:29       ` [U-Boot] " Lars Michael
2011-09-29  2:11       ` Aaron Williams
2011-09-30  3:33         ` Lars Michael
2011-09-30  6:46           ` Aaron Williams [this message]
2011-10-01 19:01             ` Lars Michael
2011-09-29  2:43 ` Matthew L. Creech
2011-09-29  2:43   ` [U-Boot] " Matthew L. Creech
2011-09-30  3:44   ` Lars Michael
2011-09-30  3:44     ` [U-Boot] " Lars Michael
2011-10-03 20:36     ` Scott Wood
2011-10-03 20:36       ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E8565CC.5060201@cavium.com \
    --to=aaron.williams@cavium.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.