All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] dfu, nand: writing on not empty nand partition
Date: Thu, 13 Jun 2013 08:33:55 -0400	[thread overview]
Message-ID: <51B9BC33.3070405@ti.com> (raw)
In-Reply-To: <51B9B7D6.8020701@denx.de>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/13/2013 08:15 AM, Heiko Schocher wrote:
> Hello,
> 
> I just tried to write with "dfu" and dfu-util on the host to a not
> empty partiton on a nand flash. After the dfu returned without
> error, I wanted to read the nand partiton with "nand read" and I
> get ECC errors. This is on an am335x based board (mainline patches
> coming soon) with ECC BCH8 enabled...
[snip]
> Is this a bug or a feature?
> 
> If it is a bug, I fixed it as I added in my tree in 
> drivers/mtd/nand/nand_util.c a nand_erase_write_skip_bad() 
> function, which erases before writes to "off, length" ... and call
> this function in drivers/dfu/dfu_nand.c nand_block_op() instead
> nand_write_skip_bad() ... Is this a possible solution?

So yes, if you don't erase first, just like doing a nand write from
the command line, it will fail.  This is arguably a bug.  But, I would
go for making dfu_nand spell out a call to an existing erase function
since we know the size of the alt setting to be written to.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRubwzAAoJENk4IS6UOR1WceYP/RFobx5O0JXJ60d7BhvmjFhl
okzfkxu04Mh/qckehZntF+AjRP1lrZvs2b7I0xWd2BRn2dqjrS9ViqS0Hs9WQ2x8
enMGJGAq03+M3uNiSgZ9OjNbKb5eWm3XAhvqc6uUnWtcJAccMSJ0EHS1u95am6Pa
iaY98ofydIHZNO5nyJ7rMmPPLUG13ADTR3JZrFwro7rpxQAc64yIu7klzyD8BqhA
mJug5HdiUqXnkb9caTK8REVQ0hatp2Qpv3KZq2rgDbe0urRNpHxg3khCb+2j1duI
Ts85dcYQj824cbIipPxd3/8I50LrAe6pxO4aS3tSEX6bri+3R4PvTv+uo9g94dZJ
gAaLp9fdZDNSola9T1Ae5aG6eYjKVa6U7UfcAKKW5+GTG4wEuA1tzb0HUj+aMdST
FPL7Z8Fkd0np67H1HSDurzrMyOHi+yk+mfMvYsJLnbZGxvZ+3YTBynAxT5KSUDIs
fNsZRdh4hgr8Dg/DQ2tkJ35EjgWTjwQAwtWwC1rfC3aznWj/08H33vxsZrnwYUvz
hNV3VD/p6BGoPUOmtS0DN3QZeDeX3ur+Sv6l7dMIHKKeUOGHtrpAOtBiSJp2LxvE
6xQ0LyBSEleJuZ64jdMY2Lq8jnA5ZZgJt0f+Tg+qEQDHr56cZAhRQtyD6rEj3iiG
O+chE7ulvNQ89XSziDoo
=++kF
-----END PGP SIGNATURE-----

  reply	other threads:[~2013-06-13 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13 12:15 [U-Boot] dfu, nand: writing on not empty nand partition Heiko Schocher
2013-06-13 12:33 ` Tom Rini [this message]
2013-06-13 12:52   ` Heiko Schocher

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=51B9BC33.3070405@ti.com \
    --to=trini@ti.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.