From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 13 Jun 2013 14:52:14 +0200 Subject: [U-Boot] dfu, nand: writing on not empty nand partition In-Reply-To: <51B9BC33.3070405@ti.com> References: <51B9B7D6.8020701@denx.de> <51B9BC33.3070405@ti.com> Message-ID: <51B9C07E.3040604@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Tom, Am 13.06.2013 14:33, schrieb Tom Rini: > 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. Ok, can do it this way also ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany