mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Tibault Damman <tibault.damman@basalte.be>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: nand "BCH decoding failed" when using bch8_hw_romcode ecc mode
Date: Thu, 17 Mar 2022 08:46:28 +0100	[thread overview]
Message-ID: <20220317074628.GT405@pengutronix.de> (raw)
In-Reply-To: <DB7PR04MB424951EBC916B7A1E0A1B274E8119@DB7PR04MB4249.eurprd04.prod.outlook.com>

Hi,

On Wed, Mar 16, 2022 at 01:45:31PM +0000, Tibault Damman wrote:
> Hi all
> 
> Due to component shortages, I'm trying to move an old board from a Phytec Phycore omap4430 with 8bit nand (Micron MT29F4G08ABBDAH4) to an omap4460 variant with 16bit nand (Micron MT29F8G16ADBDAH4).
> 
> To be compatible with Linux 5.4, the rootfs nand (ubi) partition needs to be in BCH8_HW_ROMCODE ecc mode instead of the default BCH8_HW.
> When I use ubiformat or ubiattach from barebox in this mode though, I get a bazillion "BCH decoding failed" prints (which I did not get on the omap4430)
> 
> > barebox@Phytec phyCORE-OMAP4460:/ ubiattach -O 2048 /dev/nand0.sys
> > ...
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > nand0.root: error -74 (ECC error) while reading 512 bytes from PEB 887:0
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > nand0.root: error -74 (ECC error) while reading 512 bytes from PEB 888:0
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > BCH decoding failed
> > ...
> 
> I tried these combinations:
> * omap4430 (8bit nand) + BCH8_HW ecc: works (but not compatible with Linux)
> * omap4430 (8bit nand) + BCH8_HW_ROMCODE ecc: works
> * omap4460 (16bit nand) + BCH8_HW ecc: works (but not compatible with Linux)
> * omap4460 (16bit nand) + BCH8_HW_ROMCODE ecc: does not work
> 
> I've reproduced this on the following barebox versions:
> * phytec's 2013.06 fork
> * 2019.07.0 (which I've been (successfully) using for omap4430)
> * the latest 2020.03.0
> 
> Any clues what could be going wrong here?

No clue, just some things you could test:

- in BCH8_HW_ROMCODE barebox can't read what it has written itself,
  right?
- Can barebox read what Linux has written in this mode?
- Use Linux to write known data to a page:
  seq 10000 > foo
  flash_erase /dev/mtdx 0 0
  nandwrite /dev/mtdx foo
- Read the same page in raw mode in barebox:
  md -s /dev/nand0.raw 0+2112
- Write the same data with barebox
- Read again:
  md -s /dev/nand0.raw 0+2112
- Compare the results

You could also just return successfully in chien() when the result would
fail and see what you read.

Use plain NAND accesses for now, i.e. no UBI.

Playing with these things should give us a starting point where to look
at.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-03-17  7:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 13:45 Tibault Damman
2022-03-17  7:46 ` Sascha Hauer [this message]
2022-03-18  9:49   ` Tibault Damman
2022-03-18 10:32   ` Tibault Damman
2022-03-18 11:59     ` Sascha Hauer
2022-03-18 21:41       ` Trent Piepho
2022-03-21  8:04       ` Tibault Damman

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=20220317074628.GT405@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=tibault.damman@basalte.be \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox