All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Tim Harvey <tharvey@gateworks.com>
Cc: linux-mtd@lists.infradead.org, u-boot <u-boot@lists.denx.de>,
	Carlos Rafael Giani <dv@pseudoterminal.org>,
	Ryan Erbstoesser <rerbstoesser@gateworks.com>
Subject: Re: reading ubi from a NAND for programming to other devices
Date: Fri, 26 Jan 2018 10:24:13 +0100	[thread overview]
Message-ID: <20180126102413.5faa4534@jawa> (raw)
In-Reply-To: <CAJ+vNU2YFMR5WkekSgHfRHo10PgqKBski0a47qEn2XKZ-zjE9Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2212 bytes --]

Hi Tim,

> Greetings,
> 
> I'm looking to understand what methods are available for
> reading/writing ubi/ubifs from an existing NAND flash in order to
> duplicate the contents onto another device in U-Boot, Linux, and with
> JTAG flashing for production.

You may want to check if nanddump / nandwrite will work for you (but
those are Linux utils, not available in u-boot).

http://git.infradead.org/mtd-utils.git/tree/HEAD:/nand-utils

> 
> Typically I create ubi's using ubinize then I can use U-Boot 'nand
> erase' and 'nand write' or JTAG to write the ubi without issues.
> However if I use U-Boot 'nand read' to read a ubi then write it back
> using the same method I get 'ubi0 warning: ubi_io_read: error -74 (ECC
> error)' and 'ubi0 error: ubi_io_read: error -74 (ECC error)' messages
> from Linux when its mounted. I find I run into the same problem when
> JTAG programming ubi's: no issues when using a ubi created via ubinize
> but when flashing one that came from a U-Boot 'nand read' I see ubi
> errors when mounting it.
> 
> Some testing shows me that I can't use U-Boot nand read/erase/write
> once U-Boot has 'attached' the UBI (via the U-Boot 'ubi part' command)
> which scans and re-sizes the volume.
> 
> If I on the other hand take a ubi from U-Boot 'nand read' and use
> Linux ubiformat to flash that onto a new device I get no ubi
> warnings/errors when its mounted. My understanding is that ubiformat
> is simply preserving erase counters but there must be something else
> its doing.
> 
> What's going on here and what can I do in U-Boot/JTAG to properly
> write ubi that's been read from an existing system? I'm hoping there
> is a method that doesn't require iterating over the individual volumes
> within the ubi.
> 
> Best Regards,
> 
> Tim
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] reading ubi from a NAND for programming to other devices
Date: Fri, 26 Jan 2018 10:24:13 +0100	[thread overview]
Message-ID: <20180126102413.5faa4534@jawa> (raw)
In-Reply-To: <CAJ+vNU2YFMR5WkekSgHfRHo10PgqKBski0a47qEn2XKZ-zjE9Q@mail.gmail.com>

Hi Tim,

> Greetings,
> 
> I'm looking to understand what methods are available for
> reading/writing ubi/ubifs from an existing NAND flash in order to
> duplicate the contents onto another device in U-Boot, Linux, and with
> JTAG flashing for production.

You may want to check if nanddump / nandwrite will work for you (but
those are Linux utils, not available in u-boot).

http://git.infradead.org/mtd-utils.git/tree/HEAD:/nand-utils

> 
> Typically I create ubi's using ubinize then I can use U-Boot 'nand
> erase' and 'nand write' or JTAG to write the ubi without issues.
> However if I use U-Boot 'nand read' to read a ubi then write it back
> using the same method I get 'ubi0 warning: ubi_io_read: error -74 (ECC
> error)' and 'ubi0 error: ubi_io_read: error -74 (ECC error)' messages
> from Linux when its mounted. I find I run into the same problem when
> JTAG programming ubi's: no issues when using a ubi created via ubinize
> but when flashing one that came from a U-Boot 'nand read' I see ubi
> errors when mounting it.
> 
> Some testing shows me that I can't use U-Boot nand read/erase/write
> once U-Boot has 'attached' the UBI (via the U-Boot 'ubi part' command)
> which scans and re-sizes the volume.
> 
> If I on the other hand take a ubi from U-Boot 'nand read' and use
> Linux ubiformat to flash that onto a new device I get no ubi
> warnings/errors when its mounted. My understanding is that ubiformat
> is simply preserving erase counters but there must be something else
> its doing.
> 
> What's going on here and what can I do in U-Boot/JTAG to properly
> write ubi that's been read from an existing system? I'm hoping there
> is a method that doesn't require iterating over the individual volumes
> within the ubi.
> 
> Best Regards,
> 
> Tim
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180126/69c4d726/attachment.sig>

  reply	other threads:[~2018-01-26  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 19:51 reading ubi from a NAND for programming to other devices Tim Harvey
2017-10-12 19:51 ` [U-Boot] " Tim Harvey
2018-01-26  9:24 ` Lukasz Majewski [this message]
2018-01-26  9:24   ` Lukasz Majewski

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=20180126102413.5faa4534@jawa \
    --to=lukma@denx.de \
    --cc=dv@pseudoterminal.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rerbstoesser@gateworks.com \
    --cc=tharvey@gateworks.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.